9 #ifndef ThePEG_ParVector_H
10 #define ThePEG_ParVector_H
14 #include "ThePEG/Config/ThePEG.h"
15 #include "InterfaceBase.h"
16 #include "ParVector.fh"
27 inline void putUnitImpl2(ostream & os, T v, T u,
DimensionT) {
35 inline void putUnitImpl2(ostream & os, T v, T u,
StandardT) {
100 const type_info & newTypeInfo,
int newSize,
101 bool depSafe,
bool readonly,
int limits)
103 newTypeInfo, depSafe,
122 string arguments)
const;
184 virtual string def()
const = 0;
277 template <
typename Type>
317 string newClassName,
const type_info & newTypeInfo,
318 Type newUnit,
int newSize,
bool depSafe,
319 bool readonly,
int limits)
321 newTypeInfo, newSize,
322 depSafe, readonly, limits),
theUnit(newUnit) {}
333 virtual string type()
const;
463 virtual string def()
const;
468 virtual Type
tdef()
const = 0;
531 template <
typename T,
typename Type>
540 typedef void (T::*
SetFn)(Type, int);
546 typedef void (T::*
InsFn)(Type, int);
580 typedef Type (T::*
DefFn)(int)
const;
645 Member newMember,
int newSize, Type newDef, Type newMin,
646 Type newMax,
bool depSafe =
false,
bool readonly =
false,
647 bool limits =
true,
SetFn newSetFn = 0,
652 typeid(T), Type(), newSize, depSafe, readonly,
718 Type newUnit,
int newSize, Type newDef, Type newMin,
719 Type newMax,
bool depSafe =
false,
bool readonly =
false,
720 bool limits =
true,
SetFn newSetFn = 0,
725 typeid(T), newUnit, newSize, depSafe, readonly,
788 Member newMember,
int newSize, Type newDef, Type newMin,
789 Type newMax,
bool depSafe =
false,
bool readonly =
false,
795 typeid(T), Type(), newSize, depSafe, readonly,
861 Type newUnit,
int newSize, Type newDef, Type newMin,
862 Type newMax,
bool depSafe =
false,
bool readonly =
false,
868 typeid(T), newUnit, newSize, depSafe, readonly,
935 virtual Type
tdef()
const;
1052 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
1053 #include "ParVector.tcc"
DelFn theDelFn
A pointer to a member function to be used by terase().
virtual string fullDescription(const InterfacedBase &ib) const
Return a complete description of this parameter vector.
vector< string > StringVector
A vector of strings.
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.
Type theUnit
The unit which an Type object is divided (multiplied) by when written to (read from) a stream via a d...
void insertImpl(InterfacedBase &ib, string val, int i, StandardT) const
Implementation of insert() for standard types.
vector< string > StringVector
A vector of strings.
void unit(Type u)
Set the unit which an Type object is divided (multiplied) by when written to (read from) a stream via...
bool upperLimit() const
True if there the variable is limited from abovew.
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 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 va...
StringGetFn theStringGetFn
A pointer to a member function to be used by set().
virtual ~ParVectorBase()
Destructor.
The ParVector and its base classes ParVectorTBase and ParVectorBase defines an interface to a class d...
virtual string fullDescription(const InterfacedBase &ib) const
Return a complete description of this parameter vector.
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...
bool lowerLimit() const
True if there the variable is limited from below.
Type theMax
Maximum value to be used if no corresponding member function pointer is given.
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 set(InterfacedBase &ib, string val, int i) const
Set the i'th element of a container of member variables of ib to val.
The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase clas...
int limit
True if there are limits associated with the variables.
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 hasDefault
A flag indicating whether this interface has a default setting.
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 va...
TypeVector(T::* GetFn)() const
The declaration of member functions which can be used by this ParVector interface for 'get' actions...
Conversion between integers and types.
void setMaxFunction(GetFn mf)
Give a pointer to a member function to be used by tmaximum().
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...
void setLimited()
Set a flag indicating that there are limits associated with the variables.
DefFn theDefFn
Pointer to member function to be used by tdef().
void setInsertFunction(InsFn ifn)
Give a pointer to a member function to be used by tinsert().
This is the main namespace within which all identifiers in ThePEG are declared.
Type unit() const
Get the unit which an Type object is divided (multiplied) by when written to (read from) a stream via...
Type theMin
Minimum value to be used if no corresponding member function pointer is given.
virtual Type tdef() const =0
Return the general default value for this parameter vector.
The ParVector and its base classes ParVectorTBase and ParVectorBase defines an interface to a class d...
InsFn theInsFn
A pointer to a member function to be used by tinsert().
int theSize
The size of the container being interfaced.
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 va...
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 tdef() const
Return the general default value for this parameter vector.
Int2Type< Dimensioned > DimensionT
Typedef for dimensioned types.
void setMinFunction(GetFn mf)
Give a pointer to a member function to be used by tminimum().
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 va...
string className() const
Return the class name for the class this interface is defined for.
virtual ~ParVectorTBase()
Destructor.
ParVectorBase(string newName, string newDescription, string newClassName, const type_info &newTypeInfo, int newSize, bool depSafe, bool readonly, int limits)
Standard constructor.
void putUnit(ostream &os, Type val) const
Write a numer to a stream with the unit specified with unit().
void setSetFunction(SetFn sf)
Give a pointer to a member function to be used by tset().
Type theDef
Default value to be used if no corresponding member function pointer is given.
TypeVector T::* Member
Declaration of a direct pointer to the member variable in case it is a vector.
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 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...
vector< Type > TypeVector
A vector of objects of the template parameter Type.
The parameter is not limited.
void setStringGetFunction(StringGetFn gf)
Give a pointer to a member function to be used by get().
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...
Member theMember
The pointer to the member variable.
InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class...
StringVector(T::* StringGetFn)() const
The declaration of member functions which can be used by this ParVector interface for 'get' actions...
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.
void(T::* DelFn)(int)
The declaration of member functions which can be used by this ParVector interface for 'erase' actions...
virtual TypeVector tget(const InterfacedBase &ib) const
Return the values of a container of member variables of ib in a vector of Type.
vector< Type > TypeVector
A vector of objects of the template argument type.
void setImpl(InterfacedBase &ib, string val, int i, StandardT) const
Implementation of set() for standard types.
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.
void setEraseFunction(DelFn df)
Give a pointer to a member function to be used by terase().
virtual string exec(InterfacedBase &, string action, string arguments) const
The general interface method overriding the one in InterfaceBase.
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.
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.
virtual string type() const
Return a code for the type of this parameter.
The parameter has only an upper limit.
virtual void erase(InterfacedBase &ib, int i) const
Remove the i'th element of a container of member variables of ib.
The parameter has only an lower limit.
GetFn theGetFn
A pointer to a member function to be used by tget().
virtual TypeVector tget(const InterfacedBase &ib) const =0
Return the values of a container of member variables of ib in a vector of Type.
The default concrete implementation of ClassTraitsBase.
void(T::* SetFn)(Type, int)
The declaration of member functions which can be used by this ParVector interface for 'set' actions...
ParVectorTBase(string newName, string newDescription, string newClassName, const type_info &newTypeInfo, Type newUnit, int newSize, bool depSafe, bool readonly, int limits)
Standard constructor.
The parameter is limited (both up- and downwards.
void setDefaultFunction(GetFn df)
Give a pointer to a member function to be used by tdef().
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 string def() const
Return the general default value for this parameter vector.
Int2Type< Standard > StandardT
Typedef for non-dimensioned types.
SetFn theSetFn
A pointer to a member function to be used by tset().
bool limited() const
True if there the variable is limited from above and below.
DefFn theMinFn
Pointer to member function to be used by tminimum().
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.
virtual void doxygenDescription(ostream &stream) const
Print a description to be included in the Doxygen documentation to the given stream.
void setSize(int sz)
Set the size of the container being interfaced.
int size() const
Get the size of the container being interfaced.
void setGetFunction(GetFn gf)
Give a pointer to a member function to be used by tget().
Type(T::* DefFn)(int) const
The declaration of member functions which can be used by this ParVector interface for 'erase' actions...
DefFn theMaxFn
Pointer to member function to be used by tmaximum().
void setUnlimited()
Set a flag indicating if there are no limits associated with the variables.
The ParVector and its base classes ParVectorTBase and ParVectorBase defines an interface to a class d...
virtual string doxygenType() const
Return a string describing the type of interface to be included in the Doxygen documentation.
void setVariableSize()
Set the size of the container being interfaced to -1, i.e.
virtual void erase(InterfacedBase &ib, int i) const =0
Remove 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.
void(T::* InsFn)(Type, int)
The declaration of member functions which can be used by this ParVector interface for 'insert' action...