thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::InputDescription Class Reference

InputDescription objects are used by the PersistentIStream class to keep track of all classes it has read from a stream. More...

#include <InputDescription.h>

Inheritance diagram for ThePEG::InputDescription:

Public Types

typedef vector< const InputDescription * > DescriptionVector
 A vector of pointers to InputDescription objects.
 
typedef ThePEG::Ptr< PersistentBase >::pointer BPtr
 Alias for a reference counted pointer to PersistentBase .
 
typedef ThePEG::Ptr< PersistentBase >::const_pointer cBPtr
 Alias for a reference counted pointer to a const PersistentBase .
 
typedef ThePEG::Ptr< PersistentBase >::transient_pointer tBPtr
 Alias for a transient pointer to PersistentBase .
 
typedef ThePEG::Ptr< PersistentBase >::transient_const_pointer tcBPtr
 Alias for a transient pointer to a const PersistentBase .
 

Public Member Functions

 InputDescription (string newName, int newVersion)
 The standard constructor.
 
void setDescription (const ClassDescriptionBase *cd)
 Set the ClassDescriptionBase object of the class being read.
 
void addBaseClass (const InputDescription *newBase)
 Add a base class description.
 
const DescriptionVectordescriptions () const
 Return the list of base class descriptions.
 
BPtr create () const
 Create an object of the corresponding class.
 
void input (tBPtr b, PersistentIStream &is) const
 Read an object part of the corresponding class from a stream.
 
- 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.
 

Private Attributes

DescriptionVector theBaseClasses
 The list of base class descriptions.
 
const ClassDescriptionBasetheDescription
 The description of the corresponding class in the current program.
 
int theVersion
 The version of the class to be read.
 

Additional Inherited Members

- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 Assignment.
 
const string & name (const string &newName)
 Set new name.
 

Detailed Description

InputDescription objects are used by the PersistentIStream class to keep track of all classes it has read from a stream.

It keeps a pointer to the corresponding ClassDescription in case the class read in was actually present in the current program, a version number of the read class which may be different from the class present in the current program and a list of base class InputDescriptions.

See also
PersistentIStream
Named
ClassDescription

Definition at line 31 of file InputDescription.h.

Member Typedef Documentation

◆ BPtr

Alias for a reference counted pointer to PersistentBase .

Definition at line 38 of file InputDescription.h.

◆ cBPtr

Alias for a reference counted pointer to a const PersistentBase .

Definition at line 38 of file InputDescription.h.

◆ DescriptionVector

A vector of pointers to InputDescription objects.

Definition at line 36 of file InputDescription.h.

◆ tBPtr

Alias for a transient pointer to PersistentBase .

Definition at line 38 of file InputDescription.h.

◆ tcBPtr

typedef ThePEG::Ptr<PersistentBase>::transient_const_pointer ThePEG::InputDescription::tcBPtr

Alias for a transient pointer to a const PersistentBase .

Definition at line 38 of file InputDescription.h.

Constructor & Destructor Documentation

◆ InputDescription()

ThePEG::InputDescription::InputDescription ( string  newName,
int  newVersion 
)
inline

The standard constructor.

Parameters
newNamethe name of the class being read.
newVersionthe version number of the class when written.

Definition at line 47 of file InputDescription.h.

Member Function Documentation

◆ addBaseClass()

void ThePEG::InputDescription::addBaseClass ( const InputDescription newBase)
inline

Add a base class description.

Definition at line 60 of file InputDescription.h.

References theBaseClasses.

◆ create()

BPtr ThePEG::InputDescription::create ( ) const
inline

Create an object of the corresponding class.

Definition at line 74 of file InputDescription.h.

References create(), ThePEG::ClassDescriptionBase::create(), theBaseClasses, and theDescription.

Referenced by create().

◆ descriptions()

const DescriptionVector & ThePEG::InputDescription::descriptions ( ) const
inline

Return the list of base class descriptions.

Definition at line 67 of file InputDescription.h.

References theBaseClasses.

◆ input()

void ThePEG::InputDescription::input ( tBPtr  b,
PersistentIStream is 
) const
inline

Read an object part of the corresponding class from a stream.

Will only read the part of the object corresponding to the members of the class represented by this object.

Definition at line 89 of file InputDescription.h.

References ThePEG::ClassDescriptionBase::input(), theDescription, and theVersion.

◆ setDescription()

void ThePEG::InputDescription::setDescription ( const ClassDescriptionBase cd)
inline

Set the ClassDescriptionBase object of the class being read.

Definition at line 53 of file InputDescription.h.

References theDescription.

Member Data Documentation

◆ theBaseClasses

DescriptionVector ThePEG::InputDescription::theBaseClasses
private

The list of base class descriptions.

Definition at line 98 of file InputDescription.h.

Referenced by addBaseClass(), create(), and descriptions().

◆ theDescription

const ClassDescriptionBase* ThePEG::InputDescription::theDescription
private

The description of the corresponding class in the current program.

Definition at line 104 of file InputDescription.h.

Referenced by create(), input(), and setDescription().

◆ theVersion

int ThePEG::InputDescription::theVersion
private

The version of the class to be read.

Definition at line 109 of file InputDescription.h.

Referenced by input().


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