thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Utilities
TypeInfo.h
1
// -*- C++ -*-
2
//
3
// TypeInfo.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_TypeInfo_H
10
#define ThePEG_TypeInfo_H
11
12
#include "DescriptionList.h"
13
14
namespace
ThePEG
{
15
19
struct
TypeInfo
{
20
22
template
<
typename
T>
23
static
string
name
(
const
T &)
24
{
25
const
ClassDescriptionBase
* cd =
DescriptionList::find
(
typeid
(T));
26
if
( cd )
return
cd->
name
();
27
return
"**** CLASS NOT REGISTERED ****"
;
28
}
29
31
template
<
typename
T>
32
static
int
version
(
const
T &)
33
{
34
const
ClassDescriptionBase
* cd =
DescriptionList::find
(
typeid
(T));
35
if
( cd )
return
cd->
version
();
36
return
-1;
37
}
38
39
};
40
41
}
42
43
#endif
/* ThePEG_TypeInfo_H */
ThePEG::ClassDescriptionBase
ClassDescriptionBase is the base class for all class description classes.
Definition:
ClassDescription.h:63
ThePEG::ClassDescriptionBase::version
int version() const
The version of the described class.
Definition:
ClassDescription.h:104
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::Named::name
const string & name() const
Return name.
Definition:
Named.h:42
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::TypeInfo
TypeInfo is a simple wrapper around the ClassDescription system in ThePEG.
Definition:
TypeInfo.h:19
ThePEG::TypeInfo::version
static int version(const T &)
Return the version number of the class of the given object.
Definition:
TypeInfo.h:32
ThePEG::TypeInfo::name
static string name(const T &)
Return the name of the class of the given object.
Definition:
TypeInfo.h:23
Generated on Thu Jun 20 2024 14:47:02 for ThePEG by
1.9.6