thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::InterfaceBase Class Referenceabstract

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.
 
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.
 
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.
 
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.
 
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.
 
 Named (const Named &)=default
 Explicit default copy-constructor (too avoid compiler warnings)
 
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.
 

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.

◆ ~InterfaceBase()

virtual ThePEG::InterfaceBase::~InterfaceBase ( )
inlinevirtual

The destructor.

Definition at line 91 of file InterfaceBase.h.

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

◆ className()

string ThePEG::InterfaceBase::className ( ) const
inline

Return the class name for the class this interface is defined for.

Definition at line 166 of file InterfaceBase.h.

References theClassName.

◆ dependencySafe()

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

Get the flag saying whether changing an object with this interface may change the state of a dependent object .

Definition at line 172 of file InterfaceBase.h.

References isDependencySafe.

◆ description()

string ThePEG::InterfaceBase::description ( ) const
inline

Return the description of this interface.

Definition at line 143 of file InterfaceBase.h.

References theDescription.

Referenced by anonymous().

◆ doxygenDescription()

virtual void ThePEG::InterfaceBase::doxygenDescription ( ostream &  stream) const
virtual

Print a description to be included in the Doxygen documentation to the given stream.

Reimplemented in ThePEG::Parameter< T, Type >, ThePEG::Parameter< T, string >, ThePEG::ParMap< T, Type >, ThePEG::ParVector< T, Type >, and ThePEG::Switch< T, Int >.

◆ doxygenType()

virtual string ThePEG::InterfaceBase::doxygenType ( ) const
pure virtual

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

◆ fullDescription()

virtual string ThePEG::InterfaceBase::fullDescription ( const InterfacedBase ib) const
virtual

◆ getReferences()

virtual IVector ThePEG::InterfaceBase::getReferences ( const InterfacedBase ) const
inlinevirtual

For derived classes interfacing references between Interfaced objects, return the references for this interface.

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

Definition at line 136 of file InterfaceBase.h.

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

◆ readOnly()

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

Get the flag saying whether this interface is allowed to change an object.

Definition at line 190 of file InterfaceBase.h.

References isReadOnly, and NoReadOnly.

◆ 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::ReferenceBase, and ThePEG::RefVectorBase.

Definition at line 128 of file InterfaceBase.h.

◆ setDependencySafe()

void ThePEG::InterfaceBase::setDependencySafe ( )
inline

Set the flag saying whether changing an object with this interface may change the state of a dependent object .

Definition at line 178 of file InterfaceBase.h.

References isDependencySafe.

◆ setDependencySensitive()

void ThePEG::InterfaceBase::setDependencySensitive ( )
inline

Set the flag saying whether changing an object with this interface may change the state of a dependent object .

Definition at line 184 of file InterfaceBase.h.

References isDependencySafe.

◆ setHasDefault()

void ThePEG::InterfaceBase::setHasDefault ( bool  b)
inline

Indicate that this interface has a default value.

Definition at line 225 of file InterfaceBase.h.

References hasDefault.

◆ setReadOnly()

void ThePEG::InterfaceBase::setReadOnly ( )
inline

Set the flag saying that this interface is allowed to change an object.

Definition at line 196 of file InterfaceBase.h.

References isReadOnly.

◆ setReadWrite()

void ThePEG::InterfaceBase::setReadWrite ( )
inline

Unset the flag saying that this interface is allowed to change an object.

Definition at line 202 of file InterfaceBase.h.

References isReadOnly.

◆ type()

virtual string ThePEG::InterfaceBase::type ( ) const
pure virtual

Member Data Documentation

◆ hasDefault

bool ThePEG::InterfaceBase::hasDefault
protected

◆ isDependencySafe

bool ThePEG::InterfaceBase::isDependencySafe
mutableprotected

The flag saying whether changing an object with this interface may change the state of a dependent object .

Definition at line 263 of file InterfaceBase.h.

Referenced by dependencySafe(), setDependencySafe(), and setDependencySensitive().

◆ isReadOnly

bool ThePEG::InterfaceBase::isReadOnly
mutableprotected

The flag saying whether this interface is allowed to change an object.

Definition at line 269 of file InterfaceBase.h.

Referenced by readOnly(), setReadOnly(), and setReadWrite().

◆ NoReadOnly

bool ThePEG::InterfaceBase::NoReadOnly
static

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

Definition at line 232 of file InterfaceBase.h.

Referenced by readOnly().

◆ theClassName

string ThePEG::InterfaceBase::theClassName
private

The class name and for the class this interface is defined for.

Definition at line 244 of file InterfaceBase.h.

Referenced by className().

◆ theDescription

string ThePEG::InterfaceBase::theDescription
private

The description of this interface.

Definition at line 239 of file InterfaceBase.h.

Referenced by description().

◆ 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: