thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.4

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

#include <InterfaceBase.h>

Inheritance diagram for ThePEG::InterfaceBase:

Public Member Functions

 InterfaceBase (string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe, bool readonly)
 Standard constructor. More...
 
virtual ~InterfaceBase ()
 The destructor.
 
string tag (int pos=-1) const
 Create a tag for this interface using its name and optional poisitional argument.
 
virtual string exec (InterfacedBase &ib, string action, string arguments) const =0
 Manipulate an object of the corresponding class. More...
 
virtual string type () const =0
 Return a code for the type of this interface.
 
virtual bool notDefault (InterfacedBase &) const
 Returns true if the setting for this interface has been changed from its default value.
 
map< string, string > & objectDefaults (InterfacedBase &) const
 Returns the map of objectDefaults of the given object.
 
virtual void rebind (InterfacedBase &, const TranslationMap &, const IVector &=IVector()) const
 Rebind all references in ib according to the translation map. More...
 
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. More...
 
double rank () const
 Get the rank for this interface. More...
 
void rank (double r)
 Set the rank for this interface. More...
 
void setHasDefault (bool b)
 Indicate that this interface has a default value.
 
- Public Member Functions inherited from ThePEG::Named
 Named (const string &newName=string())
 Constructor with name.
 
const string & name () const
 Return name.
 
bool operator== (const Named &other) const
 Test for equality.
 
bool operator< (const Named &other) const
 Lexicographical comparison.
 

Static Public Attributes

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

Protected Attributes

bool hasDefault
 A flag indicating whether this interface has a default setting.
 
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. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 

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

◆ InterfaceBase()

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

Standard constructor.

Parameters
newNamethe name of the interface, may only contain letters [a-zA-z0-9_].
newDescriptiona brief description of the interface.
newClassNamethe name of the corresponding class.
newTypeInfothe type_info object of the corresponding class.
depSafeset to true if calls to this interface for one object does not influence other objects.
readonlyif 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

◆ anonymous()

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

Return true if this interface is anonyous, ie.

invisible for the user interface.

Definition at line 208 of file InterfaceBase.h.

References description().

◆ exec()

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::SwitchBase, ThePEG::ParVectorBase, ThePEG::ParameterBase, ThePEG::RefVectorBase, ThePEG::ReferenceBase, ThePEG::CommandBase, and ThePEG::DeletedBase.

Referenced by ~InterfaceBase().

◆ rank() [1/2]

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

Get the rank for this interface.

Used for sorting by user interface.

Definition at line 214 of file InterfaceBase.h.

References theRank.

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

◆ rank() [2/2]

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

Set the rank for this interface.

Used for sorting by user interface.

Definition at line 220 of file InterfaceBase.h.

References theRank.

◆ rebind()

virtual void ThePEG::InterfaceBase::rebind ( InterfacedBase ,
const TranslationMap ,
const IVector = IVector() 
) const
inlinevirtual

Rebind all references in ib according to the translation map.

Only used by derived classed interfacing references.

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

Definition at line 128 of file InterfaceBase.h.

Member Data Documentation

◆ theRank

double ThePEG::InterfaceBase::theRank
private

A rank assigned to this interface.

Used for sorting by user interface.

Definition at line 250 of file InterfaceBase.h.

Referenced by rank().


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