9 #ifndef ThePEG_Reference_H 10 #define ThePEG_Reference_H 13 #include "ThePEG/Config/ThePEG.h" 14 #include "InterfaceBase.h" 15 #include "Reference.xh" 16 #include "Reference.fh" 78 const type_info & newTypeInfo,
79 string newRefClassName,
80 const type_info & newRefTypeInfo,
bool depSafe,
81 bool readonly,
bool norebind,
bool nullable,
bool defnull);
90 string arguments)
const;
100 virtual string type()
const;
161 template <
class T,
class R>
171 typedef void (T::*SetFn)(RefPtr);
173 typedef bool (T::*CheckFn)(cRefPtr)
const;
175 typedef RefPtr (T::*GetFn)()
const;
216 Member newMember,
bool depSafe =
false,
217 bool readonly =
false,
bool rebind =
true,
bool nullable =
true,
218 SetFn newSetFn = 0, GetFn newGetFn = 0,
219 CheckFn newCheckFn = 0)
223 depSafe, readonly, !
rebind, nullable, false),
224 theMember(newMember), theSetFn(newSetFn), theGetFn(newGetFn),
225 theCheckFn(newCheckFn) {}
266 Member newMember,
bool depSafe,
bool readonly,
bool rebind,
267 bool nullable,
bool defnull, SetFn newSetFn = 0, GetFn newGetFn = 0,
268 CheckFn newCheckFn = 0)
272 depSafe, readonly, !rebind, nullable, defnull),
273 theMember(newMember), theSetFn(newSetFn), theGetFn(newGetFn),
274 theCheckFn(newCheckFn) {}
338 #include "Reference.tcc" virtual void rebind(InterfacedBase &ib, const TranslationMap &trans, const IVector &defs) const
In the object ib, replace the pointer in this interface with one of the translated ones provided by t...
Ptr< R >::const_pointer cRefPtr
A const pointer to the class of objects referred to.
virtual string doxygenType() const
Return a string describing the type of interface to be included in the Doxygen documentation.
virtual string type() const
Return a code for the type of this reference.
virtual string fullDescription(const InterfacedBase &ib) const
Return a complete description of this reference.
ConstRCPtr is a reference counted (smart) const pointer.
Rebinder is a class associating pairs of pointers to objects.
This is the main namespace within which all identifiers in ThePEG are declared.
Ptr< R >::pointer RefPtr
A pointer to the class of objects referred to.
void setGetFunction(GetFn gf)
Give a pointer to a member function to be used by 'get()'.
virtual IVector getReferences(const InterfacedBase &ib) const
Return the pointer to another object in ib (in a vector).
virtual string exec(InterfacedBase &ib, string action, string arguments) const
The general interface method overriding the one in InterfaceBase.
string className() const
Return the class name for the class this interface is defined for.
virtual bool check(const InterfacedBase &ib, cIBPtr ip) const =0
Check if set(ib, ip) will be successfull but do not do anything.
SetFn theSetFn
A pointer to a member function to be used by 'set()'.
RefPtr T::* Member
Declaration of a direct pointer to the member variable.
CheckFn theCheckFn
Give a pointer to a member function to be used by 'check()'.
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 ...
RCPtr is a reference counted (smart) pointer.
Reference(string newName, string newDescription, Member newMember, bool depSafe, bool readonly, bool rebind, bool nullable, bool defnull, SetFn newSetFn=0, GetFn newGetFn=0, CheckFn newCheckFn=0)
Standard constructor.
GetFn theGetFn
Give a pointer to a member function to be used by 'get()'.
The default concrete implementation of ClassTraitsBase.
Member theMember
The pointer to the member variable.
void setCheckFunction(CheckFn cf)
Give a pointer to a member function to be used by 'check()'.
The Reference class and its base class ReferenceBase defines an interface to a class derived from the...
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
ReferenceBase(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 setSetFunction(SetFn sf)
Give a pointer to a member function to be used by 'set()'.
Reference(string newName, string newDescription, Member newMember, bool depSafe=false, bool readonly=false, bool rebind=true, bool nullable=true, SetFn newSetFn=0, GetFn newGetFn=0, CheckFn newCheckFn=0)
Standard constructor.
The Reference and its base class ReferenceBase defines an interface to a class derived from the Inter...