5#ifndef ATHENAKERNEL_CLASS_DEF_H
6#define ATHENAKERNEL_CLASS_DEF_H
17#include "GaudiKernel/DataObject.h"
20# define CLIDREGISTRY_ADDENTRY(CID, NAME) \
23 const bool clidEntry_ ## CID = \
24 CLIDRegistry::addEntry(CID, typeid(NAME), \
25 ClassID_traits< NAME >::typeNameString(), \
26 ClassName< NAME >::name()); \
28# define CLIDREGISTRY_ADDENTRY2(CID, ARG1, ARG2) \
31 const bool clidEntry_ ## CID = \
32 CLIDRegistry::addEntry \
33 (CID, typeid(ARG1,ARG2), \
34 ClassID_traits< ARG1,ARG2 >::typeNameString(), \
35 ClassName< ARG1,ARG2 >::name()); \
38# define CLIDREGISTRY_ADDENTRY(CID, NAME) \
41 const bool clidEntry_ ## CID = \
42 CLIDRegistry::addEntry<CID>(typeid(NAME), \
43 ClassID_traits< NAME >::typeNameString(), \
44 ClassName< NAME >::name()); \
46# define CLIDREGISTRY_ADDENTRY2(CID, ARG1, ARG2) \
49 const bool clidEntry_ ## CID = \
50 CLIDRegistry::addEntry<CID> \
52 ClassID_traits< ARG1,ARG2 >::typeNameString(), \
53 ClassName< ARG1,ARG2 >::name()); \
67#define CLASS_DEF(NAME, CID , VERSION) \
69 struct ClassID_traits< NAME > { \
70 typedef std::is_base_of<DataObject, NAME> isDObj_t; \
71 static const bool s_isDataObject = isDObj_t::value; \
72 typedef std::true_type has_classID_tag; \
73 static const CLID& ID ATLAS_CHECK_THREAD_SAFETY () { static const CLID c(CID); return c; } \
74 static const char* typeNameString ATLAS_CHECK_THREAD_SAFETY () { \
77 static const std::string& typeName ATLAS_CHECK_THREAD_SAFETY () { \
78 static const std::string name = typeNameString(); \
81 static const std::type_info& typeInfo() { \
82 return typeid (NAME); \
84 typedef std::true_type has_version_tag; \
85 static const int s_version = VERSION; \
86 static const bool s_isConst = false; \
88 CLIDREGISTRY_ADDENTRY(CID, NAME)
102#define CLASS_DEF2(ARG1, ARG2, CID , VERSION) \
104 struct ClassID_traits< ARG1,ARG2 > { \
105 typedef std::is_base_of<DataObject, ARG1, ARG2 > isDObj_t; \
106 static const bool s_isDataObject = isDObj_t::value; \
107 typedef std::true_type has_classID_tag; \
108 static const CLID& ID ATLAS_CHECK_THREAD_SAFETY () { \
109 static const CLID c(CID); return c; \
111 static const char* typeNameString ATLAS_CHECK_THREAD_SAFETY () { \
112 return #ARG1 "," #ARG2; \
114 static const std::string& typeName ATLAS_CHECK_THREAD_SAFETY () { \
115 static const std::string name = typeNameString(); \
118 static const std::type_info& typeInfo() { \
119 return typeid (ARG1,ARG2); \
121 typedef std::true_type has_version_tag; \
122 static const int s_version = VERSION; \
123 static const bool s_isConst = false; \
125 CLIDREGISTRY_ADDENTRY2(CID, ARG1, ARG2)
An interface for getting the name of a class as a string.
a static registry of CLID->typeName entries.
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Define macros for attributes used to control the static checker.