ATLAS Offline Software
RootSvc.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 // 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 
19 // AthenaRootKernel includes
21 
22 // fwk includes
23 #include "GaudiKernel/ServiceHandle.h"
26 
27 #include <map>
28 
29 // fwd declares
30 class IDictLoaderSvc;
31 class Placement;
32 namespace pool { class IFileCatalog; }
33 namespace Athena { class RootConnection; }
34 
35 namespace Athena {
39 class RootSvc : public extends<::AthService, ::IRootSvc> {
40 
41 public:
43  RootSvc(const std::string& name, ISvcLocator* pSvcLocator);
44 
48 
51  RootType getType(const std::type_info& type) const;
52 
54  void* readObject(const Token& token, void*& pObj);
55 
57  const Token* writeObject(const Placement& placement, const RootType& type, const void* pObj);
58 
60  void* createObject(const RootType& type) const;
61 
63  void destructObject(const RootType& type, void* pObj) const;
65 
67  StatusCode open(const std::string& fname, const std::string& mode);
68 
70  StatusCode connect(const std::string& fname);
71 
74 
76  StatusCode disconnect(const std::string& fname);
77 
80  Athena::RootConnection* connection(const std::string& fname);
81 
83  virtual ~RootSvc();
84 
85 private:
87  RootSvc(); //< not implemented
88  RootSvc(const RootSvc&); //< not implemented
89  RootSvc& operator=(const RootSvc&); //< not implemented
90 
91 private:
93 
94  typedef std::map<Guid, Athena::RootConnection*> ConnMap_t;
98 
101 };
102 
103 }//> namespace Athena
104 
105 #endif /* !ATHENAROOTCOMPS_ROOTSVC_H */
Athena::RootConnection
This class provides the implementation of Athena::RootConnection class, similar to Gaudi IDataConnect...
Definition: RootConnection.h:36
Athena::RootSvc
This class provides the interface to the ROOT software.
Definition: RootSvc.h:39
Athena::RootSvc::initialize
StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: RootSvc.cxx:42
Placement
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition: Placement.h:19
Athena::RootSvc::m_dictSvc
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
Definition: RootSvc.h:100
Athena::RootSvc::m_catalog
pool::IFileCatalog * m_catalog
Definition: RootSvc.h:92
Athena::RootSvc::m_conns
ConnMap_t m_conns
Map of file name keys and connection values.
Definition: RootSvc.h:96
IDictLoaderSvc
Definition: IDictLoaderSvc.h:37
Athena::RootSvc::operator=
RootSvc & operator=(const RootSvc &)
Athena::RootSvc::~RootSvc
virtual ~RootSvc()
Destructor.
Definition: RootSvc.cxx:35
Athena::RootSvc::RootSvc
RootSvc(const RootSvc &)
pool
pool namespace
Definition: libname.h:15
Athena::RootSvc::getType
RootType getType(const std::type_info &type) const
Load the type (dictionary) from Root.
Definition: RootSvc.cxx:75
Athena::RootSvc::ConnMap_t
std::map< Guid, Athena::RootConnection * > ConnMap_t
Definition: RootSvc.h:94
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
pool::IFileCatalog
Definition: IFileCatalog.h:23
Athena::RootSvc::connect
StatusCode connect(const std::string &fname)
Connect the file fname to the service.
Definition: RootSvc.cxx:141
Athena::RootSvc::disconnect
StatusCode disconnect(const std::string &fname)
Disconnect the file fname from the service.
Definition: RootSvc.cxx:170
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::RootSvc::m_wconn
Athena::RootConnection * m_wconn
Definition: RootSvc.h:97
Preparation.mode
mode
Definition: Preparation.py:94
Athena::RootSvc::writeObject
const Token * writeObject(const Placement &placement, const RootType &type, const void *pObj)
Write object of a given class to Root.
Definition: RootSvc.cxx:85
Athena::RootSvc::connection
Athena::RootConnection * connection(const std::string &fname)
Get the RootConnection associated with file fname
Definition: RootSvc.cxx:189
Athena::RootSvc::finalize
StatusCode finalize()
Definition: RootSvc.cxx:61
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Athena::RootSvc::open
StatusCode open(const std::string &fname, const std::string &mode)
Open the file fname with open mode mode
Definition: RootSvc.cxx:114
Athena::RootSvc::commitOutput
StatusCode commitOutput()
Commit data and flush buffer.
Definition: RootSvc.cxx:156
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
Athena::RootSvc::destructObject
void destructObject(const RootType &type, void *pObj) const
Destruct a given object of type RootType.
Definition: RootSvc.cxx:110
Athena::RootSvc::readObject
void * readObject(const Token &token, void *&pObj)
Read object from Root.
Definition: RootSvc.cxx:80
IRootSvc.h
This file contains the class definition for the IRootSvc interface class.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthService.h
Athena::RootSvc::createObject
void * createObject(const RootType &type) const
Create an object of a given RootType.
Definition: RootSvc.cxx:104
Guid.h
This file contains the class definition for the Guid class (migrated from POOL).
Athena::RootSvc::RootSvc
RootSvc()
Default constructor:
ServiceHandle
Definition: ClusterMakerTool.h:37
TScopeAdapter
Definition: RootType.h:119