ThePEG::ReferenceBase Class Reference

The Reference class and its base class ReferenceBase defines an interface to a class derived from the InterfacedBase, through which pointers to other InterfacedBase objects may be manipulated. More...

#include <Reference.h>

Inheritance diagram for ThePEG::ReferenceBase:

ThePEG::RefInterfaceBase ThePEG::InterfaceBase ThePEG::Named ThePEG::Reference< T, R >

List of all members.

Public Member Functions

 ReferenceBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, string newRefClassName, const type_info &newRefTypeInfo, bool depSafe, bool readonly, bool norebind, bool nullable, bool defnull)
 Standard constructor.
virtual string exec (InterfacedBase &ib, string action, string arguments) const
 The general interface method overriding the one in InterfaceBase.
virtual string fullDescription (const InterfacedBase &ib) const
 Return a complete description of this reference.
virtual string type () const
 Return a code for the type of this reference.
virtual string doxygenType () const
 Return a string describing the type of interface to be included in the Doxygen documentation.
virtual void set (InterfacedBase &ib, IBPtr ip, bool chk=true) const =0
 Set the pointer of ib to ip.
virtual IBPtr get (const InterfacedBase &ib) const =0
 Return the pointer of ib.
virtual bool check (const InterfacedBase &ib, cIBPtr ip) const =0
 Check if set(ib, ip) will be successfull but do not do anything.
virtual void rebind (InterfacedBase &ib, const TranslationMap &trans, const IVector &defs) const
 In the object ib, replace the pointer in this interface with one of the translated ones provided by trans.
virtual IVector getReferences (const InterfacedBase &ib) const
 Return the pointer to another object in ib (in a vector).


Detailed Description

The Reference class and its base class ReferenceBase defines an interface to a class derived from the InterfacedBase, through which pointers to other InterfacedBase objects may be manipulated.

Reference is templated on the type of the class and the class of the objects pointed to, and is derived from the InterfaceBase class via ReferenceBase and RefInterfaceBase.

For each InterfacedBase class exactly one static Reference 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 37 of file Reference.h.


Constructor & Destructor Documentation

ThePEG::ReferenceBase::ReferenceBase ( string  newName,
string  newDescription,
string  newClassName,
const type_info &  newTypeInfo,
string  newRefClassName,
const type_info &  newRefTypeInfo,
bool  depSafe,
bool  readonly,
bool  norebind,
bool  nullable,
bool  defnull 
)

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.
newRefClassName the name of the class pointed to.
newRefTypeInfo the type_info object of the class pointed to.
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.
norebind if set to true, this interface is not responsible for the rebinding of corresponding objects.
nullable if set to true this corresponding references may be null.
defnull if set to true and a corresponding reference is null it may be given a a default value in the initialization of an EventGenerator.


Member Function Documentation

virtual string ThePEG::ReferenceBase::exec ( InterfacedBase ib,
string  action,
string  arguments 
) const [virtual]

The general interface method overriding the one in InterfaceBase.

For this class, action can be any of "set" and "get" and argument should correspond to the name of an InterfacedBase object in the BaseRepository.

Implements ThePEG::InterfaceBase.

virtual void ThePEG::ReferenceBase::rebind ( InterfacedBase ib,
const TranslationMap trans,
const IVector defs 
) const [virtual]

In the object ib, replace the pointer in this interface with one of the translated ones provided by trans.

If the pointer is null, and defaultIfNull() is true, replace it with the first allowed object found in defs.

Reimplemented from ThePEG::InterfaceBase.


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