ThePEG
2.2.1
|
The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase class. More...
#include <InterfaceBase.h>
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. | |
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. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ThePEG::Named | |
const Named & | operator= (const Named &other) |
Assignment. | |
const string & | name (const string &newName) |
Set new name. | |
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.
Definition at line 59 of file InterfaceBase.h.
ThePEG::InterfaceBase::InterfaceBase | ( | string | newName, |
string | newDescription, | ||
string | newClassName, | ||
const type_info & | newTypeInfo, | ||
bool | depSafe, | ||
bool | readonly | ||
) |
Standard constructor.
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. |
|
inline |
Return true if this interface is anonyous, ie.
invisible for the user interface.
Definition at line 208 of file InterfaceBase.h.
References description().
|
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::ParameterBase, ThePEG::ParVectorBase, ThePEG::RefVectorBase, ThePEG::ReferenceBase, ThePEG::CommandBase, and ThePEG::DeletedBase.
Referenced by ~InterfaceBase().
|
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().
|
inline |
Set the rank for this interface.
Used for sorting by user interface.
Definition at line 220 of file InterfaceBase.h.
References theRank.
|
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.
|
private |
A rank assigned to this interface.
Used for sorting by user interface.
Definition at line 250 of file InterfaceBase.h.
Referenced by rank().