ATLAS Offline Software
Public Types | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
ClassID_traits< ViewVector< DV > > Struct Template Reference

ClassID_traits specialization for ViewVector. More...

#include <ViewVector.h>

Collaboration diagram for ClassID_traits< ViewVector< DV > >:

Public Types

typedef std::integral_constant< bool, s_isDataObjectis_DataObject_tag
 
typedef std::true_type has_classID_tag
 
typedef std::false_type has_version_tag
 

Static Public Member Functions

static const CLIDID ()
 
static const char * typeNameString ()
 
static const std::string & typeName ()
 
static const std::type_info & typeInfo ()
 
static bool init (CLID clid, const char *name)
 

Static Public Attributes

static const bool s_isDataObject = false
 
static const bool s_isConst = false
 

Static Private Attributes

static std::atomic< CLIDs_clid { CLID_NULL }
 
static std::atomic< const char * > s_name { nullptr }
 

Detailed Description

template<class DV>
struct ClassID_traits< ViewVector< DV > >

ClassID_traits specialization for ViewVector.

We want to allow SG operations on a ViewVector even when the CLASS_DEF for the ViewVector isn't present in the compilation unit doing the record. For example, we may have some piece of code templated on a DataVector class DV that creates a ViewVector<DV> and records it. When this is used, the header defining should be included, but the one defining ViewVector<DV> may not be. But we'd like the record to work anyway.

So, for ViewVector, we use this specialization of ClassID_traits. It stores the CLID and the name (which recall will usually be a typedef name, so we can't get it from the DV template argument) as static class members. We define a macro VIEWVECTOR_CLASS_DEF which then sets these class statics during global initialization.

Definition at line 298 of file ViewVector.h.

Member Typedef Documentation

◆ has_classID_tag

template<class DV >
typedef std::true_type ClassID_traits< ViewVector< DV > >::has_classID_tag

Definition at line 302 of file ViewVector.h.

◆ has_version_tag

template<class DV >
typedef std::false_type ClassID_traits< ViewVector< DV > >::has_version_tag

Definition at line 321 of file ViewVector.h.

◆ is_DataObject_tag

template<class DV >
typedef std::integral_constant<bool, s_isDataObject> ClassID_traits< ViewVector< DV > >::is_DataObject_tag

Definition at line 301 of file ViewVector.h.

Member Function Documentation

◆ ID()

template<class DV >
static const CLID& ClassID_traits< ViewVector< DV > >::ID ( )
inlinestatic

Definition at line 304 of file ViewVector.h.

304  {
305  if (s_clid == CLID_NULL)
307  static const CLID clid = s_clid;
308  return clid;
309  }

◆ init()

template<class DV >
static bool ClassID_traits< ViewVector< DV > >::init ( CLID  clid,
const char *  name 
)
inlinestatic

Definition at line 324 of file ViewVector.h.

325  {
326  if (s_clid == CLID_NULL) {
327  s_clid = clid;
328  s_name = name;
329  }
330  return true;
331  }

◆ typeInfo()

template<class DV >
static const std::type_info& ClassID_traits< ViewVector< DV > >::typeInfo ( )
inlinestatic

Definition at line 318 of file ViewVector.h.

318  {
319  return typeid (ViewVector<DV>);
320  }

◆ typeName()

template<class DV >
static const std::string& ClassID_traits< ViewVector< DV > >::typeName ( )
inlinestatic

Definition at line 315 of file ViewVector.h.

315  {
316  static const std::string name = typeNameString(); return name;
317  }

◆ typeNameString()

template<class DV >
static const char* ClassID_traits< ViewVector< DV > >::typeNameString ( )
inlinestatic

Definition at line 310 of file ViewVector.h.

310  {
311  if (s_name == nullptr)
313  return s_name;
314  }

Member Data Documentation

◆ s_clid

template<class DV >
std::atomic< CLID > ClassID_traits< ViewVector< DV > >::s_clid { CLID_NULL }
staticprivate

Definition at line 333 of file ViewVector.h.

◆ s_isConst

template<class DV >
const bool ClassID_traits< ViewVector< DV > >::s_isConst = false
static

Definition at line 322 of file ViewVector.h.

◆ s_isDataObject

template<class DV >
const bool ClassID_traits< ViewVector< DV > >::s_isDataObject = false
static

Definition at line 300 of file ViewVector.h.

◆ s_name

template<class DV >
std::atomic< const char * > ClassID_traits< ViewVector< DV > >::s_name { nullptr }
staticprivate

Definition at line 334 of file ViewVector.h.


The documentation for this struct was generated from the following file:
ClassID_traits< ViewVector< DV > >::s_clid
static std::atomic< CLID > s_clid
Definition: ViewVector.h:333
ClassID_traits< ViewVector< DV > >::typeNameString
static const char * typeNameString()
Definition: ViewVector.h:310
ViewVector
Identify view containers to be made persistent.
Definition: ViewVector.h:67
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ClassID_traits< ViewVector< DV > >::s_name
static std::atomic< const char * > s_name
Definition: ViewVector.h:334
SG::throwExcMissingViewVectorCLID
void throwExcMissingViewVectorCLID(const std::type_info &ti)
Throw a SG::ExcMissingViewVectorCLID exception.
Definition: Control/AthContainers/Root/exceptions.cxx:425
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195