ThePEG 2.3.0
|
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. | |
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 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. |
|
inlinevirtual |
The destructor.
Definition at line 91 of file InterfaceBase.h.
|
inline |
Return true if this interface is anonyous, ie.
invisible for the user interface.
Definition at line 208 of file InterfaceBase.h.
References description().
|
inline |
Return the class name for the class this interface is defined for.
Definition at line 166 of file InterfaceBase.h.
References theClassName.
|
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.
|
inline |
Return the description of this interface.
Definition at line 143 of file InterfaceBase.h.
References theDescription.
Referenced by anonymous().
|
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 >.
|
pure virtual |
Return a string describing the type of interface to be included in the Doxygen documentation.
Implemented in ThePEG::CommandBase, ThePEG::DeletedBase, ThePEG::ParameterTBase< Type >, ThePEG::ParameterTBase< string >, ThePEG::ParMapTBase< Type >, ThePEG::ParVectorTBase< Type >, ThePEG::ReferenceBase, ThePEG::RefVectorBase, and ThePEG::SwitchBase.
|
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.
|
virtual |
Return a complete description of this interface.
Reimplemented in ThePEG::ParameterBase, ThePEG::ParMapBase, ThePEG::ParMapTBase< Type >, ThePEG::ParVectorBase, ThePEG::ParVectorTBase< Type >, ThePEG::ReferenceBase, ThePEG::RefVectorBase, and ThePEG::SwitchBase.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
inline |
Indicate that this interface has a default value.
Definition at line 225 of file InterfaceBase.h.
References hasDefault.
|
inline |
Set the flag saying that this interface is allowed to change an object.
Definition at line 196 of file InterfaceBase.h.
References isReadOnly.
|
inline |
Unset the flag saying that this interface is allowed to change an object.
Definition at line 202 of file InterfaceBase.h.
References isReadOnly.
|
pure virtual |
Return a code for the type of this interface.
Implemented in ThePEG::CommandBase, ThePEG::DeletedBase, ThePEG::ParameterTBase< Type >, ThePEG::ParameterTBase< string >, ThePEG::ParMapTBase< Type >, ThePEG::ParVectorTBase< Type >, ThePEG::ReferenceBase, ThePEG::RefVectorBase, and ThePEG::SwitchBase.
|
protected |
A flag indicating whether this interface has a default setting.
Definition at line 257 of file InterfaceBase.h.
Referenced by ThePEG::CommandBase::CommandBase(), ThePEG::ParameterTBase< string >::ParameterTBase(), ThePEG::ParMapBase::ParMapBase(), ThePEG::ParVectorBase::ParVectorBase(), and setHasDefault().
|
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().
|
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().
|
static |
If set to true, all read-only interfaces can be changed.
Definition at line 232 of file InterfaceBase.h.
Referenced by readOnly().
|
private |
The class name and for the class this interface is defined for.
Definition at line 244 of file InterfaceBase.h.
Referenced by className().
|
private |
The description of this interface.
Definition at line 239 of file InterfaceBase.h.
Referenced by description().
|
private |
A rank assigned to this interface.
Used for sorting by user interface.
Definition at line 250 of file InterfaceBase.h.
Referenced by rank().