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;
482 Type
unit()
const {
return theUnit; }
489 void unit(Type u) { theUnit = u; }
531 template <
typename T,
typename Type>
540 typedef void (T::*SetFn)(Type, int);
546 typedef void (T::*InsFn)(Type, int);
552 typedef void (T::*DelFn)(int);
563 typedef TypeVector (T::*GetFn)()
const;
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,
648 InsFn newInsFn = 0, DelFn newDelFn = 0, GetFn newGetFn = 0,
649 DefFn newDefFn = 0, DefFn newMinFn = 0, DefFn newMaxFn = 0,
650 StringGetFn newStringGetFn = 0)
652 typeid(T), Type(), newSize, depSafe, readonly,
654 theMember(newMember), theDef(newDef), theMin(newMin), theMax(newMax),
655 theSetFn(newSetFn), theInsFn(newInsFn), theDelFn(newDelFn),
656 theGetFn(newGetFn), theDefFn(newDefFn), theMinFn(newMinFn),
657 theMaxFn(newMaxFn), theStringGetFn(newStringGetFn) {}
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,
721 InsFn newInsFn = 0, DelFn newDelFn = 0, GetFn newGetFn = 0,
722 DefFn newDefFn = 0, DefFn newMinFn = 0, DefFn newMaxFn = 0,
723 StringGetFn newStringGetFn = 0)
725 typeid(T), newUnit, newSize, depSafe, readonly,
727 theMember(newMember), theDef(newDef), theMin(newMin), theMax(newMax),
728 theSetFn(newSetFn), theInsFn(newInsFn), theDelFn(newDelFn),
729 theGetFn(newGetFn), theDefFn(newDefFn), theMinFn(newMinFn),
730 theMaxFn(newMaxFn), theStringGetFn(newStringGetFn) {}
788 Member newMember,
int newSize, Type newDef, Type newMin,
789 Type newMax,
bool depSafe =
false,
bool readonly =
false,
791 InsFn newInsFn = 0, DelFn newDelFn = 0, GetFn newGetFn = 0,
792 DefFn newDefFn = 0, DefFn newMinFn = 0, DefFn newMaxFn = 0,
793 StringGetFn newStringGetFn = 0)
795 typeid(T), Type(), newSize, depSafe, readonly,
797 theMember(newMember), theDef(newDef), theMin(newMin), theMax(newMax),
798 theSetFn(newSetFn), theInsFn(newInsFn), theDelFn(newDelFn),
799 theGetFn(newGetFn), theDefFn(newDefFn), theMinFn(newMinFn),
800 theMaxFn(newMaxFn), theStringGetFn(newStringGetFn) {}
861 Type newUnit,
int newSize, Type newDef, Type newMin,
862 Type newMax,
bool depSafe =
false,
bool readonly =
false,
864 InsFn newInsFn = 0, DelFn newDelFn = 0, GetFn newGetFn = 0,
865 DefFn newDefFn = 0, DefFn newMinFn = 0, DefFn newMaxFn = 0,
866 StringGetFn newStringGetFn = 0)
868 typeid(T), newUnit, newSize, depSafe, readonly,
870 theMember(newMember), theDef(newDef), theMin(newMin), theMax(newMax),
871 theSetFn(newSetFn), theInsFn(newInsFn), theDelFn(newDelFn),
872 theGetFn(newGetFn), theDefFn(newDefFn), theMinFn(newMinFn),
873 theMaxFn(newMaxFn), theStringGetFn(newStringGetFn) {}
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().
vector< string > StringVector
A vector of strings.
Type theUnit
The unit which an Type object is divided (multiplied) by when written to (read from) a stream via a d...
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...
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...
StringGetFn theStringGetFn
A pointer to a member function to be used by set().
virtual string doxygenType() const =0
Return a string describing the type of interface to be included in the Doxygen documentation.
virtual ~ParVectorBase()
Destructor.
The ParVector and its base classes ParVectorTBase and ParVectorBase defines an interface to a class d...
Type unit() const
Get the unit which an Type object is divided (multiplied) by when written to (read from) a stream via...
Type theMax
Maximum value to be used if no corresponding member function pointer is given.
virtual string type() const =0
Return a code for the type of this interface.
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.
virtual string fullDescription(const InterfacedBase &ib) const
Return a complete description of this parameter vector.
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...
Conversion between integers and types.
void setMaxFunction(GetFn mf)
Give a pointer to a member function to be used by tmaximum().
void setLimited()
Set a flag indicating that there are limits associated with the variables.
int size() const
Get the size of the container being interfaced.
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.
bool lowerLimit() const
True if there the variable is limited from below.
Type theMin
Minimum value to be used if no corresponding member function pointer is given.
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().
virtual void doxygenDescription(ostream &stream) const
Print a description to be included in the Doxygen documentation to the given stream.
int theSize
The size of the container being interfaced.
Int2Type< Dimensioned > DimensionT
Typedef for dimensioned types.
void setMinFunction(GetFn mf)
Give a pointer to a member function to be used by tminimum().
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 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.
bool limited() const
True if there the variable is limited from above and below.
void putUnit(ostream &os, Type val) const
Write a numer to a stream with the unit specified with unit().
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.
virtual string exec(InterfacedBase &, string action, string arguments) const
The general interface method overriding the one in InterfaceBase.
InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class...
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.
vector< Type > TypeVector
A vector of objects of the template argument type.
void setEraseFunction(DelFn df)
Give a pointer to a member function to be used by terase().
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.
string className() const
Return the class name for the class this interface is defined for.
The parameter has only an upper limit.
The parameter has only an lower limit.
GetFn theGetFn
A pointer to a member function to be used by tget().
The default concrete implementation of ClassTraitsBase.
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.
Int2Type< Standard > StandardT
Typedef for non-dimensioned types.
SetFn theSetFn
A pointer to a member function to be used by tset().
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.
void setSize(int sz)
Set the size of the container being interfaced.
void setGetFunction(GetFn gf)
Give a pointer to a member function to be used by tget().
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...
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.
bool upperLimit() const
True if there the variable is limited from abovew.