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

The Parameter and its base classes ParameterTBase and ParameterBase defines an interface to a class derived from the InterfacedBase, through which simple member variables can be manuipulated. More...

#include <Parameter.h>

Inheritance diagram for ThePEG::Parameter< T, Type >:

ThePEG::ParameterTBase< Type > ThePEG::ParameterBase ThePEG::InterfaceBase ThePEG::Named

List of all members.

Public Types

typedef void(T::* SetFn )(Type)
 The declaration of member functions which can be used by this Switch interface for the 'set' action.
typedef Type(T::* GetFn )() const
 The declaration of member functions which can be used by this Switch interface for the 'get', 'def', 'min' and 'max' actions.
typedef Type T::* Member
 Declaration of a direct pointer to the member variable.

Public Member Functions

 Parameter (string newName, string newDescription, Member newMember, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, bool limits=true, SetFn newSetFn=0, GetFn newGetFn=0, GetFn newMinFn=0, GetFn newMaxFn=0, GetFn newDefFn=0)
 Standard constructor.
 Parameter (string newName, string newDescription, Member newMember, Type newUnit, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, bool limits=true, SetFn newSetFn=0, GetFn newGetFn=0, GetFn newMinFn=0, GetFn newMaxFn=0, GetFn newDefFn=0)
 Standard constructor.
 Parameter (string newName, string newDescription, Member newMember, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, int limits=Interface::limited, SetFn newSetFn=0, GetFn newGetFn=0, GetFn newMinFn=0, GetFn newMaxFn=0, GetFn newDefFn=0)
 Standard constructor.
 Parameter (string newName, string newDescription, Member newMember, Type newUnit, Type newDef, Type newMin, Type newMax, bool depSafe=false, bool readonly=false, int limits=Interface::limited, SetFn newSetFn=0, GetFn newGetFn=0, GetFn newMinFn=0, GetFn newMaxFn=0, GetFn newDefFn=0)
 Standard constructor.
virtual ~Parameter ()
 Default dtor.
virtual void tset (InterfacedBase &ib, Type val) const
 Set the member variable of ib to val.
virtual Type tget (const InterfacedBase &ib) const
 Return the value of the member variable of ib.
virtual Type tminimum (const InterfacedBase &ib) const
 Return the minimum value allowed for the member variable of ib.
virtual Type tmaximum (const InterfacedBase &ib) const
 Return the miaximum value allowed for the member variable of ib.
virtual Type tdef (const InterfacedBase &ib) const
 Return the default value for the member variable of ib.
void setSetFunction (SetFn sf)
 Give a pointer to a member function to be used by tset().
void setGetFunction (GetFn gf)
 Give a pointer to a member function to be used by tget().
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().
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().
GetFn theGetFn
 Pointer to member function to be used by tget().
GetFn theDefFn
 Pointer to member function to be used by tdef().
GetFn theMinFn
 Pointer to member function to be used by tminimum().
GetFn theMaxFn
 Pointer to member function to be used by tmaximum().


Detailed Description

template<typename T, typename Type>
class ThePEG::Parameter< T, Type >

The Parameter and its base classes ParameterTBase and ParameterBase defines an interface to a class derived from the InterfacedBase, through which simple member variables can be manuipulated.

Parameter is templated on the type of the member variable and the type of the InterfacedBase class, and is derived from the InterfaceBase class via ParameterTBase (which is templated only on the type of the member variable) and ParameterBase.

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

See also:
InterfacedBase

InterfaceBase

Definition at line 418 of file Parameter.h.


Constructor & Destructor Documentation

template<typename T, typename Type>
ThePEG::Parameter< T, Type >::Parameter ( string  newName,
string  newDescription,
Member  newMember,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
bool  limits = true,
SetFn  newSetFn = 0,
GetFn  newGetFn = 0,
GetFn  newMinFn = 0,
GetFn  newMaxFn = 0,
GetFn  newDefFn = 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 the member variable. May be null if corresponding set/get functions are provided.
newDef the default value for the member variable.
newMin the minimum value for the member variable.
newMax the maximum value for the member variable.
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 the member function for the 'set' action.
newGetFn optional pointer to the member function for the 'get' action.
newMinFn optional pointer to the member function for the 'min' action.
newMaxFn optional pointer to the member function for the 'max' action.
newDefFn optional pointer to the member function for the 'def' action.

Definition at line 482 of file Parameter.h.

template<typename T, typename Type>
ThePEG::Parameter< T, Type >::Parameter ( string  newName,
string  newDescription,
Member  newMember,
Type  newUnit,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
bool  limits = true,
SetFn  newSetFn = 0,
GetFn  newGetFn = 0,
GetFn  newMinFn = 0,
GetFn  newMaxFn = 0,
GetFn  newDefFn = 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 the member variable. May be null if corresponding set/get functions are provided.
newUnit the unit assumed when a number is read or written to a stream.
newDef the default value for the member variable.
newMin the minimum value for the member variable.
newMax the maximum value for the member variable.
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 the member function for the 'set' action.
newGetFn optional pointer to the member function for the 'get' action.
newMinFn optional pointer to the member function for the 'min' action.
newMaxFn optional pointer to the member function for the 'max' action.
newDefFn optional pointer to the member function for the 'def' action.

Definition at line 539 of file Parameter.h.

template<typename T, typename Type>
ThePEG::Parameter< T, Type >::Parameter ( string  newName,
string  newDescription,
Member  newMember,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
int  limits = Interface::limited,
SetFn  newSetFn = 0,
GetFn  newGetFn = 0,
GetFn  newMinFn = 0,
GetFn  newMaxFn = 0,
GetFn  newDefFn = 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 the member variable. May be null if corresponding set/get functions are provided.
newDef the default value for the member variable.
newMin the minimum value for the member variable.
newMax the maximum value for the member variable.
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 the member function for the 'set' action.
newGetFn optional pointer to the member function for the 'get' action.
newMinFn optional pointer to the member function for the 'min' action.
newMaxFn optional pointer to the member function for the 'max' action.
newDefFn optional pointer to the member function for the 'def' action.

Definition at line 594 of file Parameter.h.

template<typename T, typename Type>
ThePEG::Parameter< T, Type >::Parameter ( string  newName,
string  newDescription,
Member  newMember,
Type  newUnit,
Type  newDef,
Type  newMin,
Type  newMax,
bool  depSafe = false,
bool  readonly = false,
int  limits = Interface::limited,
SetFn  newSetFn = 0,
GetFn  newGetFn = 0,
GetFn  newMinFn = 0,
GetFn  newMaxFn = 0,
GetFn  newDefFn = 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 the member variable. May be null if corresponding set/get functions are provided.
newUnit the unit assumed when a number is read or written to a stream.
newDef the default value for the member variable.
newMin the minimum value for the member variable.
newMax the maximum value for the member variable.
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 the member function for the 'set' action.
newGetFn optional pointer to the member function for the 'get' action.
newMinFn optional pointer to the member function for the 'min' action.
newMaxFn optional pointer to the member function for the 'max' action.
newDefFn optional pointer to the member function for the 'def' action.

Definition at line 652 of file Parameter.h.


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

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