ATLAS Offline Software
Loading...
Searching...
No Matches
RootSvc.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5*/
6
7// RootSvc.h
8// Header file for class Athena::RootSvc
9// Author: Peter van Gemmeren <gemmeren@anl.gov>
11#ifndef ATHENAROOTCOMPS_ROOTSVC_H
12#define ATHENAROOTCOMPS_ROOTSVC_H 1
13
18
19// AthenaRootKernel includes
21
22// fwk includes
23#include "GaudiKernel/ServiceHandle.h"
24#include "GaudiKernel/SmartIF.h"
25#include "GaudiUtils/IFileCatalog.h"
26#include "GaudiUtils/IFileCatalogMgr.h"
27
30
31#include <map>
32
33// fwd declares
34class IDictLoaderSvc;
35class Placement;
36namespace Athena { class RootConnection; }
37
38namespace Athena {
42class RootSvc : public extends<::AthService, ::IRootSvc> {
43
44public:
46 RootSvc(const std::string& name, ISvcLocator* pSvcLocator);
47
49 StatusCode initialize();
50 StatusCode finalize();
51
54 RootType getType(const std::type_info& type) const;
55
57 void* readObject(const Token& token, void*& pObj);
58
60 const Token* writeObject(const Placement& placement, const RootType& type, const void* pObj);
61
63 void* createObject(const RootType& type) const;
64
66 void destructObject(const RootType& type, void* pObj) const;
68
70 StatusCode open(const std::string& fname, const std::string& mode);
71
73 StatusCode connect(const std::string& fname);
74
76 StatusCode commitOutput();
77
79 StatusCode disconnect(const std::string& fname);
80
83 Athena::RootConnection* connection(const std::string& fname);
84
86 virtual ~RootSvc();
87
88private:
90 RootSvc(); //< not implemented
91 RootSvc(const RootSvc&); //< not implemented
92 RootSvc& operator=(const RootSvc&); //< not implemented
93
94private:
95 SmartIF<Gaudi::IFileCatalogMgr> m_gCatalogMgr;
96 SmartIF<Gaudi::IFileCatalog> m_gCatalog;
97
98 typedef std::map<Guid, Athena::RootConnection*> ConnMap_t;
102
105};
106
107}//> namespace Athena
108
109#endif /* !ATHENAROOTCOMPS_ROOTSVC_H */
This file contains the class definition for the Guid class (migrated from POOL).
This file contains the class definition for the IRootSvc interface class.
TTypeAdapter RootType
Definition RootType.h:211
This class provides the implementation of Athena::RootConnection class, similar to Gaudi IDataConnect...
RootSvc(const RootSvc &)
RootSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
Definition RootSvc.cxx:24
SmartIF< Gaudi::IFileCatalog > m_gCatalog
Definition RootSvc.h:96
StatusCode initialize()
Gaudi Service Interface method implementations:
Definition RootSvc.cxx:40
std::map< Guid, Athena::RootConnection * > ConnMap_t
Definition RootSvc.h:98
StatusCode open(const std::string &fname, const std::string &mode)
Open the file fname with open mode mode.
Definition RootSvc.cxx:108
ConnMap_t m_conns
Map of file name keys and connection values.
Definition RootSvc.h:100
RootType getType(const std::type_info &type) const
Load the type (dictionary) from Root.
Definition RootSvc.cxx:69
void destructObject(const RootType &type, void *pObj) const
Destruct a given object of type RootType.
Definition RootSvc.cxx:104
StatusCode disconnect(const std::string &fname)
Disconnect the file fname from the service.
Definition RootSvc.cxx:163
void * readObject(const Token &token, void *&pObj)
Read object from Root.
Definition RootSvc.cxx:74
const Token * writeObject(const Placement &placement, const RootType &type, const void *pObj)
Write object of a given class to Root.
Definition RootSvc.cxx:79
RootSvc & operator=(const RootSvc &)
StatusCode connect(const std::string &fname)
Connect the file fname to the service.
Definition RootSvc.cxx:134
Athena::RootConnection * m_wconn
Definition RootSvc.h:101
StatusCode commitOutput()
Commit data and flush buffer.
Definition RootSvc.cxx:149
Athena::RootConnection * connection(const std::string &fname)
Get the RootConnection associated with file fname.
Definition RootSvc.cxx:182
void * createObject(const RootType &type) const
Create an object of a given RootType.
Definition RootSvc.cxx:98
RootSvc()
Default constructor:
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
Definition RootSvc.h:104
virtual ~RootSvc()
Destructor.
Definition RootSvc.cxx:33
SmartIF< Gaudi::IFileCatalogMgr > m_gCatalogMgr
Definition RootSvc.h:95
StatusCode finalize()
Definition RootSvc.cxx:58
a simple interface to interact with the Reflex dictionaries and abstract/workaround a few ROOT bugs.
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition Placement.h:20
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:22
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
Definition AthDsoUtils.h:10