thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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 .
 
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 .
 

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.
 
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

◆ cast() [1/4]

template<typename T >
static TPtr ThePEG::ClassTraitsBase< T >::cast ( BPtr  b)
inlinestatic

◆ cast() [2/4]

template<typename T >
static cTPtr ThePEG::ClassTraitsBase< T >::cast ( cBPtr  b)
inlinestatic

Perform a dynamic cast from the given const pointer to a pointer to const T.

Definition at line 112 of file ClassTraits.h.

◆ cast() [3/4]

template<typename T >
static tTPtr ThePEG::ClassTraitsBase< T >::cast ( tBPtr  b)
inlinestatic

Perform a dynamic cast from the given transient pointer to a transient pointer to T.

Definition at line 118 of file ClassTraits.h.

◆ cast() [4/4]

template<typename T >
static tcTPtr ThePEG::ClassTraitsBase< T >::cast ( tcBPtr  b)
inlinestatic

Perform a dynamic cast from the given transient const pointer to a transient pointer to const T.

Definition at line 124 of file ClassTraits.h.

◆ className()

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

Return the name of class T.

Definition at line 66 of file ClassTraits.h.

References ThePEG::DescriptionList::className().

◆ create()

template<typename T >
static TPtr ThePEG::ClassTraitsBase< T >::create ( )
inlinestatic

Create a T object and return a smart pointer to it.

Definition at line 60 of file ClassTraits.h.

References ThePEG::Pointer::RCPtr< T >::Create().

Referenced by ThePEG::ClassDescription< T >::create(), and ThePEG::NoPIOClassDescription< T >::create().

◆ input()

template<typename T >
static void ThePEG::ClassTraitsBase< T >::input ( tTPtr  t,
PersistentIStream is,
int  oldVersion 
)
inlinestatic

Read the T part of an object from a persistent stream.

Definition at line 99 of file ClassTraits.h.

Referenced by ThePEG::AbstractClassDescription< T >::input(), and ThePEG::ClassDescription< T >::input().

◆ 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.

References ThePEG::DescriptionList::library().

◆ output()

template<typename T >
static void ThePEG::ClassTraitsBase< T >::output ( tcTPtr  t,
PersistentOStream os 
)
inlinestatic

Write the T part of an object to a persistent stream.

Definition at line 92 of file ClassTraits.h.

Referenced by ThePEG::AbstractClassDescription< T >::output(), and ThePEG::ClassDescription< T >::output().

◆ version()

template<typename T >
static int ThePEG::ClassTraitsBase< T >::version ( )
inlinestatic

Return the version of class T.

Definition at line 73 of file ClassTraits.h.

References ThePEG::DescriptionList::version().


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