ThePEG
1.8.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Persistency
InputDescription.h
1
// -*- C++ -*-
2
//
3
// InputDescription.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2011 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_InputDescription_H
10
#define ThePEG_InputDescription_H
11
// This is the declaration of the InputDescription class.
12
13
#include "ThePEG/Config/ThePEG.h"
14
#include "ThePEG/Utilities/ClassDescription.h"
15
16
namespace
ThePEG {
17
31
class
InputDescription
:
public
Named
{
32
33
public
:
34
36
typedef
vector<const InputDescription *>
DescriptionVector
;
37
38
ThePEG_DECLARE_POINTERS
(
PersistentBase
,
BPtr
);
39
40
public
:
41
47
InputDescription
(
string
newName,
int
newVersion)
48
:
Named
(newName),
theDescription
(0),
theVersion
(newVersion) {}
49
53
void
setDescription
(
const
ClassDescriptionBase
* cd) {
54
theDescription
= cd;
55
}
56
60
void
addBaseClass
(
const
InputDescription
* newBase) {
61
theBaseClasses
.push_back(newBase);
62
}
63
67
const
DescriptionVector
&
descriptions
()
const
{
68
return
theBaseClasses
;
69
}
70
74
BPtr
create
()
const
{
75
if
(
theDescription
)
return
theDescription
->
create
();
76
DescriptionVector::const_iterator dit =
theBaseClasses
.begin();
77
while
( dit !=
theBaseClasses
.end() ) {
78
BPtr
obj = (*dit++)->
create
();
79
if
( obj )
return
obj;
80
}
81
return
BPtr
();
82
}
83
89
void
input
(
tBPtr
b,
PersistentIStream
& is)
const
{
90
if
(
theDescription
)
theDescription
->
input
(b, is,
theVersion
);
91
}
92
93
private
:
94
98
DescriptionVector
theBaseClasses
;
99
104
const
ClassDescriptionBase
*
theDescription
;
105
109
int
theVersion
;
110
111
};
112
113
}
114
115
#endif
/* ThePEG_InputDescription_H */
Generated on Sat Jun 16 2012 16:51:04 for ThePEG by
1.8.1.1