1#ifndef OPAL_Attributes_HH
2#define OPAL_Attributes_HH
26#include <initializer_list>
45 extern Attribute
makeBool(
const std::string &name,
const std::string &help);
50 makeBool(
const std::string &name,
const std::string &help,
bool initial);
56 bool getBool(
const Attribute &);
59 extern void setBool(Attribute &,
bool);
64 extern Attribute
makeBoolArray(
const std::string &name,
const std::string &help);
67 extern std::vector<bool>
getBoolArray(
const Attribute &);
70 extern void setBoolArray(Attribute &,
const std::vector<bool> &);
75 extern Attribute
makePlace(
const std::string &name,
const std::string &help);
78 extern PlaceRep
getPlace(
const Attribute &);
81 extern void setPlace(Attribute &,
const PlaceRep &);
86 extern Attribute
makeRange(
const std::string &name,
const std::string &help);
89 extern RangeRep
getRange(
const Attribute &);
92 extern void setRange(Attribute &,
const RangeRep &);
98 makeReal(
const std::string &name,
const std::string &help);
103 makeReal(
const std::string &name,
const std::string &help,
double initial);
106 extern double getReal(
const Attribute &attr);
109 extern void setReal(Attribute &attr,
double val);
114 extern Attribute
makeRealArray(
const std::string &name,
const std::string &help);
117 extern std::vector<double>
getRealArray(
const Attribute &);
120 extern void setRealArray(Attribute &,
const std::vector<double> &);
125 extern Attribute
makeReference(
const std::string &name,
const std::string &help);
130 extern Attribute
makeString(
const std::string &name,
const std::string &help);
135 makeString(
const std::string &name,
const std::string &help,
const std::string &initial);
138 extern std::string
getString(
const Attribute &attr);
141 extern void setString(Attribute &attr,
const std::string &val);
146 const std::string &help,
147 const std::initializer_list<std::string>& predefinedStrings);
153 const std::string &help,
154 const std::initializer_list<std::string>& predefinedStrings,
155 const std::string &initial);
167 makeUpperCaseString(
const std::string &name,
const std::string &help,
const std::string &initial);
174 extern Attribute
makeStringArray(
const std::string &name,
const std::string &help);
177 extern std::vector<std::string>
getStringArray(
const Attribute &);
180 extern void setStringArray(Attribute &,
const std::vector<std::string> &);
191 extern Attribute
makeTableRow(
const std::string &name,
const std::string &help);
197 extern void setTableRow(Attribute &,
const TableRowRep &);
202 extern Attribute
makeTokenList(
const std::string &name,
const std::string &help);
205 extern std::list<Token>
getTokenList(
const Attribute &attr);
208 extern void setTokenList(Attribute &attr,
const std::list<Token> &);
213 extern Attribute
makeTokenListArray(
const std::string &name,
const std::string &help);
216 extern std::vector<std::list<Token> >
A collection of routines to construct object Attributes and retrieve.
Attribute makePlace(const std::string &name, const std::string &help)
Create a place attribute.
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
double getReal(const Attribute &attr)
Return real value.
void setBoolArray(Attribute &attr, const std::vector< bool > &value)
Set logical array value.
void setUpperCaseStringArray(Attribute &attr, const std::vector< std::string > &value)
Set upper case string array value.
Attribute makeUpperCaseStringArray(const std::string &name, const std::string &help)
Make uppercase string array attribute.
void setRealArray(Attribute &attr, const std::vector< double > &value)
Set array value.
void setBool(Attribute &attr, bool val)
Set logical value.
std::list< Token > getTokenList(const Attribute &attr)
Return token list value.
void setTableRow(Attribute &attr, const TableRowRep &rep)
Set table row value.
Attribute makeUpperCaseString(const std::string &name, const std::string &help)
Make uppercase string attribute.
Attribute makeStringArray(const std::string &name, const std::string &help)
Create a string array attribute.
void setUpperCaseString(Attribute &attr, const std::string &val)
Set uppercase string value.
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Attribute makeTableRow(const std::string &name, const std::string &help)
Create a table row attribute.
Attribute makeReference(const std::string &name, const std::string &help)
Create a reference attribute.
void setRange(Attribute &attr, const RangeRep &rep)
Set range value.
void setString(Attribute &attr, const std::string &val)
Set string value.
Attribute makeRange(const std::string &name, const std::string &help)
Create a range attribute.
Attribute makeTokenListArray(const std::string &name, const std::string &help)
Make token list attribute.
std::vector< bool > getBoolArray(const Attribute &attr)
Get logical array value.
bool getBool(const Attribute &attr)
Return logical value.
TableRowRep getTableRow(const Attribute &attr)
Get table row value.
Attribute makeTokenList(const std::string &name, const std::string &help)
Make token list attribute.
void setTokenListArray(Attribute &attr, const std::vector< std::list< Token > > &value)
Set token list array value.
void setReal(Attribute &attr, double val)
Set real value.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
void setStringArray(Attribute &attr, const std::vector< std::string > &value)
Set string array value.
PlaceRep getPlace(const Attribute &attr)
Get place value.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
std::vector< std::string > getStringArray(const Attribute &attr)
Get string array value.
void setPredefinedString(Attribute &attr, const std::string &val)
Set predefined string value.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeBoolArray(const std::string &name, const std::string &help)
Create a logical array attribute.
std::vector< std::list< Token > > getTokenListArray(const Attribute &attr)
Return token list array value.
void setTokenList(Attribute &attr, const std::list< Token > &val)
Set token list value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
RangeRep getRange(const Attribute &attr)
Get range value.
void setPlace(Attribute &attr, const PlaceRep &rep)
Set place value.
Representation of a place within a beam line or sequence.
Representation of a range within a beam line or sequence.
Representation of a table row reference.