ATLAS Offline Software
RootCnvSvc.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 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: public extends<::AthCnvSvc, ::IAthenaRootCnvSvc> {
36 
37 public:
38 
40  RootCnvSvc(const std::string& name, ISvcLocator* pSvcLocator);
41 
45 
47  StatusCode connectOutput(const std::string& file);
48 
50  StatusCode connectOutput(const std::string& file, const std::string& mode);
51 
53  StatusCode commitOutput(const std::string& output, bool do_commit);
54 
57  StatusCode createAddress(long svc_type,
58  const CLID& clid,
59  const std::string* par,
60  const unsigned long* ip,
61  IOpaqueAddress*& refpAddress);
62 
64  StatusCode convertAddress(const IOpaqueAddress* pAddress, std::string& refAddress);
65 
67  StatusCode createAddress(long svc_type,
68  const CLID& clid,
69  const std::string& refAddress,
70  IOpaqueAddress*& refpAddress);
71 
73  StatusCode updateServiceState(IOpaqueAddress* pAddress);
74 
75 protected:
78  RootType getType(const CLID& clid) const;
79  RootType getType(const std::type_info& type) const;
80 
82  const Token* writeObject(const std::string& key,
83  const RootType& typeDesc,
84  const void* pObj,
85  ITPCnvBase* tpConverter = 0);
87 
89  ITPCnvBase* getTPConverter(const CLID& clid) const;
90 
92  IConverter* createConverter(long typ, const CLID& clid, const ICnvFactory* fac);
93 
94 private:
96  RootCnvSvc(); //< not implemented
97  RootCnvSvc(const RootCnvSvc&); //< not implemented
98  RootCnvSvc& operator=(const RootCnvSvc&); //< not implemented
99 
100 private:
107 
109  std::string m_treeName;
110 };
111 
112 } //> end namespace Athena
113 
114 #endif /* !ATHENAROOTCOMPS_ROOTCNVSVC_H */
Athena::RootCnvSvc::m_rootSvc
ServiceHandle< ::IRootSvc > m_rootSvc
ServiceHandle to the root service.
Definition: RootCnvSvc.h:106
Athena::RootCnvSvc::m_dictSvc
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
Definition: RootCnvSvc.h:102
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:87
ITPCnvSvc.h
Athena::RootCnvSvc::connectOutput
StatusCode connectOutput(const std::string &file)
Connect the output file to the service.
Definition: RootCnvSvc.cxx:78
Athena::RootCnvSvc::operator=
RootCnvSvc & operator=(const RootCnvSvc &)
AthCnvSvc.h
Athena::RootCnvSvc::getType
RootType getType(const CLID &clid) const
Definition: RootCnvSvc.cxx:127
Athena::RootCnvSvc::RootCnvSvc
RootCnvSvc()
Default constructor:
Athena::RootCnvSvc::getTPConverter
ITPCnvBase * getTPConverter(const CLID &clid) const
Get T/P converter for a transient class.
Definition: RootCnvSvc.cxx:155
Athena::RootCnvSvc::updateServiceState
StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
Definition: RootCnvSvc.cxx:120
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:83
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:102
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:136
file
TFile * file
Definition: tile_monitor.h:29
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
Preparation.mode
mode
Definition: Preparation.py:94
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
merge.output
output
Definition: merge.py:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
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:161
Athena::RootCnvSvc::initialize
StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: RootCnvSvc.cxx:39
Athena::RootCnvSvc::RootCnvSvc
RootCnvSvc(const RootCnvSvc &)
IDictLoaderSvc.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:109
Athena::RootCnvSvc::m_tpCnvSvc
ServiceHandle< ::ITPCnvSvc > m_tpCnvSvc
ServiceHandle to the T/P conversion service.
Definition: RootCnvSvc.h:104
Athena::RootCnvSvc::finalize
StatusCode finalize()
Definition: RootCnvSvc.cxx:54
IRootSvc
This class provides the interface to the ROOT software.
Definition: IRootSvc.h:32
ServiceHandle
Definition: ClusterMakerTool.h:37
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TScopeAdapter
Definition: RootType.h:119