ThePEG::ParVector< T, Type > Class Template Reference

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::ParVector< T, Type >:

ThePEG::ParVectorTBase< Type > ThePEG::ParVectorBase ThePEG::InterfaceBase ThePEG::Named

List of all members.

Public Types

typedef void(T::* SetFn )(Type, int)
 The declaration of member functions which can be used by this ParVector interface for 'set' actions.
typedef void(T::* InsFn )(Type, int)
 The declaration of member functions which can be used by this ParVector interface for 'insert' actions.
typedef void(T::* DelFn )(int)
 The declaration of member functions which can be used by this ParVector interface for 'erase' actions.
typedef vector< Type > TypeVector
 A vector of objects of the template parameter Type.
typedef TypeVector(T::* GetFn )() const
 The declaration of member functions which can be used by this ParVector interface for 'get' actions.
typedef vector< string > StringVector
 A vector of strings.
typedef StringVector(T::* StringGetFn )() const
 The declaration of member functions which can be used by this ParVector interface for 'get' actions.
typedef Type(T::* DefFn )(int) const
 The declaration of member functions which can be used by this ParVector interface for 'erase' actions.
typedef TypeVector T::* Member
 Declaration of a direct pointer to the member variable in case it is a vector.

Public Member Functions

 ParVector (string newName, string newDescription, Member newMember, int newSize, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, bool limits=true, SetFn newSetFn=0, InsFn newInsFn=0, DelFn newDelFn=0, GetFn newGetFn=0, DefFn newDefFn=0, DefFn newMinFn=0, DefFn newMaxFn=0, StringGetFn newStringGetFn=0)
 Standard constructor.
 ParVector (string newName, string newDescription, Member newMember, Type newUnit, int newSize, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, bool limits=true, SetFn newSetFn=0, InsFn newInsFn=0, DelFn newDelFn=0, GetFn newGetFn=0, DefFn newDefFn=0, DefFn newMinFn=0, DefFn newMaxFn=0, StringGetFn newStringGetFn=0)
 Standard constructor.
 ParVector (string newName, string newDescription, Member newMember, int newSize, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, int limits=Interface::limited, SetFn newSetFn=0, InsFn newInsFn=0, DelFn newDelFn=0, GetFn newGetFn=0, DefFn newDefFn=0, DefFn newMinFn=0, DefFn newMaxFn=0, StringGetFn newStringGetFn=0)
 Standard constructor.
 ParVector (string newName, string newDescription, Member newMember, Type newUnit, int newSize, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, int limits=Interface::limited, SetFn newSetFn=0, InsFn newInsFn=0, DelFn newDelFn=0, GetFn newGetFn=0, DefFn newDefFn=0, DefFn newMinFn=0, DefFn newMaxFn=0, StringGetFn newStringGetFn=0)
 Standard constructor.
virtual void tset (InterfacedBase &ib, Type val, int i) const
 Set the i'th element of a container of member variables of ib to val.
virtual void tinsert (InterfacedBase &ib, Type 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 erase (InterfacedBase &ib, int i) const
 Remove the i'th element of a container of member variables of ib.
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
 Return the values of a container of member variables of ib in a vector of Type.
virtual Type tminimum (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 tmaximum (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 tdef (const InterfacedBase &, int) const
 Return the default value for the i'th element of a container of member variables of ib.
virtual Type tdef () const
 Return the general default value for this parameter vector.
void setSetFunction (SetFn sf)
 Give a pointer to a member function to be used by tset().
void setInsertFunction (InsFn ifn)
 Give a pointer to a member function to be used by tinsert().
void setGetFunction (GetFn gf)
 Give a pointer to a member function to be used by tget().
void setEraseFunction (DelFn df)
 Give a pointer to a member function to be used by terase().
void setDefaultFunction (GetFn df)
 Give a pointer to a member function to be used by tdef().
void setMinFunction (GetFn mf)
 Give a pointer to a member function to be used by tminimum().
void setMaxFunction (GetFn mf)
 Give a pointer to a member function to be used by tmaximum().
void setStringGetFunction (StringGetFn gf)
 Give a pointer to a member function to be used by get().
virtual void doxygenDescription (ostream &stream) const
 Print a description to be included in the Doxygen documentation to the given stream.

Private Attributes

Member theMember
 The pointer to the member variable.
Type theDef
 Default value to be used if no corresponding member function pointer is given.
Type theMin
 Minimum value to be used if no corresponding member function pointer is given.
Type theMax
 Maximum value to be used if no corresponding member function pointer is given.
SetFn theSetFn
 A pointer to a member function to be used by tset().
InsFn theInsFn
 A pointer to a member function to be used by tinsert().
DelFn theDelFn
 A pointer to a member function to be used by terase().
GetFn theGetFn
 A pointer to a member function to be used by tget().
DefFn theDefFn
 Pointer to member function to be used by tdef().
DefFn theMinFn
 Pointer to member function to be used by tminimum().
DefFn theMaxFn
 Pointer to member function to be used by tmaximum().
StringGetFn theStringGetFn
 A pointer to a member function to be used by set().


Detailed Description

template<typename T, typename Type>
class ThePEG::ParVector< T, 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 530 of file ParVector.h.


Constructor & Destructor Documentation

template<typename T, typename Type>
ThePEG::ParVector< T, Type >::ParVector ( string  newName,
string  newDescription,
Member  newMember,
int  newSize,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
bool  limits = true,
SetFn  newSetFn = 0,
InsFn  newInsFn = 0,
DelFn  newDelFn = 0,
GetFn  newGetFn = 0,
DefFn  newDefFn = 0,
DefFn  newMinFn = 0,
DefFn  newMaxFn = 0,
StringGetFn  newStringGetFn = 0 
) [inline]

Standard constructor.

Parameters:
newName the name of the interface, may only contain letters [a-zA-z0-9_].
newDescription a brief description of the interface.
newMember a pointer to a Member which is a TypeVector. May be null, in which case the pointers to member functions must be specified.
newSize the size of the container or -1 if varying.
newDef the default value of the corresponding parameters.
newMin the minimum value of the corresponding parameters.
newMax the maximum value of the corresponding parameters.
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 below.
newSetFn optional pointer to member function for the 'set' action.
newInsFn optional pointer to member function for the 'insert' action.
newDelFn optional pointer to member function for the 'erase' action.
newDefFn optional pointer to member function for the 'default' action.
newGetFn optional pointer to member function for the 'get' action.
newMinFn optional pointer to member function for the 'minimum' action.
newMaxFn optional pointer to member function for the 'maximum' action.
newStringGetFn optional pointer to member function for the 'get' action.

Definition at line 642 of file ParVector.h.

template<typename T, typename Type>
ThePEG::ParVector< T, Type >::ParVector ( string  newName,
string  newDescription,
Member  newMember,
Type  newUnit,
int  newSize,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
bool  limits = true,
SetFn  newSetFn = 0,
InsFn  newInsFn = 0,
DelFn  newDelFn = 0,
GetFn  newGetFn = 0,
DefFn  newDefFn = 0,
DefFn  newMinFn = 0,
DefFn  newMaxFn = 0,
StringGetFn  newStringGetFn = 0 
) [inline]

Standard constructor.

Parameters:
newName the name of the interface, may only contain letters [a-zA-z0-9_].
newDescription a brief description of the interface.
newMember a pointer to a Member which is a TypeVector. May be null, in which case the pointers to member functions must be specified.
newUnit the unit assumed when a number is read or written to a stream.
newSize the size of the container or -1 if varying.
newDef the default value of the corresponding parameters.
newGetFn optional pointer to member function for the 'get' action.
newMin the minimum value of the corresponding parameters.
newMax the maximum value of the corresponding parameters.
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 below.
newSetFn optional pointer to member function for the 'set' action.
newInsFn optional pointer to member function for the 'insert' action.
newDelFn optional pointer to member function for the 'erase' action.
newDefFn optional pointer to member function for the 'default' action.
newMinFn optional pointer to member function for the 'minimum' action.
newMaxFn optional pointer to member function for the 'maximum' action.
newStringGetFn optional pointer to member function for the 'get' action.

Definition at line 715 of file ParVector.h.

template<typename T, typename Type>
ThePEG::ParVector< T, Type >::ParVector ( string  newName,
string  newDescription,
Member  newMember,
int  newSize,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
int  limits = Interface::limited,
SetFn  newSetFn = 0,
InsFn  newInsFn = 0,
DelFn  newDelFn = 0,
GetFn  newGetFn = 0,
DefFn  newDefFn = 0,
DefFn  newMinFn = 0,
DefFn  newMaxFn = 0,
StringGetFn  newStringGetFn = 0 
) [inline]

Standard constructor.

Parameters:
newName the name of the interface, may only contain letters [a-zA-z0-9_].
newDescription a brief description of the interface.
newMember a pointer to a Member which is a TypeVector. May be null, in which case the pointers to member functions must be specified.
newSize the size of the container or -1 if varying.
newDef the default value of the corresponding parameters.
newMin the minimum value of the corresponding parameters.
newMax the maximum value of the corresponding parameters.
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.
newSetFn optional pointer to member function for the 'set' action.
newInsFn optional pointer to member function for the 'insert' action.
newDelFn optional pointer to member function for the 'erase' action.
newDefFn optional pointer to member function for the 'default' action.
newGetFn optional pointer to member function for the 'get' action.
newMinFn optional pointer to member function for the 'minimum' action.
newMaxFn optional pointer to member function for the 'maximum' action.
newStringGetFn optional pointer to member function for the 'get' action.

Definition at line 785 of file ParVector.h.

template<typename T, typename Type>
ThePEG::ParVector< T, Type >::ParVector ( string  newName,
string  newDescription,
Member  newMember,
Type  newUnit,
int  newSize,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
int  limits = Interface::limited,
SetFn  newSetFn = 0,
InsFn  newInsFn = 0,
DelFn  newDelFn = 0,
GetFn  newGetFn = 0,
DefFn  newDefFn = 0,
DefFn  newMinFn = 0,
DefFn  newMaxFn = 0,
StringGetFn  newStringGetFn = 0 
) [inline]

Standard constructor.

Parameters:
newName the name of the interface, may only contain letters [a-zA-z0-9_].
newDescription a brief description of the interface.
newMember a pointer to a Member which is a TypeVector. May be null, in which case the pointers to member functions must be specified.
newUnit the unit assumed when a number is read or written to a stream.
newSize the size of the container or -1 if varying.
newDef the default value of the corresponding parameters.
newGetFn optional pointer to member function for the 'get' action.
newMin the minimum value of the corresponding parameters.
newMax the maximum value of the corresponding parameters.
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.
newSetFn optional pointer to member function for the 'set' action.
newInsFn optional pointer to member function for the 'insert' action.
newDelFn optional pointer to member function for the 'erase' action.
newDefFn optional pointer to member function for the 'default' action.
newMinFn optional pointer to member function for the 'minimum' action.
newMaxFn optional pointer to member function for the 'maximum' action.
newStringGetFn optional pointer to member function for the 'get' action.

Definition at line 858 of file ParVector.h.


Member Function Documentation

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

Reimplemented from ThePEG::ParVectorTBase< Type >.


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

Generated on Thu Apr 29 12:43:08 2010 for ThePEG by  doxygen 1.5.5