ATLAS Offline Software
Loading...
Searching...
No Matches
RootSvc.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// 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"
26
27#include <map>
28
29// fwd declares
30class IDictLoaderSvc;
31class Placement;
32namespace pool { class IFileCatalog; }
33namespace Athena { class RootConnection; }
34
35namespace Athena {
39class RootSvc : public extends<::AthService, ::IRootSvc> {
40
41public:
43 RootSvc(const std::string& name, ISvcLocator* pSvcLocator);
44
46 StatusCode initialize();
47 StatusCode finalize();
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
73 StatusCode commitOutput();
74
76 StatusCode disconnect(const std::string& fname);
77
80 Athena::RootConnection* connection(const std::string& fname);
81
83 virtual ~RootSvc();
84
85private:
87 RootSvc(); //< not implemented
88 RootSvc(const RootSvc&); //< not implemented
89 RootSvc& operator=(const RootSvc&); //< not implemented
90
91private:
93
94 typedef std::map<Guid, Athena::RootConnection*> ConnMap_t;
98
101};
102
103}//> namespace Athena
104
105#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:27
StatusCode initialize()
Gaudi Service Interface method implementations:
Definition RootSvc.cxx:42
std::map< Guid, Athena::RootConnection * > ConnMap_t
Definition RootSvc.h:94
StatusCode open(const std::string &fname, const std::string &mode)
Open the file fname with open mode mode
Definition RootSvc.cxx:114
ConnMap_t m_conns
Map of file name keys and connection values.
Definition RootSvc.h:96
RootType getType(const std::type_info &type) const
Load the type (dictionary) from Root.
Definition RootSvc.cxx:75
void destructObject(const RootType &type, void *pObj) const
Destruct a given object of type RootType.
Definition RootSvc.cxx:110
StatusCode disconnect(const std::string &fname)
Disconnect the file fname from the service.
Definition RootSvc.cxx:170
void * readObject(const Token &token, void *&pObj)
Read object from Root.
Definition RootSvc.cxx:80
const Token * writeObject(const Placement &placement, const RootType &type, const void *pObj)
Write object of a given class to Root.
Definition RootSvc.cxx:85
pool::IFileCatalog * m_catalog
Definition RootSvc.h:92
RootSvc & operator=(const RootSvc &)
StatusCode connect(const std::string &fname)
Connect the file fname to the service.
Definition RootSvc.cxx:141
Athena::RootConnection * m_wconn
Definition RootSvc.h:97
StatusCode commitOutput()
Commit data and flush buffer.
Definition RootSvc.cxx:156
Athena::RootConnection * connection(const std::string &fname)
Get the RootConnection associated with file fname
Definition RootSvc.cxx:189
void * createObject(const RootType &type) const
Create an object of a given RootType.
Definition RootSvc.cxx:104
RootSvc()
Default constructor:
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
Definition RootSvc.h:100
virtual ~RootSvc()
Destructor.
Definition RootSvc.cxx:35
StatusCode finalize()
Definition RootSvc.cxx:61
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:19
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....
pool namespace
Definition libname.h:15