thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO > Class Template Reference

DescribeClassT and its derived companion classes DescribeClass DescribeAbstractClass, DescribeNoPIOClass and DescribeAbstractNoPIOClass, is a simplified interface to the type information system in ThePEG. More...

#include <DescribeClass.h>

Inheritance diagram for ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >:

Public Types

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.
 

Public Member Functions

 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 DescriptionVectordescriptions () 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

- 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 Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 

Detailed Description

template<typename T, typename BaseT, bool Abstract = false, bool NoPIO = false>
class ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >

DescribeClassT and its derived companion classes DescribeClass DescribeAbstractClass, DescribeNoPIOClass and DescribeAbstractNoPIOClass, is a simplified interface to the 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 should be used for abstract classes and classes without persistent I/O functions respectively.

Definition at line 159 of file DescribeClass.h.

Member Typedef Documentation

◆ BPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<Base>::pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::BPtr

Alias for a reference counted pointer to Base .

Definition at line 164 of file DescribeClass.h.

◆ cBPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<Base>::const_pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::cBPtr

Alias for a reference counted pointer to a const Base .

Definition at line 164 of file DescribeClass.h.

◆ cTPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<T>::const_pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::cTPtr

Alias for a reference counted pointer to a const T .

Definition at line 163 of file DescribeClass.h.

◆ tBPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<Base>::transient_pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::tBPtr

Alias for a transient pointer to Base .

Definition at line 164 of file DescribeClass.h.

◆ tcBPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<Base>::transient_const_pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::tcBPtr

Alias for a transient pointer to a const Base .

Definition at line 164 of file DescribeClass.h.

◆ tcTPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<T>::transient_const_pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::tcTPtr

Alias for a transient pointer to a const T .

Definition at line 163 of file DescribeClass.h.

◆ TPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<T>::pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::TPtr

Alias for a reference counted pointer to T .

Definition at line 163 of file DescribeClass.h.

◆ tTPtr

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
typedef ThePEG::Ptr<T>::transient_pointer ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::tTPtr

Alias for a transient pointer to T .

Definition at line 163 of file DescribeClass.h.

Constructor & Destructor Documentation

◆ DescribeClassT()

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::DescribeClassT ( string  cname,
string  lib,
int  vers = 0 
)
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 170 of file DescribeClass.h.

References ThePEG::DescriptionList::Register().

◆ ~DescribeClassT()

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
virtual ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::~DescribeClassT ( )
inlinevirtual

The descructor.

Definition at line 179 of file DescribeClass.h.

Member Function Documentation

◆ create()

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
virtual BPtr ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::create ( ) const
inlinevirtual

Default-create an object.

Implements ThePEG::ClassDescriptionBase.

Definition at line 201 of file DescribeClass.h.

References ThePEG::DescribeClassAbstractHelper< T, abstract >::create().

◆ input()

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
virtual void ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::input ( tBPtr  o,
PersistentIStream is,
int  oldVersion 
) const
inlinevirtual

Call standard input function.

Implements ThePEG::ClassDescriptionBase.

Definition at line 216 of file DescribeClass.h.

References ThePEG::DescribeClassPIOHelper< T, NoPIO >::input().

◆ output()

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
virtual void ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::output ( tcBPtr  o,
PersistentOStream os 
) const
inlinevirtual

Call standard output function.

Implements ThePEG::ClassDescriptionBase.

Definition at line 208 of file DescribeClass.h.

References ThePEG::DescribeClassPIOHelper< T, NoPIO >::output().

◆ setup()

template<typename T , typename BaseT , bool Abstract = false, bool NoPIO = false>
virtual void ThePEG::DescribeClassT< T, BaseT, Abstract, NoPIO >::setup ( )
inlinevirtual

Set up the base class information for this object.

Implements ThePEG::ClassDescriptionBase.

Definition at line 184 of file DescribeClass.h.

References ThePEG::ClassDescriptionBase::baseClasses(), and ThePEG::DescriptionList::find().


The documentation for this class was generated from the following file: