ATLAS Offline Software
AthDictLoaderSvc.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // AthDictLoaderSvc.h
8 // Header file for class AthDictLoaderSvc
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef ATHENASERVICES_ATHDICTLOADERSVC_H
12 #define ATHENASERVICES_ATHDICTLOADERSVC_H 1
13 
14 // STL includes
15 #include <string>
16 
17 // FrameWork includes
18 #include "GaudiKernel/IClassIDSvc.h"
19 #include "GaudiKernel/ClassID.h"
20 #include "GaudiKernel/ServiceHandle.h"
22 
23 // the Type type
24 #include "DataModelRoot/RootType.h"
25 
26 // AthenaKernel
28 #include "AthenaKernel/DsoDb.h"
29 
30 // Forward declaration
31 class ITPCnvSvc;
32 class ISvcLocator;
33 template <class TYPE> class SvcFactory;
34 
36  : virtual public ::IDictLoaderSvc,
37  public ::AthService
38 {
39  friend class SvcFactory<AthDictLoaderSvc>;
40 
42  // Public methods:
44  public:
45 
46  // Copy constructor:
47 
49  AthDictLoaderSvc( const std::string& name, ISvcLocator* pSvcLocator );
50 
52  virtual ~AthDictLoaderSvc();
53 
54  // Assignment operator:
55  //AthDictLoaderSvc &operator=(const AthDictLoaderSvc &alg);
56 
58 
59  virtual StatusCode initialize() override;
60  virtual StatusCode finalize() override;
61  virtual StatusCode queryInterface( const InterfaceID& riid,
62  void** ppvInterface ) override;
64 
65  static const InterfaceID& interfaceID();
66 
69  virtual
70  bool has_type (const std::string& type_name) override;
71 
74  virtual
75  bool has_type (const std::type_info& typeinfo) override;
76 
79  virtual
80  bool has_type (CLID clid) override;
81 
86  virtual
87  const RootType load_type (const std::string& type_name, bool recursive = false) override;
88 
95  virtual
96  const RootType load_type (const std::type_info& typeinfo, bool recursive = false) override;
97 
102  virtual
103  const RootType load_type (CLID clid, bool recursive = false) override;
104 
106  // Private data:
108  private:
109 
112 
113  // Containers
114 
118 
122 
124 
125  void load_recursive (const RootType& typ);
126  using Memo_t = std::unordered_set<std::string>;
127  void load_recursive1 (const std::string& tnam, Memo_t& memo);
128  void load_recursive1 (const RootType& typ, Memo_t& memo);
129 };
130 
132 // Inline methods:
134 
135 inline
136 const InterfaceID&
138 {
139  return IDictLoaderSvc::interfaceID();
140 }
141 
142 
143 
144 #endif //> !ATHENASERVICES_ATHDICTLOADERSVC_H
AthDictLoaderSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: AthDictLoaderSvc.h:137
Ath::DsoDb
helper class to query rootmap files and extract their content
Definition: DsoDb.h:31
AthDictLoaderSvc::m_tpCnvSvc
ServiceHandle< ITPCnvSvc > m_tpCnvSvc
Definition: AthDictLoaderSvc.h:123
AthDictLoaderSvc::Memo_t
std::unordered_set< std::string > Memo_t
Definition: AthDictLoaderSvc.h:126
IDictLoaderSvc
Definition: IDictLoaderSvc.h:37
SvcFactory
Definition: AthCnvSvc.h:28
AthDictLoaderSvc::~AthDictLoaderSvc
virtual ~AthDictLoaderSvc()
Destructor:
Definition: AthDictLoaderSvc.cxx:49
AthDictLoaderSvc::load_recursive
void load_recursive(const RootType &typ)
Definition: AthDictLoaderSvc.cxx:222
AthDictLoaderSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface) override
Definition: AthDictLoaderSvc.cxx:82
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
AthDictLoaderSvc::AthDictLoaderSvc
AthDictLoaderSvc()
Default constructor:
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
DsoDb.h
AthDictLoaderSvc::m_dsodb
const Ath::DsoDb * m_dsodb
dictionary of all known (reflex) types
Definition: AthDictLoaderSvc.h:117
IDictLoaderSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: IDictLoaderSvc.h:99
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AthDictLoaderSvc::m_clidSvc
ServiceHandle< IClassIDSvc > m_clidSvc
handle to a IClassIDSvc to handle loading of types by CLID
Definition: AthDictLoaderSvc.h:121
AthDictLoaderSvc::finalize
virtual StatusCode finalize() override
Definition: AthDictLoaderSvc.cxx:70
AthDictLoaderSvc
Definition: AthDictLoaderSvc.h:38
IDictLoaderSvc.h
AthDictLoaderSvc::load_recursive1
void load_recursive1(const std::string &tnam, Memo_t &memo)
Definition: AthDictLoaderSvc.cxx:229
RootType.h
AthService.h
AthDictLoaderSvc::load_type
virtual const RootType load_type(const std::string &type_name, bool recursive=false) override
retrieve a Reflex::Type by name (auto)loading the dictionary by any necessary means.
Definition: AthDictLoaderSvc.cxx:148
ITPCnvSvc
Definition: ITPCnvSvc.h:29
generateReferenceFile.recursive
recursive
Definition: generateReferenceFile.py:12
AthDictLoaderSvc::has_type
virtual bool has_type(const std::string &type_name) override
check a Reflex dictionary exists for a given type
Definition: AthDictLoaderSvc.cxx:97
ServiceHandle< IClassIDSvc >
TScopeAdapter
Definition: RootType.h:119
AthDictLoaderSvc::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition: AthDictLoaderSvc.cxx:54