ThePEG 2.3.0
|
DescribeClass and its companion classes DescribeAbstractClass, DescribeNoPIOClass and DescribeAbstractNoPIOClass, is a simplified interface to type information system in ThePEG. More...
#include <DescribeClass.h>
Public Member Functions | |
DescribeClass (string cname, string lib, int vers=0) | |
Constructor taking the name of the class, the dynamic library where it is located and an optional version number as argument. | |
Public Member Functions inherited from ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO > | |
DescribeClassT (string cname, string lib, int vers=0) | |
Constructor taking the name of the class, the dynamic library where it is located and an optional version number as argument. | |
virtual | ~DescribeClassT () |
The descructor. | |
virtual void | setup () |
Set up the base class information for this object. | |
virtual BPtr | create () const |
Default-create an object. | |
virtual void | output (tcBPtr o, PersistentOStream &os) const |
Call standard output function. | |
virtual void | input (tBPtr o, PersistentIStream &is, int oldVersion) const |
Call standard input function. | |
Public Member Functions inherited from ThePEG::ClassDescriptionBase | |
virtual | ~ClassDescriptionBase () |
Empty destructor. | |
const type_info & | info () const |
The standart RTTI type_info object for the described class. | |
int | version () const |
The version of the described class. | |
string | library () const |
The name of a file containing the dynamic library where the class is implemented. | |
bool | check () const |
Return true if this object was set up properly. | |
const DescriptionVector & | descriptions () const |
Return the descriptions of the base classes of the described class. | |
virtual void | setup ()=0 |
Set up the base class information for this object. | |
virtual BPtr | create () const =0 |
Create an object of the described class. | |
virtual void | output (tcBPtr b, PersistentOStream &os) const =0 |
Output the members of an object of the described class to a persistent stream. | |
virtual void | input (tBPtr b, PersistentIStream &is, int oldVersion) const =0 |
Read the members of an object of the described class from a persistent stream. | |
bool | isA (const ClassDescriptionBase &base) const |
Return true if the class described by the argument is a base class of the class described by this. | |
bool | abstract () const |
Return true if the corresponding class is abstract. | |
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. | |
Additional Inherited Members | |
Public Types inherited from ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO > | |
typedef ThePEG::Ptr< T >::pointer | TPtr |
Alias for a reference counted pointer to T . | |
typedef ThePEG::Ptr< T >::const_pointer | cTPtr |
Alias for a reference counted pointer to a const T . | |
typedef ThePEG::Ptr< T >::transient_pointer | tTPtr |
Alias for a transient pointer to T . | |
typedef ThePEG::Ptr< T >::transient_const_pointer | tcTPtr |
Alias for a transient pointer to a const T . | |
typedef ThePEG::Ptr< Base >::pointer | BPtr |
Alias for a reference counted pointer to Base . | |
typedef ThePEG::Ptr< Base >::const_pointer | cBPtr |
Alias for a reference counted pointer to a const Base . | |
typedef ThePEG::Ptr< Base >::transient_pointer | tBPtr |
Alias for a transient pointer to Base . | |
typedef ThePEG::Ptr< Base >::transient_const_pointer | tcBPtr |
Alias for a transient pointer to a const Base . | |
Public Types inherited from ThePEG::ClassDescriptionBase | |
typedef vector< const ClassDescriptionBase * > | DescriptionVector |
A vector of class descriptions. | |
Protected Member Functions inherited from ThePEG::ClassDescriptionBase | |
ClassDescriptionBase (string newName, const type_info &newInfo, int newVersion, string newLibrary, bool abst) | |
The constructor used by sub-classes. | |
void | baseClasses (DescriptionVector::iterator first, DescriptionVector::iterator last) |
Set the base classes. | |
Protected Member Functions inherited from ThePEG::Named | |
const Named & | operator= (const Named &other) |
Assignment. | |
const string & | name (const string &newName) |
Set new name. | |
DescribeClass and its companion classes DescribeAbstractClass, DescribeNoPIOClass and DescribeAbstractNoPIOClass, is a simplified interface to type information system in ThePEG.
For simple classes there is no need to specialize the ClassTraits and BaseClassTrait classes and to have a static member variable of ClassDescription in the class (as in the full ThePEG type info system). Instead it is enough to have one statically initialized variable of one of the DescraibeClass classes for each class. The Abstract and NoPIO versions of this class may be used for abstract classes and classes without persistent I/O functions respectively.
The template arguments are as follows: T : the class being described. BaseT : The base class of T. If several base classes these should be encoded s template arguments to the BaseClasses class (at most four base classes can be encoded). Abstract: shoule be set to true if class T is abstract. NoPIO : shoule be set to true if class T does not persistent I/O functions.
Definition at line 245 of file DescribeClass.h.
|
inline |
Constructor taking the name of the class, the dynamic library where it is located and an optional version number as argument.
Definition at line 253 of file DescribeClass.h.