ATLAS Offline Software
Loading...
Searching...
No Matches
RootCnvSvc.h
Go to the documentation of this file.
1
2
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
18
19// AthenaRootKernel includes
21
22// fwk includes
23#include "GaudiKernel/ServiceHandle.h"
27
28// fwd declares
29class IRootSvc;
30
31namespace Athena {
35class RootCnvSvc: public extends<::AthCnvSvc, ::IAthenaRootCnvSvc> {
36
37public:
38
40 RootCnvSvc(const std::string& name, ISvcLocator* pSvcLocator);
41
43 StatusCode initialize();
44 StatusCode finalize();
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
75protected:
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
94private:
96 RootCnvSvc(); //< not implemented
97 RootCnvSvc(const RootCnvSvc&); //< not implemented
98 RootCnvSvc& operator=(const RootCnvSvc&); //< not implemented
99
100private:
107
109 std::string m_treeName;
110};
111
112} //> end namespace Athena
113
114#endif /* !ATHENAROOTCOMPS_ROOTCNVSVC_H */
uint32_t CLID
The Class ID type.
This file contains the class definition for the IAthenaRootCnvSvc interface class.
TTypeAdapter RootType
Definition RootType.h:211
RootCnvSvc & operator=(const RootCnvSvc &)
ServiceHandle< ::ITPCnvSvc > m_tpCnvSvc
ServiceHandle to the T/P conversion service.
Definition RootCnvSvc.h:104
ITPCnvBase * getTPConverter(const CLID &clid) const
Get T/P converter for a transient class.
IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new converter using factory.
RootCnvSvc(const RootCnvSvc &)
RootCnvSvc()
Default constructor:
StatusCode commitOutput(const std::string &output, bool do_commit)
Commit pending output.
StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
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.
RootCnvSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
StatusCode finalize()
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
Definition RootCnvSvc.h:102
StatusCode connectOutput(const std::string &file)
Connect the output file to the service.
ServiceHandle< ::IRootSvc > m_rootSvc
ServiceHandle to the root service.
Definition RootCnvSvc.h:106
std::string m_treeName
ROOT TTree name.
Definition RootCnvSvc.h:109
RootType getType(const CLID &clid) const
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.
StatusCode initialize()
Gaudi Service Interface method implementations:
StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress)
Convert an address to string form.
This class provides the interface to the ROOT software.
Definition IRootSvc.h:32
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
TFile * file