thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::ParMapBase Class Referenceabstract

The ParMap and its base classes ParMapTBase and ParMapBase defines an interface to a class derived from the InterfacedBase, through which maps (or any other container) of simple member variables can be manuipulated. More...

#include <ParMap.h>

Inheritance diagram for ThePEG::ParMapBase:

Public Types

typedef map< long, string > StringMap
 A map of strings.
 

Public Member Functions

 ParMapBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, int newSize, bool depSafe, bool readonly, int limits)
 Standard constructor.
 
virtual ~ParMapBase ()
 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 map.
 
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 void clear (InterfacedBase &ib) const =0
 Clear the container of pointers of ib.
 
virtual StringMap 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 map.
 
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.
 
- 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.
 

Private Attributes

int limit
 True if there are limits associated with the variables.
 
int theSize
 The size of the container being interfaced.
 

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 Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 
- 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.
 

Detailed Description

The ParMap and its base classes ParMapTBase and ParMapBase defines an interface to a class derived from the InterfacedBase, through which maps (or any other container) of simple member variables can be manuipulated.

ParMap is templated on the type of the member variable and the type of the InterfacedBase class, and is derived from the InterfaceBase class via ParMapTBase (which is templated only on the class of the member variable) and ParMapBase.

For each InterfacedBase class exactly one static ParMap object should created for each member variable of container type which should be interfaced. This object will automatically register itself with the BaseRepository class.

See also
Parameter
InterfacedBase
InterfaceBase

Definition at line 63 of file ParMap.h.

Member Typedef Documentation

◆ StringMap

typedef map<long,string> ThePEG::ParMapBase::StringMap

A map of strings.

Definition at line 68 of file ParMap.h.

Constructor & Destructor Documentation

◆ ParMapBase()

ThePEG::ParMapBase::ParMapBase ( string  newName,
string  newDescription,
string  newClassName,
const type_info &  newTypeInfo,
int  newSize,
bool  depSafe,
bool  readonly,
int  limits 
)
inline

Standard constructor.

Parameters
newNamethe name of the interface, may only contain letters [a-zA-z0-9_].
newDescriptiona brief description of the interface.
newClassNamethe name of the corresponding class.
newTypeInfothe type_info object of the corresponding class.
newSizethe size of the container or -1 if varying.
depSafeset to true if calls to this interface for one object does not influence other objects.
readonlyif 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.
limitsdetermines 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 ParMap.h.

References ThePEG::InterfaceBase::hasDefault.

◆ ~ParMapBase()

virtual ThePEG::ParMapBase::~ParMapBase ( )
inlinevirtual

Destructor.

Definition at line 111 of file ParMap.h.

Member Function Documentation

◆ clear()

virtual void ThePEG::ParMapBase::clear ( InterfacedBase ib) const
pure virtual

Clear the container of pointers of ib.

Implemented in ThePEG::ParMap< T, Type >.

◆ def() [1/2]

virtual string ThePEG::ParMapBase::def ( ) const
pure virtual

Return the general default value for this parameter map.

Implemented in ThePEG::ParMapTBase< Type >.

◆ def() [2/2]

virtual string ThePEG::ParMapBase::def ( const InterfacedBase ib,
int  i 
) const
pure virtual

Return the default value for the i'th element of a container of member variables of ib.

Implemented in ThePEG::ParMapTBase< Type >.

◆ erase()

virtual void ThePEG::ParMapBase::erase ( InterfacedBase ib,
int  i 
) const
pure virtual

Remove the i'th element of a container of member variables of ib.

Implemented in ThePEG::ParMap< T, Type >.

◆ exec()

virtual string ThePEG::ParMapBase::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.

◆ fullDescription()

virtual string ThePEG::ParMapBase::fullDescription ( const InterfacedBase ib) const
virtual

Return a complete description of this parameter map.

Reimplemented from ThePEG::InterfaceBase.

Reimplemented in ThePEG::ParMapTBase< Type >.

◆ get()

virtual StringMap ThePEG::ParMapBase::get ( const InterfacedBase ib) const
pure virtual

Return the values of a container of member variables of ib.

Implemented in ThePEG::ParMapTBase< Type >, and ThePEG::ParMap< T, Type >.

◆ insert()

virtual void ThePEG::ParMapBase::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::ParMapTBase< Type >.

◆ limited()

bool ThePEG::ParMapBase::limited ( ) const
inline

True if there the variable is limited from above and below.

Definition at line 202 of file ParMap.h.

References limit, and ThePEG::Interface::nolimits.

◆ lowerLimit()

bool ThePEG::ParMapBase::lowerLimit ( ) const
inline

True if there the variable is limited from below.

Definition at line 214 of file ParMap.h.

References limit, ThePEG::Interface::limited, and ThePEG::Interface::lowerlim.

◆ maximum()

virtual string ThePEG::ParMapBase::maximum ( const InterfacedBase ib,
int  i 
) const
pure virtual

Return the maximum value allowed for the i'th element of a container of member variables of ib.

Implemented in ThePEG::ParMapTBase< Type >.

◆ minimum()

virtual string ThePEG::ParMapBase::minimum ( const InterfacedBase ib,
int  i 
) const
pure virtual

Return the minimum value allowed for the i'th element of a container of member variables of ib.

Implemented in ThePEG::ParMapTBase< Type >.

◆ set()

virtual void ThePEG::ParMapBase::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::ParMapTBase< Type >.

◆ setDef()

virtual void ThePEG::ParMapBase::setDef ( InterfacedBase ib,
int  i 
) const
pure virtual

Set the i'th element of a container of member variables of ib to its default value.

Implemented in ThePEG::ParMapTBase< Type >.

◆ setLimited()

void ThePEG::ParMapBase::setLimited ( )
inline

Set a flag indicating that there are limits associated with the variables.

Definition at line 222 of file ParMap.h.

References limit, and ThePEG::Interface::limited.

◆ setSize()

void ThePEG::ParMapBase::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 240 of file ParMap.h.

References theSize.

◆ setUnlimited()

void ThePEG::ParMapBase::setUnlimited ( )
inline

Set a flag indicating if there are no limits associated with the variables.

Definition at line 228 of file ParMap.h.

References limit, and ThePEG::Interface::nolimits.

◆ setVariableSize()

void ThePEG::ParMapBase::setVariableSize ( )
inline

Set the size of the container being interfaced to -1, i.e.

the size is allowed to vary.

Definition at line 246 of file ParMap.h.

References theSize.

◆ size()

int ThePEG::ParMapBase::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 234 of file ParMap.h.

References theSize.

◆ upperLimit()

bool ThePEG::ParMapBase::upperLimit ( ) const
inline

True if there the variable is limited from abovew.

Definition at line 207 of file ParMap.h.

References limit, ThePEG::Interface::limited, and ThePEG::Interface::upperlim.

Member Data Documentation

◆ limit

int ThePEG::ParMapBase::limit
private

True if there are limits associated with the variables.

Definition at line 254 of file ParMap.h.

Referenced by limited(), lowerLimit(), setLimited(), setUnlimited(), and upperLimit().

◆ theSize

int ThePEG::ParMapBase::theSize
private

The size of the container being interfaced.

Definition at line 259 of file ParMap.h.

Referenced by setSize(), setVariableSize(), and size().


The documentation for this class was generated from the following file: