#include <ParVector.h>
Public Types | |
typedef vector< string > | StringVector |
A vector of strings. | |
Public Member Functions | |
ParVectorBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, int newSize, bool depSafe, bool readonly, int limits) | |
Standard constructor. | |
virtual | ~ParVectorBase () |
Destructor. | |
virtual string | exec (InterfacedBase &, 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 vector. | |
virtual void | set (InterfacedBase &ib, string val, int i) const =0 |
Set the i'th element of a container of member variables of ib to val. | |
virtual void | insert (InterfacedBase &ib, string val, int i) const =0 |
Insert a new object before the i'th element of a container of member variables of ib and set it to val. | |
virtual void | erase (InterfacedBase &ib, int i) const =0 |
Remove the i'th element of a container of member variables of ib. | |
virtual StringVector | get (const InterfacedBase &ib) const =0 |
Return the values of a container of member variables of ib. | |
virtual string | minimum (const InterfacedBase &ib, int i) const =0 |
Return the minimum value allowed for the i'th element of a container of member variables of ib. | |
virtual string | maximum (const InterfacedBase &ib, int i) const =0 |
Return the maximum value allowed for the i'th element of a container of member variables of ib. | |
virtual string | def (const InterfacedBase &ib, int i) const =0 |
Return the default value for the i'th element of a container of member variables of ib. | |
virtual string | def () const =0 |
Return the general default value for this parameter vector. | |
virtual void | setDef (InterfacedBase &ib, int i) const =0 |
Set the i'th element of a container of member variables 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 a flag indicating that there are limits associated with the variables. | |
void | setUnlimited () |
Set a flag indicating if there are no limits associated with the variables. | |
int | size () const |
Get the size of the container being interfaced. | |
void | setSize (int sz) |
Set the size of the container being interfaced. | |
void | setVariableSize () |
Set the size of the container being interfaced to -1, i.e. | |
Private Attributes | |
int | limit |
True if there are limits associated with the variables. | |
int | theSize |
The size of the container being interfaced. |
ParVector is templated on the type of the member variable and the type of the InterfacedBase class, and is derived from the InterfaceBase class via ParVectorTBase (which is templated only on the class of the member variable) and ParVectorBase.
For each InterfacedBase class exactly one static ParVector object should created for each member variable of container type which should be interfaced. This object will automatically register itself with the BaseRepository class.
Definition at line 63 of file ParVector.h.
typedef vector<string> ThePEG::ParVectorBase::StringVector |
A vector of strings.
Reimplemented in ThePEG::ParVector< T, Type >.
Definition at line 68 of file ParVector.h.
ThePEG::ParVectorBase::ParVectorBase | ( | string | newName, | |
string | newDescription, | |||
string | newClassName, | |||
const type_info & | newTypeInfo, | |||
int | newSize, | |||
bool | depSafe, | |||
bool | readonly, | |||
int | limits | |||
) | [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. | |
newSize | the size of the container or -1 if varying. | |
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 98 of file ParVector.h.
virtual string ThePEG::ParVectorBase::exec | ( | InterfacedBase & | , | |
string | action, | |||
string | arguments | |||
) | const [virtual] |
The general interface method overriding the one in InterfaceBase.
For this class, action can be any of "set", "insert", "erase", "get", "min", "max", "def" and "setdef" and argument should be a something which can be read into an integer and into a variable through a stringstream with the standard '>>' operator.
Implements ThePEG::InterfaceBase.
virtual void ThePEG::ParVectorBase::set | ( | InterfacedBase & | ib, | |
string | val, | |||
int | i | |||
) | const [pure virtual] |
Set the i'th element of a container of member variables of ib to val.
val should be able to be read into the corresponding variable type through a stringstream with the standard '>>' operator.
Implemented in ThePEG::ParVectorTBase< Type >.
virtual void ThePEG::ParVectorBase::insert | ( | InterfacedBase & | ib, | |
string | val, | |||
int | i | |||
) | const [pure virtual] |
Insert a new object before the i'th element of a container of member variables of ib and set it to val.
val should be able to be read into the corresponding variable type through a stringstream with the standard '>>' operator.
Implemented in ThePEG::ParVectorTBase< Type >.
int ThePEG::ParVectorBase::size | ( | ) | const [inline] |
Get the size of the container being interfaced.
If the size() is less than 0, the size is allowed to vary.
Definition at line 226 of file ParVector.h.
References theSize.
void ThePEG::ParVectorBase::setSize | ( | int | sz | ) | [inline] |
Set the size of the container being interfaced.
If the size is less than 0, the size is allowed to vary.
Definition at line 232 of file ParVector.h.
References theSize.
void ThePEG::ParVectorBase::setVariableSize | ( | ) | [inline] |
Set the size of the container being interfaced to -1, i.e.
the size is allowed to vary.
Definition at line 238 of file ParVector.h.
References theSize.