ThePEG::InterfaceBase Class Reference

The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase class. More...

#include <InterfaceBase.h>

Inheritance diagram for ThePEG::InterfaceBase:

ThePEG::Named ThePEG::CommandBase ThePEG::DeletedBase ThePEG::ParameterBase ThePEG::ParVectorBase ThePEG::RefInterfaceBase ThePEG::SwitchBase ThePEG::Command< T > ThePEG::Deleted< T > ThePEG::ParameterTBase< Type > ThePEG::ThePEG::ParameterTBase< string > ThePEG::ParVectorTBase< Type > ThePEG::ReferenceBase ThePEG::RefVectorBase ThePEG::Switch< T, Int >

List of all members.

Public Member Functions

 InterfaceBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe, bool readonly)
 Standard constructor.
virtual ~InterfaceBase ()
 The destructor.
virtual string exec (InterfacedBase &ib, string action, string arguments) const =0
 Manipulate an object of the corresponding class.
virtual string type () const =0
 Return a code for the type of this interface.
virtual void rebind (InterfacedBase &, const TranslationMap &, const IVector &=IVector()) const
 Rebind all references in ib according to the translation map.
virtual IVector getReferences (const InterfacedBase &) const
 For derived classes interfacing references between Interfaced objects, return the references for this interface.
string description () const
 Return the description of this interface.
virtual string fullDescription (const InterfacedBase &ib) const
 Return a complete description of this interface.
virtual void doxygenDescription (ostream &stream) const
 Print a description to be included in the Doxygen documentation to the given stream.
virtual string doxygenType () const =0
 Return a string describing the type of interface to be included in the Doxygen documentation.
string className () const
 Return the class name for the class this interface is defined for.
bool dependencySafe () const
 Get the flag saying whether changing an object with this interface may change the state of a dependent object .
void setDependencySafe ()
 Set the flag saying whether changing an object with this interface may change the state of a dependent object .
void setDependencySensitive ()
 Set the flag saying whether changing an object with this interface may change the state of a dependent object .
bool readOnly () const
 Get the flag saying whether this interface is allowed to change an object.
void setReadOnly ()
 Set the flag saying that this interface is allowed to change an object.
void setReadWrite ()
 Unset the flag saying that this interface is allowed to change an object.
bool anonymous () const
 Return true if this interface is anonyous, ie.
double rank () const
 Get the rank for this interface.
void rank (double r)
 Set the rank for this interface.

Static Public Attributes

static bool NoReadOnly
 If set to true, all read-only interfaces can be changed.

Protected Attributes

bool isDependencySafe
 The flag saying whether changing an object with this interface may change the state of a dependent object .
bool isReadOnly
 The flag saying whether this interface is allowed to change an object.

Private Attributes

string theDescription
 The description of this interface.
string theClassName
 The class name and for the class this interface is defined for.
double theRank
 A rank assigned to this interface.


Detailed Description

The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase class.

Using the pure virtual exec() function, it is possible to manipulate any InterfacedBase object. InterfaceBase is an abstract base class for derived classes such as Command, Parameter and Reference.

InterfaceBase objects are managed by the BaseRepository.

InterfaceBase is derived from the Named to manage the name of the interface.

From the Repository it is possible to generate a file with doxygen comments which can be included in the documentation describing the InterfaceBase objects defined for a class. For each class, ClassName, there will be produced a file called ClassNameInterfaces.html which can be referred to with a standard html href anchor. Also a specific interface, InterfaceName can be referred to with ClassNameInterfaces.html::InterfaceName. The file can also be referred to with the doxygen \ref command. Inside the description of an interface, other interfaces in the same class can be tagged with <interface>InterfaceName</interface> or, if the interface belongs to another class, <interface>ClassName::InterfaceName</interface>. By running the script in ThePEG/Doc/fixinterfaces.pl these tags will be converted to proper href anchors.

See also:
InterfacedBase

Command

Parameter

Reference

BaseRepository

Named

Definition at line 59 of file InterfaceBase.h.


Constructor & Destructor Documentation

ThePEG::InterfaceBase::InterfaceBase ( string  newName,
string  newDescription,
string  newClassName,
const type_info &  newTypeInfo,
bool  depSafe,
bool  readonly 
)

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.
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.


Member Function Documentation

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

Manipulate an object of the corresponding class.

Execute the action command with the given arguments for the given object ib.

Implemented in ThePEG::CommandBase, ThePEG::DeletedBase, ThePEG::ParameterBase, ThePEG::ParVectorBase, ThePEG::ReferenceBase, ThePEG::RefVectorBase, and ThePEG::SwitchBase.

virtual void ThePEG::InterfaceBase::rebind ( InterfacedBase ,
const TranslationMap ,
const IVector = IVector() 
) const [inline, virtual]

Rebind all references in ib according to the translation map.

Only used by derived classed interfacing references.

Reimplemented in ThePEG::ReferenceBase, and ThePEG::RefVectorBase.

Definition at line 111 of file InterfaceBase.h.

bool ThePEG::InterfaceBase::anonymous (  )  const [inline]

Return true if this interface is anonyous, ie.

invisible for the user interface.

Definition at line 191 of file InterfaceBase.h.

References description().

double ThePEG::InterfaceBase::rank (  )  const [inline]

Get the rank for this interface.

Used for sorting by user interface.

Definition at line 197 of file InterfaceBase.h.

References theRank.

Referenced by ThePEG::DeletedBase::DeletedBase().

void ThePEG::InterfaceBase::rank ( double  r  )  [inline]

Set the rank for this interface.

Used for sorting by user interface.

Definition at line 203 of file InterfaceBase.h.

References theRank.


Member Data Documentation

A rank assigned to this interface.

Used for sorting by user interface.

Definition at line 226 of file InterfaceBase.h.

Referenced by rank().


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