ATLAS Offline Software
Event/xAOD/xAODCore/xAODCore/CLASS_DEF.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: CLASS_DEF.h 613558 2014-08-26 17:16:16Z krasznaa $
8 #ifndef XAODCORE_CLASS_DEF_H
9 #define XAODCORE_CLASS_DEF_H
10 
35 
36 #ifdef XAOD_STANDALONE
37 
38 // Include the ClassID_traits class:
40 
41 // Present a dummy macro to ROOT 6's dictionary generator. Otherwise
42 // it becomes over-eager, and starts generating dictionaries for types
43 // that it should just ignore.
44 #ifdef __CLING__
45 
47 #define CLASS_DEF( __type, __clid, __version )
48 
49 #else // __CLING__
50 
52 #define CLASS_DEF( __type, __clid, __version ) \
53  template<> \
54  struct ClassID_traits< __type > { \
55  static CLID ID() { \
56  return __clid; \
57  } \
58  static const std::string& typeName() { \
59  static std::string name( #__type ); \
60  return name; \
61  } \
62  static const std::type_info& typeId() { \
63  return typeid( __type ); \
64  } \
65  };
66 
67 #endif // __CLING__
68 
69 #else // not XAOD_STANDALONE
70 
71 // Pull in the proper macro definition
72 #include "AthenaKernel/CLASS_DEF.h"
73 
74 #endif // not XAOD_STANDALONE
75 #endif // not XAODCORE_CLASS_DEF_H
ClassID_traits.h
File providing the ClassID_traits traits class.
CLASS_DEF.h
macros to associate a CLID to a type