9 #ifndef ThePEG_InterfaceBase_H
10 #define ThePEG_InterfaceBase_H
13 #include "ThePEG/Config/ThePEG.h"
14 #include "InterfaceBase.fh"
15 #include "InterfaceBase.xh"
16 #include "ThePEG/Utilities/Named.h"
17 #include "ThePEG/Utilities/ClassTraits.h"
18 #include "Interface.h"
85 const type_info & newTypeInfo,
bool depSafe,
97 string tag(
int pos = -1)
const;
111 virtual string type()
const = 0;
321 string newClassName,
const type_info & newTypeInfo,
322 string newRefClassName,
323 const type_info & newRefTypeInfo,
324 bool depSafe,
bool readonly,
325 bool norebind,
bool nullable,
bool defnull);
428 inline double operator/(
string,
string) {
return 0.0; }
432 inline string operator*(
double,
string) {
return ""; }
void setDependencySafe()
Set the flag saying whether changing an object with this interface may change the state of a dependen...
void setNotNullable()
Set the flag saying that the interface it is not allowed to set the reference to null.
bool defaultIfNull() const
Get the flag saying wether a null pointer should be replaced by a default of suitable class when rebi...
bool isDependencySafe
The flag saying whether changing an object with this interface may change the state of a dependent ob...
void setDefaultIfNull()
Set the flag saying that a null pointer should be replaced by a default of suitable class when rebind...
void setNullable()
Set the flag saying that the interface it is allowed to set the reference to null.
virtual string doxygenType() const =0
Return a string describing the type of interface to be included in the Doxygen documentation.
virtual string type() const =0
Return a code for the type of this interface.
The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase clas...
virtual string fullDescription(const InterfacedBase &ib) const
Return a complete description of this interface.
bool hasDefault
A flag indicating whether this interface has a default setting.
string theRefClassName
The class name of the class referred to by this interface.
void setReadWrite()
Unset the flag saying that this interface is allowed to change an object.
bool theDefaultIfNull
The flag saying wether a null pointer should be replaced by a default of suitable class when rebind i...
bool noRebind() const
Get the flag saying whether the interface is responsible for rebinding of the corresponding refenerce...
RefInterfaceBase(string newName, string newDescription, string newClassName, const type_info &newTypeInfo, string newRefClassName, const type_info &newRefTypeInfo, bool depSafe, bool readonly, bool norebind, bool nullable, bool defnull)
Standard constructor.
void setNoDefaultIfNull()
Set the flag saying that a null pointer should not be replaced by a default of suitable class when re...
bool isNullable
The flag saying whether the interface is allowed to set a reference to null.
bool dontRebind
The flag saying whether the interface is responsible for rebinding refenerces.
Rebinder is a class associating pairs of pointers to objects.
InterfaceBase(string newName, string newDescription, string newClassName, const type_info &newTypeInfo, bool depSafe, bool readonly)
Standard constructor.
virtual ~InterfaceBase()
The destructor.
This is the main namespace within which all identifiers in ThePEG are declared.
The Named class is a simple concrete base class to used by classes of objects with a name...
virtual void rebind(InterfacedBase &, const TranslationMap &, const IVector &=IVector()) const
Rebind all references in ib according to the translation map.
const type_info & refTypeInfo() const
Return the type_info object of the class referred to by this interface.
virtual bool notDefault(InterfacedBase &) const
Returns true if the setting for this interface has been changed from its default value.
string tag(int pos=-1) const
Create a tag for this interface using its name and optional poisitional argument. ...
double theRank
A rank assigned to this interface.
bool isReadOnly
The flag saying whether this interface is allowed to change an object.
void setDependencySensitive()
Set the flag saying whether changing an object with this interface may change the state of a dependen...
virtual string exec(InterfacedBase &ib, string action, string arguments) const =0
Manipulate an object of the corresponding class.
string theDescription
The description of this interface.
string className() const
Return the class name for the class this interface is defined for.
void setRebind()
Set the flag saying that the interface is responsible for rebinding refenerces.
void setReadOnly()
Set the flag saying that this interface is allowed to change an object.
virtual IVector getReferences(const InterfacedBase &) const
For derived classes interfacing references between Interfaced objects, return the references for this...
virtual void doxygenDescription(ostream &stream) const
Print a description to be included in the Doxygen documentation to the given stream.
InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class...
RefInterfaceBase is an abstract base class inheriting from InterfaceBase used for subclasses dealing ...
static bool NoReadOnly
If set to true, all read-only interfaces can be changed.
string description() const
Return the description of this interface.
string refClassName() const
Return the class name of the class referred to by this interface.
void setNoRebind()
Set the flag saying that the interface is not responsible for rebinding refenerces.
string theClassName
The class name and for the class this interface is defined for.
bool readOnly() const
Get the flag saying whether this interface is allowed to change an object.
const type_info & theRefTypeInfo
The type_info object of the class referred to by this interface.
map< string, string > & objectDefaults(InterfacedBase &) const
Returns the map of objectDefaults of the given object.
void setHasDefault(bool b)
Indicate that this interface has a default value.
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
double rank() const
Get the rank for this interface.
bool noNull() const
Get the flag saying whether the interface is allowed to set the reference to null.
bool anonymous() const
Return true if this interface is anonyous, ie.
bool dependencySafe() const
Get the flag saying whether changing an object with this interface may change the state of a dependen...
void rank(double r)
Set the rank for this interface.