ThePEG::ParameterTBase< 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::ParameterTBase< Type >:

ThePEG::ParameterBase ThePEG::InterfaceBase ThePEG::Named ThePEG::Parameter< T, Type >

List of all members.

Public Member Functions

 ParameterTBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, Type newUnit, bool depSafe, bool readonly, int limits)
 Standard constructor.
virtual ~ParameterTBase ()
 Destructor.
virtual string type () const
 Return a code for the type of this parameter.
virtual void set (InterfacedBase &ib, string newValue) const
 Set the member variables of ib to val.
virtual void tset (InterfacedBase &ib, Type) const =0
 Set the member variables of ib to val.
virtual string get (const InterfacedBase &ib) const
 Return the value of the member variable of ib.
virtual Type tget (const InterfacedBase &ib) const =0
 Return the value of the member variable of ib.
virtual string minimum (const InterfacedBase &ib) const
 Return the minimum value allowed for the member variable of ib.
virtual Type tminimum (const InterfacedBase &ib) const =0
 Return the minimum value allowed for the member variable of ib.
virtual string maximum (const InterfacedBase &ib) const
 Return the maximum value allowed for the member variable of ib.
virtual Type tmaximum (const InterfacedBase &ib) const =0
 Return the maximum value allowed for the member variable of ib.
virtual string def (const InterfacedBase &ib) const
 Return the default value for the member variables of ib.
virtual Type tdef (const InterfacedBase &ib) const =0
 Return the default value for the member variables of ib.
virtual void setDef (InterfacedBase &ib) const
 set the member variable 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.
virtual string doxygenType () const
 Return a string describing the type of interface to be included in the Doxygen documentation.

Protected Member Functions

void putUnit (ostream &os, Type val) const
 Write a number to a stream with the unit specified with unit().

Private Member Functions

void setImpl (InterfacedBase &i, string newValue, StandardT) const
 Implementation of set() for standard types.
void setImpl (InterfacedBase &i, string newValue, DimensionT) const
 Implementation of set() 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.


Detailed Description

template<typename Type>
class ThePEG::ParameterTBase< 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 217 of file Parameter.h.


Constructor & Destructor Documentation

template<typename Type>
ThePEG::ParameterTBase< Type >::ParameterTBase ( string  newName,
string  newDescription,
string  newClassName,
const type_info &  newTypeInfo,
Type  newUnit,
bool  depSafe,
bool  readonly,
int  limits 
) [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.
newClassName the name of the corresponding class.
newTypeInfo the type_info object of the corresponding class.
newUnit the unit assumed when a number is read or written to a stream.
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.

Definition at line 248 of file Parameter.h.


Member Function Documentation

template<typename Type>
virtual void ThePEG::ParameterTBase< Type >::set ( InterfacedBase ib,
string  newValue 
) const [virtual]

Set the member variables of ib to val.

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

Implements ThePEG::ParameterBase.

template<typename Type>
virtual string ThePEG::ParameterTBase< Type >::get ( const InterfacedBase ib  )  const [virtual]

Return the value of the member variable of ib.

Calls tget(const InterfacedBase &) and converts the returned value with an ostringstream.

Implements ThePEG::ParameterBase.

template<typename Type>
virtual string ThePEG::ParameterTBase< Type >::minimum ( const InterfacedBase ib  )  const [virtual]

Return the minimum value allowed for the member variable of ib.

Calls tmimimum(const InterfacedBase &) and converts the returned value with an ostringstream.

Implements ThePEG::ParameterBase.

template<typename Type>
virtual string ThePEG::ParameterTBase< Type >::maximum ( const InterfacedBase ib  )  const [virtual]

Return the maximum value allowed for the member variable of ib.

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

Implements ThePEG::ParameterBase.

template<typename Type>
virtual string ThePEG::ParameterTBase< Type >::def ( const InterfacedBase ib  )  const [virtual]

Return the default value for the member variables of ib.

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

Implements ThePEG::ParameterBase.

template<typename Type>
Type ThePEG::ParameterTBase< 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 364 of file Parameter.h.

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

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

template<typename Type>
void ThePEG::ParameterTBase< 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 371 of file Parameter.h.

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


Member Data Documentation

template<typename Type>
Type ThePEG::ParameterTBase< 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 395 of file Parameter.h.

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


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