ATLAS Offline Software
IRootSvc.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 #ifndef ATHENAROOTKERNEL_IROOTSVC_H
8 #define ATHENAROOTKERNEL_IROOTSVC_H 1
9 
15 // fwk includes
16 #include "GaudiKernel/IInterface.h"
17 
18 #include "DataModelRoot/RootType.h"
19 
20 // stl includes
21 #include <typeinfo>
22 #include <string>
23 
24 // fwd declares
25 class Token;
26 class Placement;
27 namespace Athena { class RootConnection; }
28 
32 class IRootSvc : virtual public IInterface {
33 public:
34  virtual ~IRootSvc();
35 
38 
41  virtual RootType getType(const std::type_info& type) const = 0;
42 
44  virtual void* readObject(const Token& token, void*& pObj) = 0;
45 
47  virtual const Token* writeObject(const Placement& placement, const RootType& type, const void* pObj) = 0;
48 
50  virtual void* createObject(const RootType& type) const = 0;
51 
53  virtual void destructObject(const RootType& type, void* pObj) const = 0;
54 
56 
58  virtual StatusCode open(const std::string& fname, const std::string& mode) = 0;
59 
61  virtual StatusCode connect(const std::string& fname) = 0;
62 
64  virtual StatusCode commitOutput() = 0;
65 
67  virtual StatusCode disconnect(const std::string& fname) = 0;
68 
71  virtual Athena::RootConnection* connection(const std::string& fname) = 0;
72 };
73 
74 #endif /* !ATHENAROOTKERNEL_IROOTSVC_H */
IRootSvc::writeObject
virtual const Token * writeObject(const Placement &placement, const RootType &type, const void *pObj)=0
Write object of a given class to Root.
Athena::RootConnection
This class provides the implementation of Athena::RootConnection class, similar to Gaudi IDataConnect...
Definition: RootConnection.h:36
Placement
This class holds all the necessary information to guide the writing of an object in a physical place.
Definition: Placement.h:19
IRootSvc::destructObject
virtual void destructObject(const RootType &type, void *pObj) const =0
Destruct a given object of type RootType.
IRootSvc::createObject
virtual void * createObject(const RootType &type) const =0
Create an object of a given RootType.
IRootSvc::connect
virtual StatusCode connect(const std::string &fname)=0
Connect the file fname to the service.
IRootSvc::commitOutput
virtual StatusCode commitOutput()=0
Commit data and flush buffer.
IRootSvc::readObject
virtual void * readObject(const Token &token, void *&pObj)=0
Read object from Root.
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
IRootSvc::connection
virtual Athena::RootConnection * connection(const std::string &fname)=0
Get the RootConnection associated with file fname
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
IRootSvc::disconnect
virtual StatusCode disconnect(const std::string &fname)=0
Disconnect the file fname from the service.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRootSvc::getType
virtual RootType getType(const std::type_info &type) const =0
Preparation.mode
mode
Definition: Preparation.py:94
IRootSvc::DeclareInterfaceID
DeclareInterfaceID(IRootSvc, 1, 0)
Declare interface ID.
IRootSvc::~IRootSvc
virtual ~IRootSvc()
Definition: IRootSvc.cxx:17
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RootType.h
IRootSvc
This class provides the interface to the ROOT software.
Definition: IRootSvc.h:32
IRootSvc::open
virtual StatusCode open(const std::string &fname, const std::string &mode)=0
Open the file fname with open mode mode
TScopeAdapter
Definition: RootType.h:119