ATLAS Offline Software
RootSvc.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 // 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 : virtual public ::IRootSvc, public ::AthService {
40  friend class SvcFactory<Athena::RootSvc>;
41 
42 public:
44  RootSvc(const std::string& name, ISvcLocator* pSvcLocator);
45 
49  StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
50 
52  static const InterfaceID& interfaceID() {
53  return ::IRootSvc::interfaceID();
54  }
55 
58  RootType getType(const std::type_info& type) const;
59 
61  void* readObject(const Token& token, void*& pObj);
62 
64  const Token* writeObject(const Placement& placement, const RootType& type, const void* pObj);
65 
67  void* createObject(const RootType& type) const;
68 
70  void destructObject(const RootType& type, void* pObj) const;
72 
74  StatusCode open(const std::string& fname, const std::string& mode);
75 
77  StatusCode connect(const std::string& fname);
78 
81 
83  StatusCode disconnect(const std::string& fname);
84 
87  Athena::RootConnection* connection(const std::string& fname);
88 
90  virtual ~RootSvc();
91 
92 private:
94  RootSvc(); //< not implemented
95  RootSvc(const RootSvc&); //< not implemented
96  RootSvc& operator=(const RootSvc&); //< not implemented
97 
98 private:
100 
101  typedef std::map<Guid, Athena::RootConnection*> ConnMap_t;
105 
108 };
109 
110 }//> namespace Athena
111 
112 #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:107
Athena::RootSvc::m_catalog
pool::IFileCatalog * m_catalog
Definition: RootSvc.h:99
Athena::RootSvc::m_conns
ConnMap_t m_conns
Map of file name keys and connection values.
Definition: RootSvc.h:103
IDictLoaderSvc
Definition: IDictLoaderSvc.h:37
Athena::RootSvc::operator=
RootSvc & operator=(const RootSvc &)
Athena::RootSvc::~RootSvc
virtual ~RootSvc()
Destructor.
Definition: RootSvc.cxx:35
SvcFactory
Definition: AthCnvSvc.h:28
Athena::RootSvc::RootSvc
RootSvc(const RootSvc &)
pool
pool namespace
Definition: libname.h:15
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Athena::RootSvc::getType
RootType getType(const std::type_info &type) const
Load the type (dictionary) from Root.
Definition: RootSvc.cxx:86
Athena::RootSvc::ConnMap_t
std::map< Guid, Athena::RootConnection * > ConnMap_t
Definition: RootSvc.h:101
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:152
Athena::RootSvc::disconnect
StatusCode disconnect(const std::string &fname)
Disconnect the file fname from the service.
Definition: RootSvc.cxx:181
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
AthService
Definition: AthService.h:32
Athena::RootSvc::m_wconn
Athena::RootConnection * m_wconn
Definition: RootSvc.h:104
Preparation.mode
mode
Definition: Preparation.py:95
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:96
Athena::RootSvc::connection
Athena::RootConnection * connection(const std::string &fname)
Get the RootConnection associated with file fname
Definition: RootSvc.cxx:200
Athena::RootSvc::finalize
StatusCode finalize()
Definition: RootSvc.cxx:61
Athena::RootSvc::open
StatusCode open(const std::string &fname, const std::string &mode)
Open the file fname with open mode mode
Definition: RootSvc.cxx:125
Athena::RootSvc::commitOutput
StatusCode commitOutput()
Commit data and flush buffer.
Definition: RootSvc.cxx:167
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:121
Athena::RootSvc::readObject
void * readObject(const Token &token, void *&pObj)
Read object from Root.
Definition: RootSvc.cxx:91
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:115
Athena::RootSvc::queryInterface
StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Definition: RootSvc.cxx:74
Athena::RootSvc::interfaceID
static const InterfaceID & interfaceID()
Retrieve interface ID.
Definition: RootSvc.h:52
Guid.h
This file contains the class definition for the Guid class (migrated from POOL).
Athena::RootSvc::RootSvc
RootSvc()
Default constructor:
IRootSvc
This class provides the interface to the ROOT software.
Definition: IRootSvc.h:32
ServiceHandle
Definition: ClusterMakerTool.h:37
TScopeAdapter
Definition: RootType.h:119