thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::ParVectorTBase< Type > Class Template Referenceabstract

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

#include <ParVector.h>

Inheritance diagram for ThePEG::ParVectorTBase< Type >:

Public Types

typedef vector< Type > TypeVector
 A vector of objects of the template argument type.
 
- Public Types inherited from ThePEG::ParVectorBase
typedef vector< string > StringVector
 A vector of strings.
 

Public Member Functions

 ParVectorTBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, Type newUnit, int newSize, bool depSafe, bool readonly, int limits)
 Standard constructor.
 
virtual ~ParVectorTBase ()
 Destructor.
 
virtual string type () const
 Return a code for the type of this parameter.
 
virtual string doxygenType () const
 Return a string describing the type of interface to be included in the Doxygen documentation.
 
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
 Set the i'th element of a container of member variables of ib to val.
 
virtual void tset (InterfacedBase &ib, Type 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
 Insert a new object before the i'th element of a container of member variables of ib and set it to val.
 
virtual void tinsert (InterfacedBase &ib, Type 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 StringVector get (const InterfacedBase &ib) const
 Return the values of a container of member variables of ib in a vector of strings.
 
virtual TypeVector tget (const InterfacedBase &ib) const =0
 Return the values of a container of member variables of ib in a vector of Type.
 
virtual string minimum (const InterfacedBase &ib, int i) const
 Return the minimum value allowed for the i'th element of a container of member variables of ib.
 
virtual Type tminimum (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
 Return the maximum value allowed for the i'th element of a container of member variables of ib.
 
virtual Type tmaximum (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
 Return the default value for the i'th element of a container of member variables of ib.
 
virtual Type tdef (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
 Return the general default value for this parameter vector.
 
virtual Type tdef () const =0
 Return the general default value for this parameter vector.
 
virtual void setDef (InterfacedBase &ib, int i) const
 set the i'th element of a container of member variables 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.
 
- Public Member Functions inherited from ThePEG::ParVectorBase
 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 void clear (InterfacedBase &ib) const =0
 Clear the container of pointers 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.
 
- 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 numer to a stream with the unit specified with unit().
 
- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 

Private Member Functions

void setImpl (InterfacedBase &ib, string val, int i, StandardT) const
 Implementation of set() for standard types.
 
void setImpl (InterfacedBase &ib, string val, int i, DimensionT) const
 Implementation of set() for dimensioned types.
 
void insertImpl (InterfacedBase &ib, string val, int i, StandardT) const
 Implementation of insert() for standard types.
 
void insertImpl (InterfacedBase &ib, string val, int i, DimensionT) const
 Implementation of insert() for dimensioned types.
 

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.
 

Detailed Description

template<typename Type>
class ThePEG::ParVectorTBase< Type >

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

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.

See also
Parameter
InterfacedBase
InterfaceBase

Definition at line 284 of file ParVector.h.

Member Typedef Documentation

◆ TypeVector

template<typename Type >
typedef vector<Type> ThePEG::ParVectorTBase< Type >::TypeVector

A vector of objects of the template argument type.

Definition at line 289 of file ParVector.h.

Constructor & Destructor Documentation

◆ ParVectorTBase()

template<typename Type >
ThePEG::ParVectorTBase< Type >::ParVectorTBase ( string  newName,
string  newDescription,
string  newClassName,
const type_info &  newTypeInfo,
Type  newUnit,
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.
newUnitthe unit assumed when a number is read or written to a stream.
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 322 of file ParVector.h.

◆ ~ParVectorTBase()

template<typename Type >
virtual ThePEG::ParVectorTBase< Type >::~ParVectorTBase ( )
inlinevirtual

Destructor.

Definition at line 334 of file ParVector.h.

Member Function Documentation

◆ def() [1/2]

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::def ( ) const
virtual

Return the general default value for this parameter vector.

Calls tdef() and converts the returned value with an ostringstream.

Implements ThePEG::ParVectorBase.

◆ def() [2/2]

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::def ( const InterfacedBase ib,
int  i 
) const
virtual

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

Calls tdef(const InterfacedBase &, int) and converts the returned value with an ostringstream.

Implements ThePEG::ParVectorBase.

◆ doxygenType()

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::doxygenType ( ) const
virtual

Return a string describing the type of interface to be included in the Doxygen documentation.

Implements ThePEG::InterfaceBase.

◆ fullDescription()

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::fullDescription ( const InterfacedBase ib) const
virtual

Return a complete description of this parameter vector.

Reimplemented from ThePEG::ParVectorBase.

◆ get()

template<typename Type >
virtual StringVector ThePEG::ParVectorTBase< Type >::get ( const InterfacedBase ib) const
virtual

Return the values of a container of member variables of ib in a vector of strings.

Calls the The tget(const InterfacedBase &) and returns a vector of strings converted with ostringstreams.

Implements ThePEG::ParVectorBase.

Reimplemented in ThePEG::ParVector< T, Type >.

◆ insert()

template<typename Type >
virtual void ThePEG::ParVectorTBase< Type >::insert ( InterfacedBase ib,
string  val,
int  i 
) const
virtual

Insert a new object before the i'th element of a container of member variables of ib and set it to val.

Uses a stringstream to read the val into a Type object and then calls tinsert(InterfacedBase &, Type, int).

Implements ThePEG::ParVectorBase.

◆ maximum()

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::maximum ( const InterfacedBase ib,
int  i 
) const
virtual

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

Calls tmaximum(const InterfacedBase &, int) and converts the returned value with an ostringstream.

Implements ThePEG::ParVectorBase.

◆ minimum()

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::minimum ( const InterfacedBase ib,
int  i 
) const
virtual

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

Calls tminimum(const InterfacedBase &, int) and converts the returned value with an ostringstream.

Implements ThePEG::ParVectorBase.

◆ putUnit()

template<typename Type >
void ThePEG::ParVectorTBase< Type >::putUnit ( ostream &  os,
Type  val 
) const
inlineprotected

Write a numer to a stream with the unit specified with unit().

Definition at line 502 of file ParVector.h.

References ThePEG::ParVectorTBase< Type >::unit().

◆ set()

template<typename Type >
virtual void ThePEG::ParVectorTBase< Type >::set ( InterfacedBase ib,
string  val,
int  i 
) const
virtual

Set the i'th element of a container of member variables of ib to val.

Uses a stringstream to read the val into a Type object and then calls tset(InterfacedBase &, Type, int).

Implements ThePEG::ParVectorBase.

◆ setDef()

template<typename Type >
virtual void ThePEG::ParVectorTBase< Type >::setDef ( InterfacedBase ib,
int  i 
) const
virtual

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

Implements ThePEG::ParVectorBase.

◆ tdef() [1/2]

template<typename Type >
virtual Type ThePEG::ParVectorTBase< Type >::tdef ( ) const
pure virtual

Return the general default value for this parameter vector.

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

◆ tdef() [2/2]

template<typename Type >
virtual Type ThePEG::ParVectorTBase< Type >::tdef ( 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::ParVector< T, Type >.

◆ tget()

template<typename Type >
virtual TypeVector ThePEG::ParVectorTBase< Type >::tget ( const InterfacedBase ib) const
pure virtual

Return the values of a container of member variables of ib in a vector of Type.

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

◆ tinsert()

template<typename Type >
virtual void ThePEG::ParVectorTBase< Type >::tinsert ( InterfacedBase ib,
Type  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.

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

◆ tmaximum()

template<typename Type >
virtual Type ThePEG::ParVectorTBase< Type >::tmaximum ( 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::ParVector< T, Type >.

◆ tminimum()

template<typename Type >
virtual Type ThePEG::ParVectorTBase< Type >::tminimum ( 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::ParVector< T, Type >.

◆ tset()

template<typename Type >
virtual void ThePEG::ParVectorTBase< Type >::tset ( InterfacedBase ib,
Type  val,
int  i 
) const
pure virtual

Set the i'th element of a container of member variables of ib to val.

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

◆ type()

template<typename Type >
virtual string ThePEG::ParVectorTBase< Type >::type ( ) const
virtual

Return a code for the type of this parameter.

Implements ThePEG::InterfaceBase.

◆ unit() [1/2]

template<typename Type >
Type ThePEG::ParVectorTBase< Type >::unit ( ) const
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 488 of file ParVector.h.

References ThePEG::ParVectorTBase< Type >::theUnit.

Referenced by ThePEG::ParVectorTBase< Type >::putUnit().

◆ unit() [2/2]

template<typename Type >
void ThePEG::ParVectorTBase< Type >::unit ( Type  u)
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 495 of file ParVector.h.

References ThePEG::ParVectorTBase< Type >::theUnit.

Member Data Documentation

◆ theUnit

template<typename Type >
Type ThePEG::ParVectorTBase< 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 513 of file ParVector.h.

Referenced by ThePEG::ParVectorTBase< Type >::unit().


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