Public Member Functions |
| SwitchBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe, bool readonly) |
| Standard constructor.
|
virtual string | exec (InterfacedBase &ib, string action, string arguments) const |
| The general interface method overriding the one in InterfaceBase.
|
virtual string | fullDescription (const InterfacedBase &ib) const |
| Return a complete description of this switch.
|
virtual string | type () const |
| Return a code for the type of this switch.
|
virtual void | set (InterfacedBase &ib, long val) const =0 |
| Set the member variable of ib to val.
|
virtual long | get (const InterfacedBase &ib) const =0 |
| Return the value of the member variable of ib.
|
virtual long | def (const InterfacedBase &ib) const =0 |
| Return the default value for the member variable of ib.
|
void | setDef (InterfacedBase &i) const |
| Set the member variable of ib to its default value.
|
bool | check (long newValue) const |
| Check if val is among the listed options.
|
const OptionMap & | options () const |
| Return the map relating options to their values.
|
virtual string | doxygenType () const |
| Return a string describing the type of interface to be included in the Doxygen documentation.
|
string | opttag (long opt) const |
| Return a string with the option index and its associated tag.
|
| InterfaceBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe, bool readonly) |
| Standard constructor.
|
virtual | ~InterfaceBase () |
| The destructor.
|
string | tag (int pos=-1) const |
| Create a tag for this interface using its name and optional poisitional argument.
|
virtual bool | notDefault (InterfacedBase &) const |
| Returns true if the setting for this interface has been changed from its default value.
|
map< string, string > & | objectDefaults (InterfacedBase &) const |
| Returns the map of objectDefaults of the given object.
|
virtual void | rebind (InterfacedBase &, const TranslationMap &, const IVector &=IVector()) const |
| Rebind all references in ib according to the translation map.
|
virtual IVector | getReferences (const InterfacedBase &) const |
| For derived classes interfacing references between Interfaced objects, return the references for this interface.
|
string | description () const |
| Return the description of this interface.
|
virtual void | doxygenDescription (ostream &stream) const |
| Print a description to be included in the Doxygen documentation to the given stream.
|
string | className () const |
| Return the class name for the class this interface is defined for.
|
bool | dependencySafe () const |
| Get the flag saying whether changing an object with this interface may change the state of a dependent object .
|
void | setDependencySafe () |
| Set the flag saying whether changing an object with this interface may change the state of a dependent object .
|
void | setDependencySensitive () |
| Set the flag saying whether changing an object with this interface may change the state of a dependent object .
|
bool | readOnly () const |
| Get the flag saying whether this interface is allowed to change an object.
|
void | setReadOnly () |
| Set the flag saying that this interface is allowed to change an object.
|
void | setReadWrite () |
| Unset the flag saying that this interface is allowed to change an object.
|
bool | anonymous () const |
| Return true if this interface is anonyous, ie.
|
double | rank () const |
| Get the rank for this interface.
|
void | rank (double r) |
| Set the rank for this interface.
|
void | setHasDefault (bool b) |
| Indicate that this interface has a default value.
|
| Named (const string &newName=string()) |
| Constructor with name.
|
const string & | name () const |
| Return name.
|
bool | operator== (const Named &other) const |
| Test for equality.
|
bool | operator< (const Named &other) const |
| Lexicographical comparison.
|
The Switch class and its base class SwitchBase defines an interface to a class derived from the InterfacedBase, through which simple integer member variables can be manuipulated and set to a pre-defined set of values (options).
Switch is templated on the type of the integer member variable and the type of the class, and is derived from the InterfaceBase class via SwitchBase
.
The Switch class has a set of Named SwitchOptions, which limits the values possible to set.
For each InterfacedBase class exactly one static Switch object should created for each member variable which should be interfaced. This object will automatically register itself with the BaseRepository class. Also for each Switch object exactly one static SwitchOption object should be created for each valid integer option.
- See also:
- InterfacedBase
-
InterfacedBase
-
Named
Definition at line 117 of file Switch.h.