ATLAS Offline Software
Loading...
Searching...
No Matches
ClassID_traits< T > Struct Template Reference

This specialization is used for classes deriving from DataObject. More...

#include <ClassID_traits.h>

Collaboration diagram for ClassID_traits< T >:

Public Types

using has_version_tag = std::false_type
using has_classID_tag = std::false_type

Static Public Member Functions

static const CLIDID ()
 the CLID of T
static const std::string & typeName ()
 the demangled type name of T
static const std::type_info & typeInfo ()
 the type id of T
static const std::type_info & typeId ()
 Function returning a type identifier for the selected type.

Static Public Attributes

static const bool s_isDataObject = true
static const int s_version = 0
static const bool s_isConst = false

Detailed Description

template<typename T>
requires requires () { { T::classID() } -> std::convertible_to<CLID>; }
struct ClassID_traits< T >

This specialization is used for classes deriving from DataObject.

To avoid having a compile-time dependency on DataObject, we enable this based on whether or not T::classID() is defined.

Definition at line 71 of file Control/AthenaKernel/AthenaKernel/ClassID_traits.h.

Member Typedef Documentation

◆ has_classID_tag

template<typename T>
using ClassID_traits< T >::has_classID_tag = std::false_type

◆ has_version_tag

template<typename T>
using ClassID_traits< T >::has_version_tag = std::false_type

Member Function Documentation

◆ ID()

template<typename T>
const CLID & ClassID_traits< T >::ID ( )
inlinestatic

the CLID of T

Definition at line 75 of file Control/AthenaKernel/AthenaKernel/ClassID_traits.h.

75 {
76 return T::classID();
77 }
Default, invalid implementation of ClassID_traits.

◆ typeId()

const std::type_info & ClassID_traits< T >::typeId ( )
inlinestatic

Function returning a type identifier for the selected type.

Definition at line 77 of file Event/xAOD/xAODCore/xAODCore/ClassID_traits.h.

◆ typeInfo()

template<typename T>
const std::type_info & ClassID_traits< T >::typeInfo ( )
inlinestatic

the type id of T

Definition at line 86 of file Control/AthenaKernel/AthenaKernel/ClassID_traits.h.

86 {
87 return typeid(T);
88 }

◆ typeName()

template<typename T>
const std::string & ClassID_traits< T >::typeName ( )
inlinestatic

the demangled type name of T

Definition at line 80 of file Control/AthenaKernel/AthenaKernel/ClassID_traits.h.

80 {
81 static const std::string tname = Athena::typeinfoName(typeid(T));
82 return tname;
83 }
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.

Member Data Documentation

◆ s_isConst

template<typename T>
const bool ClassID_traits< T >::s_isConst = false
static

◆ s_isDataObject

template<typename T>
const bool ClassID_traits< T >::s_isDataObject = true
static

◆ s_version

template<typename T>
const int ClassID_traits< T >::s_version = 0
static

The documentation for this struct was generated from the following file: