ATLAS Offline Software
RootCnvSvc.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // RootCnvSvc.h
8 // Header file for class Athena::RootCnvSvc
9 // Author: Peter van Gemmeren <gemmeren@anl.gov>
11 #ifndef ATHENAROOTCOMPS_ROOTCNVSVC_H
12 #define ATHENAROOTCOMPS_ROOTCNVSVC_H 1
13 
19 // AthenaRootKernel includes
21 
22 // fwk includes
23 #include "GaudiKernel/ServiceHandle.h"
26 #include "AthenaKernel/ITPCnvSvc.h"
27 
28 // fwd declares
29 class IRootSvc;
30 
31 namespace Athena {
35 class RootCnvSvc: virtual public ::IAthenaRootCnvSvc, public ::AthCnvSvc {
36  friend class SvcFactory<Athena::RootCnvSvc>;
37 
38 public:
40  RootCnvSvc(const std::string& name, ISvcLocator* pSvcLocator);
41 
45  StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
46 
48  StatusCode connectOutput(const std::string& file);
49 
51  StatusCode connectOutput(const std::string& file, const std::string& mode);
52 
54  StatusCode commitOutput(const std::string& output, bool do_commit);
55 
58  StatusCode createAddress(long svc_type,
59  const CLID& clid,
60  const std::string* par,
61  const unsigned long* ip,
62  IOpaqueAddress*& refpAddress);
63 
65  StatusCode convertAddress(const IOpaqueAddress* pAddress, std::string& refAddress);
66 
68  StatusCode createAddress(long svc_type,
69  const CLID& clid,
70  const std::string& refAddress,
71  IOpaqueAddress*& refpAddress);
72 
74  StatusCode updateServiceState(IOpaqueAddress* pAddress);
75 
76 protected:
79  RootType getType(const CLID& clid) const;
80  RootType getType(const std::type_info& type) const;
81 
83  const Token* writeObject(const std::string& key,
84  const RootType& typeDesc,
85  const void* pObj,
86  ITPCnvBase* tpConverter = 0);
88 
90  ITPCnvBase* getTPConverter(const CLID& clid) const;
91 
93  IConverter* createConverter(long typ, const CLID& clid, const ICnvFactory* fac);
94 
95 private:
97  RootCnvSvc(); //< not implemented
98  RootCnvSvc(const RootCnvSvc&); //< not implemented
99  RootCnvSvc& operator=(const RootCnvSvc&); //< not implemented
100 
101 private:
103  ServiceHandle< ::IDictLoaderSvc> m_dictSvc;
105  ServiceHandle< ::ITPCnvSvc> m_tpCnvSvc;
107  ServiceHandle< ::IRootSvc> m_rootSvc;
108 
110  std::string m_treeName;
111 };
112 
113 } //> end namespace Athena
114 
115 #endif /* !ATHENAROOTCOMPS_ROOTCNVSVC_H */
Athena::RootCnvSvc::m_rootSvc
ServiceHandle< ::IRootSvc > m_rootSvc
ServiceHandle to the root service.
Definition: RootCnvSvc.h:107
IAthenaRootCnvSvc
This class provides the interface between Athena and RootSvc.
Definition: IAthenaRootCnvSvc.h:30
Athena::RootCnvSvc::m_dictSvc
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
Definition: RootCnvSvc.h:103
Athena::RootCnvSvc::createAddress
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
Create a Generic address using explicit arguments to identify a single object.
Definition: RootCnvSvc.cxx:98
ITPCnvSvc.h
Athena::RootCnvSvc::connectOutput
StatusCode connectOutput(const std::string &file)
Connect the output file to the service.
Definition: RootCnvSvc.cxx:89
SvcFactory
Definition: AthCnvSvc.h:28
AthCnvSvc.h
Athena::RootCnvSvc::getType
RootType getType(const CLID &clid) const
Definition: RootCnvSvc.cxx:138
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Athena::RootCnvSvc::getTPConverter
ITPCnvBase * getTPConverter(const CLID &clid) const
Get T/P converter for a transient class.
Definition: RootCnvSvc.cxx:166
Athena::RootCnvSvc::updateServiceState
StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
Definition: RootCnvSvc.cxx:131
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
Athena::RootCnvSvc::commitOutput
StatusCode commitOutput(const std::string &output, bool do_commit)
Commit pending output.
Definition: RootCnvSvc.cxx:94
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Athena::RootCnvSvc::convertAddress
StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress)
Convert an address to string form.
Definition: RootCnvSvc.cxx:113
Athena::RootCnvSvc::writeObject
const Token * writeObject(const std::string &key, const RootType &typeDesc, const void *pObj, ITPCnvBase *tpConverter=0)
Write object of a given class to Root, using optional T/P converter.
Definition: RootCnvSvc.cxx:147
Athena::RootCnvSvc::queryInterface
StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Definition: RootCnvSvc.cxx:58
Athena::RootCnvSvc
This class provides the interface between Athena and RootSvc.
Definition: RootCnvSvc.h:35
ITPCnvBase
Definition: ITPCnvBase.h:24
Athena::RootCnvSvc::createConverter
IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new converter using factory.
Definition: RootCnvSvc.cxx:172
Athena::RootCnvSvc::initialize
StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: RootCnvSvc.cxx:39
IDictLoaderSvc.h
IAthenaRootCnvSvc.h
This file contains the class definition for the IAthenaRootCnvSvc interface class.
Athena::RootCnvSvc::m_treeName
std::string m_treeName
ROOT TTree name.
Definition: RootCnvSvc.h:110
Athena::RootCnvSvc::m_tpCnvSvc
ServiceHandle< ::ITPCnvSvc > m_tpCnvSvc
ServiceHandle to the T/P conversion service.
Definition: RootCnvSvc.h:105
Athena::RootCnvSvc::finalize
StatusCode finalize()
Definition: RootCnvSvc.cxx:54
AthCnvSvc
Definition: AthCnvSvc.h:67
IRootSvc
This class provides the interface to the ROOT software.
Definition: IRootSvc.h:32
ServiceHandle
Definition: ClusterMakerTool.h:37
TScopeAdapter
Definition: RootType.h:119