thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.4
ThePEG::ClassTraitsBase< T > Struct Template Reference

The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG. More...

#include <ClassTraits.h>

Inheritance diagram for ThePEG::ClassTraitsBase< T >:

Public Types

typedef ThePEG::Ptr< T >::pointer TPtr
 Alias for a reference counted pointer to T . More...
 
typedef ThePEG::Ptr< T >::const_pointer cTPtr
 Alias for a reference counted pointer to a const T . More...
 
typedef ThePEG::Ptr< T >::transient_pointer tTPtr
 Alias for a transient pointer to T . More...
 
typedef ThePEG::Ptr< T >::transient_const_pointer tcTPtr
 Alias for a transient pointer to a const T . More...
 
typedef ThePEG::Ptr< Base >::pointer BPtr
 Alias for a reference counted pointer to Base . More...
 
typedef ThePEG::Ptr< Base >::const_pointer cBPtr
 Alias for a reference counted pointer to a const Base . More...
 
typedef ThePEG::Ptr< Base >::transient_pointer tBPtr
 Alias for a transient pointer to Base . More...
 
typedef ThePEG::Ptr< Base >::transient_const_pointer tcBPtr
 Alias for a transient pointer to a const Base . More...
 

Static Public Member Functions

static TPtr create ()
 Create a T object and return a smart pointer to it.
 
static string className ()
 Return the name of class T.
 
static int version ()
 Return the version of class T.
 
static string library ()
 The name of a file containing the dynamic library where the class T is implemented. More...
 
static void output (tcTPtr t, PersistentOStream &os)
 Write the T part of an object to a persistent stream.
 
static void input (tTPtr t, PersistentIStream &is, int oldVersion)
 Read the T part of an object from a persistent stream.
 
static TPtr cast (BPtr b)
 Perform a dynamic cast from the given pointer to a pointer to T.
 
static cTPtr cast (cBPtr b)
 Perform a dynamic cast from the given const pointer to a pointer to const T.
 
static tTPtr cast (tBPtr b)
 Perform a dynamic cast from the given transient pointer to a transient pointer to T.
 
static tcTPtr cast (tcBPtr b)
 Perform a dynamic cast from the given transient const pointer to a transient pointer to const T.
 

Detailed Description

template<typename T>
struct ThePEG::ClassTraitsBase< T >

The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG.

By default, the ClassTraits simply inherits from ClassTraitsBase, but it can be specialized to override the static member functions.

The information that should be made available is:
create() creates an object of the described class,
className() returns the platform-independent name of the class,
version() return the version number,
output() output the members of the class to a PersistentOStream,
input() reads the members of the class from a PersistentIStream and
cast() dynamically cast a pointer to a public base class to a pointer to the class.

See also
PersistentOStream
PersistentIStream

Definition at line 52 of file ClassTraits.h.

Member Typedef Documentation

◆ BPtr

template<typename T>
typedef ThePEG::Ptr< Base >::pointer ThePEG::ClassTraitsBase< T >::BPtr

Alias for a reference counted pointer to Base .

Definition at line 55 of file ClassTraits.h.

◆ cBPtr

template<typename T>
typedef ThePEG::Ptr< Base >::const_pointer ThePEG::ClassTraitsBase< T >::cBPtr

Alias for a reference counted pointer to a const Base .

Definition at line 55 of file ClassTraits.h.

◆ cTPtr

template<typename T>
typedef ThePEG::Ptr< T >::const_pointer ThePEG::ClassTraitsBase< T >::cTPtr

Alias for a reference counted pointer to a const T .

Definition at line 54 of file ClassTraits.h.

◆ tBPtr

template<typename T>
typedef ThePEG::Ptr< Base >::transient_pointer ThePEG::ClassTraitsBase< T >::tBPtr

Alias for a transient pointer to Base .

Definition at line 55 of file ClassTraits.h.

◆ tcBPtr

template<typename T>
typedef ThePEG::Ptr< Base >::transient_const_pointer ThePEG::ClassTraitsBase< T >::tcBPtr

Alias for a transient pointer to a const Base .

Definition at line 55 of file ClassTraits.h.

◆ tcTPtr

template<typename T>
typedef ThePEG::Ptr< T >::transient_const_pointer ThePEG::ClassTraitsBase< T >::tcTPtr

Alias for a transient pointer to a const T .

Definition at line 54 of file ClassTraits.h.

◆ TPtr

template<typename T>
typedef ThePEG::Ptr< T >::pointer ThePEG::ClassTraitsBase< T >::TPtr

Alias for a reference counted pointer to T .

Definition at line 54 of file ClassTraits.h.

◆ tTPtr

template<typename T>
typedef ThePEG::Ptr< T >::transient_pointer ThePEG::ClassTraitsBase< T >::tTPtr

Alias for a transient pointer to T .

Definition at line 54 of file ClassTraits.h.

Member Function Documentation

◆ library()

template<typename T>
static string ThePEG::ClassTraitsBase< T >::library ( )
inlinestatic

The name of a file containing the dynamic library where the class T is implemented.

It may also include several, space separated, libraries if the class T depends on other classes (base classes excepted). In this case the listed libraries will be dynamically linked in the order they are specified.

Definition at line 85 of file ClassTraits.h.


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