ThePEG 2.3.0
|
The Parameter and its base classes ParameterTBase and ParameterBase defines an interface to a class derived from the InterfacedBase, through which simple member variables can be manuipulated. More...
#include <Parameter.h>
Public Member Functions | |
ParameterTBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, Type newUnit, bool depSafe, bool readonly, int limits) | |
Standard constructor. | |
virtual | ~ParameterTBase () |
Destructor. | |
virtual string | type () const |
Return a code for the type of this parameter. | |
virtual void | set (InterfacedBase &ib, string newValue) const |
Set the member variables of ib to val. | |
virtual void | tset (InterfacedBase &ib, Type) const =0 |
Set the member variables of ib to val. | |
virtual string | get (const InterfacedBase &ib) const |
Return the value of the member variable of ib. | |
virtual Type | tget (const InterfacedBase &ib) const =0 |
Return the value of the member variable of ib. | |
virtual string | minimum (const InterfacedBase &ib) const |
Return the minimum value allowed for the member variable of ib. | |
virtual Type | tminimum (const InterfacedBase &ib) const =0 |
Return the minimum value allowed for the member variable of ib. | |
virtual string | maximum (const InterfacedBase &ib) const |
Return the maximum value allowed for the member variable of ib. | |
virtual Type | tmaximum (const InterfacedBase &ib) const =0 |
Return the maximum value allowed for the member variable of ib. | |
virtual string | def (const InterfacedBase &ib) const |
Return the default value for the member variables of ib. | |
virtual Type | tdef (const InterfacedBase &ib) const =0 |
Return the default value for the member variables of ib. | |
virtual void | setDef (InterfacedBase &ib) const |
set the member variable of ib to its default value. | |
Type | unit () const |
Get the unit which an Type object is divided (multiplied) by when written to (read from) a stream via a double. | |
void | unit (Type u) |
Set the unit which an Type object is divided (multiplied) by when written to (read from) a stream via a double. | |
virtual string | doxygenType () const |
Return a string describing the type of interface to be included in the Doxygen documentation. | |
Public Member Functions inherited from ThePEG::ParameterBase | |
ParameterBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe, bool readonly, int limits) | |
Standard constructor. | |
virtual | ~ParameterBase () |
The destructor. | |
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 parameter. | |
virtual void | set (InterfacedBase &ib, string) const =0 |
Set the member variable of ib to val. | |
virtual string | minimum (const InterfacedBase &ib) const =0 |
Return the minimum value allowed for the member variable of ib. | |
virtual string | maximum (const InterfacedBase &ib) const =0 |
Return the maximum value allowed for the member variable of ib. | |
virtual string | get (const InterfacedBase &ib) const =0 |
Return the value of the member variable of ib. | |
virtual string | def (const InterfacedBase &ib) const =0 |
Return the default value for the member variable of ib. | |
virtual void | setDef (InterfacedBase &ib) const =0 |
Set the member variable of ib to its default value. | |
bool | limited () const |
True if there the variable is limited from above and below. | |
bool | upperLimit () const |
True if there the variable is limited from abovew. | |
bool | lowerLimit () const |
True if there the variable is limited from below. | |
void | setLimited () |
Set flag indicating that there are limits associated with the variable. | |
void | setUnlimited () |
Set flag indicating that there are no limits associated with the variable. | |
Public Member Functions inherited from ThePEG::InterfaceBase | |
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 string | exec (InterfacedBase &ib, string action, string arguments) const =0 |
Manipulate an object of the corresponding class. | |
virtual string | type () const =0 |
Return a code for the type of this interface. | |
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 string | fullDescription (const InterfacedBase &ib) const |
Return a complete description of this interface. | |
virtual void | doxygenDescription (ostream &stream) const |
Print a description to be included in the Doxygen documentation to the given stream. | |
virtual string | doxygenType () const =0 |
Return a string describing the type of interface to be included in the Doxygen documentation. | |
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. | |
Public Member Functions inherited from ThePEG::Named | |
Named (const string &newName=string()) | |
Constructor with name. | |
Named (const Named &)=default | |
Explicit default copy-constructor (too avoid compiler warnings) | |
const string & | name () const |
Return name. | |
bool | operator== (const Named &other) const |
Test for equality. | |
bool | operator< (const Named &other) const |
Lexicographical comparison. | |
Protected Member Functions | |
void | putUnit (ostream &os, Type val) const |
Write a number to a stream with the unit specified with unit(). | |
Protected Member Functions inherited from ThePEG::Named | |
const Named & | operator= (const Named &other) |
Assignment. | |
const string & | name (const string &newName) |
Set new name. | |
Private Member Functions | |
void | setImpl (InterfacedBase &i, string newValue, StandardT) const |
Implementation of set() for standard types. | |
void | setImpl (InterfacedBase &i, string newValue, DimensionT) const |
Implementation of set() for dimensioned types. | |
void | setImpl (InterfacedBase &i, string newValue, EnumT) const |
Implementation of set() for dimensioned types. | |
void | checkUnitConsistency (string suffix) const |
Helper to check the unit consistency in set() operations. | |
Private Attributes | |
Type | theUnit |
The unit which an Type object is divided (multiplied) by when written to (read from) a stream via a double. | |
Additional Inherited Members | |
Static Public Attributes inherited from ThePEG::InterfaceBase | |
static bool | NoReadOnly |
If set to true, all read-only interfaces can be changed. | |
Protected Attributes inherited from ThePEG::InterfaceBase | |
bool | hasDefault |
A flag indicating whether this interface has a default setting. | |
bool | isDependencySafe |
The flag saying whether changing an object with this interface may change the state of a dependent object . | |
bool | isReadOnly |
The flag saying whether this interface is allowed to change an object. | |
The Parameter and its base classes ParameterTBase and ParameterBase defines an interface to a class derived from the InterfacedBase, through which simple member variables can be manuipulated.
Parameter is templated on the type of the member variable and the type of the InterfacedBase class, and is derived from the InterfaceBase class via ParameterTBase (which is templated only on the type of the member variable) and ParameterBase.
For each InterfacedBase class exactly one static Parameter object should created for each member variable which should be interfaced. This object will automatically register itself with the BaseRepository class.
Definition at line 241 of file Parameter.h.
|
inline |
Standard constructor.
newName | the name of the interface, may only contain letters [a-zA-z0-9_]. |
newDescription | a brief description of the interface. |
newClassName | the name of the corresponding class. |
newTypeInfo | the type_info object of the corresponding class. |
newUnit | the unit assumed when a number is read or written to a stream. |
depSafe | set to true if calls to this interface for one object does not influence other objects. |
readonly | if this is set true the interface will not be able to manipulate objects of the corresponding class, but will still be able to access information. |
limits | determines if the values of the parameters are limited from above and/or below. The possible values are given by Interface::Limits. |
Definition at line 272 of file Parameter.h.
|
inlinevirtual |
Destructor.
Definition at line 283 of file Parameter.h.
|
virtual |
Return the default value for the member variables of ib.
Calls tdef(const InterfacedBase &) and converts the returned value with an ostringstream.
Implements ThePEG::ParameterBase.
|
virtual |
Return a string describing the type of interface to be included in the Doxygen documentation.
Implements ThePEG::InterfaceBase.
|
virtual |
Return the value of the member variable of ib.
Calls tget(const InterfacedBase &) and converts the returned value with an ostringstream.
Implements ThePEG::ParameterBase.
|
virtual |
Return the maximum value allowed for the member variable of ib.
Calls tmaximum(const InterfacedBase &) and converts the returned value with an ostringstream.
Implements ThePEG::ParameterBase.
|
virtual |
Return the minimum value allowed for the member variable of ib.
Calls tmimimum(const InterfacedBase &) and converts the returned value with an ostringstream.
Implements ThePEG::ParameterBase.
|
inlineprotected |
Write a number to a stream with the unit specified with unit().
Definition at line 413 of file Parameter.h.
References ThePEG::ParameterTBase< Type >::unit().
|
virtual |
Set the member variables of ib to val.
Uses a stringstream to read the val into a Type object and then calls tset(InterfacedBase &, Type).
Implements ThePEG::ParameterBase.
|
inlinevirtual |
set the member variable of ib to its default value.
Implements ThePEG::ParameterBase.
Definition at line 384 of file Parameter.h.
References ThePEG::ParameterTBase< Type >::tdef(), and ThePEG::ParameterTBase< Type >::tset().
|
pure virtual |
Return the default value for the member variables of ib.
Implemented in ThePEG::Parameter< T, Type >.
Referenced by ThePEG::ParameterTBase< string >::def(), ThePEG::ParameterTBase< string >::setDef(), and ThePEG::ParameterTBase< Type >::setDef().
|
pure virtual |
Return the value of the member variable of ib.
Implemented in ThePEG::Parameter< T, Type >.
Referenced by ThePEG::ParameterTBase< string >::get().
|
pure virtual |
Return the maximum value allowed for the member variable of ib.
Implemented in ThePEG::Parameter< T, Type >.
|
pure virtual |
Return the minimum value allowed for the member variable of ib.
Implemented in ThePEG::Parameter< T, Type >.
|
pure virtual |
Set the member variables of ib to val.
Implemented in ThePEG::Parameter< T, Type >.
Referenced by ThePEG::ParameterTBase< string >::set(), ThePEG::ParameterTBase< string >::setDef(), and ThePEG::ParameterTBase< Type >::setDef().
|
virtual |
Return a code for the type of this parameter.
Implements ThePEG::InterfaceBase.
|
inline |
Get the unit which an Type object is divided (multiplied) by when written to (read from) a stream via a double.
If unit() is zero, the Type object is written/read directly.
Definition at line 393 of file Parameter.h.
References ThePEG::ParameterTBase< Type >::theUnit.
Referenced by ThePEG::ParameterTBase< Type >::putUnit().
|
inline |
Set the unit which an Type object is divided (multiplied) by when written to (read from) a stream via a double.
If unit() is zero, the Type object is written/read directly.
Definition at line 400 of file Parameter.h.
References ThePEG::ParameterTBase< Type >::theUnit.
|
private |
The unit which an Type object is divided (multiplied) by when written to (read from) a stream via a double.
If unit() is zero, the Type object is written/read directly.
Definition at line 424 of file Parameter.h.
Referenced by ThePEG::ParameterTBase< Type >::unit().