thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Utilities
DescriptionList.h
1
// -*- C++ -*-
2
//
3
// DescriptionList.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_DescriptionList_H
10
#define ThePEG_DescriptionList_H
11
// This is the declaration of the DescriptionList class.
12
13
#include "
ThePEG/Config/ThePEG.h
"
14
#include "ClassDescription.fh"
15
16
namespace
ThePEG
{
17
22
class
DescriptionList
{
23
24
public
:
25
26
#ifndef THEPEG_DYNAMIC_TYPE_INFO_BUG
28
typedef
map<const type_info *, ClassDescriptionBase *>
DescriptionMap
;
29
#else
31
typedef
map<string, ClassDescriptionBase *>
DescriptionMap
;
32
#endif
33
36
typedef
map<string, ClassDescriptionBase *>
StringMap
;
37
38
public
:
39
43
static
void
Register
(
ClassDescriptionBase
&);
44
48
static
inline
const
ClassDescriptionBase
*
find
(
const
type_info & ti) {
49
#ifndef THEPEG_DYNAMIC_TYPE_INFO_BUG
50
DescriptionMap::const_iterator it =
descriptionMap
().find(&ti);
51
#else
52
DescriptionMap::const_iterator it =
descriptionMap
().find(ti.name());
53
#endif
54
if
( it ==
descriptionMap
().end() )
return
0;
55
return
(*it).second;
56
}
57
61
static
string
className
(
const
type_info & ti);
62
66
static
int
version
(
const
type_info & ti);
67
72
static
string
library
(
const
type_info & ti);
73
77
static
inline
const
ClassDescriptionBase
*
find
(
const
string
& name) {
78
StringMap::const_iterator it =
stringMap
().find(name);
79
if
( it ==
stringMap
().end() )
return
0;
80
return
it->second;
81
}
82
87
static
inline
const
DescriptionMap
&
all
() {
return
descriptionMap
(); }
88
93
static
void
printHierarchies
(ostream & os);
94
95
protected
:
96
100
static
void
hookup
();
101
105
static
void
insert
(
ClassDescriptionBase
& pb);
106
112
static
DescriptionMap
&
descriptionMap
();
113
119
static
StringMap
&
stringMap
();
120
121
};
122
123
}
124
125
#endif
/* ThePEG_DescriptionList_H */
ThePEG.h
This is the main config header file for ThePEG.
ThePEG::ClassDescriptionBase
ClassDescriptionBase is the base class for all class description classes.
Definition:
ClassDescription.h:63
ThePEG::DescriptionList
The DescriptionList keeps a static list of descriptions of classes included in the current run.
Definition:
DescriptionList.h:22
ThePEG::DescriptionList::insert
static void insert(ClassDescriptionBase &pb)
Insert a class description.
ThePEG::DescriptionList::library
static string library(const type_info &ti)
Return the dynamic library of the class corresponding to the given type_info object.
ThePEG::DescriptionList::hookup
static void hookup()
Hookup the base class descriptions in the list.
ThePEG::DescriptionList::find
static const ClassDescriptionBase * find(const type_info &ti)
Get the description of a class giving its type_info object.
Definition:
DescriptionList.h:48
ThePEG::DescriptionList::StringMap
map< string, ClassDescriptionBase * > StringMap
Map of class descriptions indexed by platform-independent class names.
Definition:
DescriptionList.h:36
ThePEG::DescriptionList::stringMap
static StringMap & stringMap()
Return the static set of descriptions mapped to the corresponding class names.
ThePEG::DescriptionList::version
static int version(const type_info &ti)
Return the version of the class corresponding to the given type_info object.
ThePEG::DescriptionList::className
static string className(const type_info &ti)
Return the name of the class corresponding to the given type_info object.
ThePEG::DescriptionList::DescriptionMap
map< const type_info *, ClassDescriptionBase * > DescriptionMap
Map of class descriptions indexed by type_info objects.
Definition:
DescriptionList.h:28
ThePEG::DescriptionList::find
static const ClassDescriptionBase * find(const string &name)
Get the description of a class giving its name.
Definition:
DescriptionList.h:77
ThePEG::DescriptionList::printHierarchies
static void printHierarchies(ostream &os)
Print the classes in the list and their base classes to a stream.
ThePEG::DescriptionList::Register
static void Register(ClassDescriptionBase &)
Insert a description in the list.
ThePEG::DescriptionList::all
static const DescriptionMap & all()
Return the static set of descriptions mapped to the relevant type_info objects.
Definition:
DescriptionList.h:87
ThePEG::DescriptionList::descriptionMap
static DescriptionMap & descriptionMap()
Return the static set of descriptions mapped to the relevant type_info objects.
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
Generated on Thu Jun 20 2024 14:47:02 for ThePEG by
1.9.6