ATLAS Offline Software
Macros
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h File Reference

macros to associate a CLID to a type More...

#include "AthenaKernel/ClassID_traits.h"
#include "CxxUtils/checker_macros.h"
Include dependency graph for Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:

Go to the source code of this file.

Macros

#define CLIDREGISTRY_ADDENTRY(CID, NAME)
 
#define CLIDREGISTRY_ADDENTRY2(CID, ARG1, ARG2)
 
#define CLASS_DEF(NAME, CID, VERSION)
 associate a clid and a version to a type eg More...
 
#define CLASS_DEF2(ARG1, ARG2, CID, VERSION)
 hack to use instead of CLASS_DEF when type name contains a comma ',' eg More...
 

Detailed Description

macros to associate a CLID to a type

Author
Paolo Calafiura pcala.nosp@m.fiur.nosp@m.a@lbl.nosp@m..gov

Definition in file Control/AthenaKernel/AthenaKernel/CLASS_DEF.h.

Macro Definition Documentation

◆ CLASS_DEF

#define CLASS_DEF (   NAME,
  CID,
  VERSION 
)
Value:
template <> \
typedef std::is_base_of<DataObject, NAME> isDObj_t; \
static const bool s_isDataObject = isDObj_t::value; \
typedef std::integral_constant<bool, s_isDataObject> is_DataObject_tag; \
typedef std::true_type has_classID_tag; \
static const CLID& ID ATLAS_CHECK_THREAD_SAFETY () { static const CLID c(CID); return c; } \
static const char* typeNameString ATLAS_CHECK_THREAD_SAFETY () { \
return #NAME; \
} \
static const std::string& typeName ATLAS_CHECK_THREAD_SAFETY () { \
static const std::string name = typeNameString(); \
return name; \
} \
static const std::type_info& typeInfo() { \
return typeid (NAME); \
} \
typedef std::true_type has_version_tag; \
static const int s_version = VERSION; \
static const bool s_isConst = false; \
}; \
CLIDREGISTRY_ADDENTRY(CID, NAME)

associate a clid and a version to a type eg

CLASS_DEF(std::vector<Track*>,8901, 1)
Parameters
NAMEtype name
CIDclid
VERSIONnot yet used

Definition at line 65 of file Control/AthenaKernel/AthenaKernel/CLASS_DEF.h.

◆ CLASS_DEF2

#define CLASS_DEF2 (   ARG1,
  ARG2,
  CID,
  VERSION 
)
Value:
template <> \
typedef std::is_base_of<DataObject, ARG1, ARG2 > isDObj_t; \
static const bool s_isDataObject = isDObj_t::value; \
typedef std::integral_constant<bool, s_isDataObject> is_DataObject_tag; \
typedef std::true_type has_classID_tag; \
static const CLID& ID ATLAS_CHECK_THREAD_SAFETY () { \
static const CLID c(CID); return c; \
} \
static const char* typeNameString ATLAS_CHECK_THREAD_SAFETY () { \
return #ARG1 "," #ARG2; \
} \
static const std::string& typeName ATLAS_CHECK_THREAD_SAFETY () { \
static const std::string name = typeNameString(); \
return name; \
} \
static const std::type_info& typeInfo() { \
return typeid (ARG1,ARG2); \
} \
typedef std::true_type has_version_tag; \
static const int s_version = VERSION; \
static const bool s_isConst = false; \
}; \
CLIDREGISTRY_ADDENTRY2(CID, ARG1, ARG2)

hack to use instead of CLASS_DEF when type name contains a comma ',' eg

CLASS_DEF2(map<int,string>,8900, 1)
Parameters
ARG1type name (1st part)
ARG2type name (2nd part)
CIDclid
VERSIONnot yet used

Definition at line 101 of file Control/AthenaKernel/AthenaKernel/CLASS_DEF.h.

◆ CLIDREGISTRY_ADDENTRY

#define CLIDREGISTRY_ADDENTRY (   CID,
  NAME 
)
Value:
namespace detail { \
[[maybe_unused]] \
const bool clidEntry_ ## CID = \
CLIDRegistry::addEntry<CID>(typeid(NAME), \
}

Definition at line 36 of file Control/AthenaKernel/AthenaKernel/CLASS_DEF.h.

◆ CLIDREGISTRY_ADDENTRY2

#define CLIDREGISTRY_ADDENTRY2 (   CID,
  ARG1,
  ARG2 
)
Value:
namespace detail { \
[[maybe_unused]] \
const bool clidEntry_ ## CID = \
CLIDRegistry::addEntry<CID> \
(typeid(ARG1,ARG2), \
}

Definition at line 44 of file Control/AthenaKernel/AthenaKernel/CLASS_DEF.h.

CLASS_DEF2
#define CLASS_DEF2(ARG1, ARG2, CID, VERSION)
hack to use instead of CLASS_DEF when type name contains a comma ',' eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:100
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
athena.value
value
Definition: athena.py:122
detail
Definition: extract_histogram_tag.cxx:14
python.DQWebDisplayMod.VERSION
string VERSION
libDataQualityUtils is loaded by handi
Definition: DQWebDisplayMod.py:35
ClassName
An interface for getting the name of a class as a string.
Definition: AthenaKernel/AthenaKernel/ClassName.h:33
ClassName::name
static std::string name()
Return the name of class T as a string.
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ATLAS_CHECK_THREAD_SAFETY
#define ATLAS_CHECK_THREAD_SAFETY
Definition: checker_macros.h:210
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
python.compressB64.c
def c
Definition: compressB64.py:93