25 base_class(name, pSvcLocator),
34 for (ConnMap_t::iterator itr =
m_conns.begin(), iend =
m_conns.end(); itr != iend; ++itr) {
35 delete itr->second; itr->second = 0;
42 if (!::AthService::initialize().isSuccess()) {
44 return StatusCode::FAILURE;
47 m_gCatalogMgr->addCatalog(
"xmlcatalog_file:RootFileCatalog.xml");
50 }
catch (std::exception& e) {
51 ATH_MSG_FATAL (
"Set up Catalog - caught exception: " << e.what());
52 return StatusCode::FAILURE;
55 return StatusCode::SUCCESS;
59 for (ConnMap_t::const_iterator itr =
m_conns.begin(), iend =
m_conns.end(); itr != iend; ++itr) {
60 if (!itr->second->disconnect().isSuccess()) {
65 return ::AthService::finalize();
89 unsigned long ientry = 0;
90 if (!
m_wconn->write(pObj, ientry).isSuccess()) {
99 void* pObj =
type.Construct();
111 std::string fidString;
113 if( fidString.empty() ) {
115 m_gCatalog->registerPFN(fidString, fname,
"ROOT_All");
119 ConnMap_t::const_iterator fitr =
m_conns.find(fid);
122 m_conns.insert(std::make_pair(fid, conn));
128 return StatusCode::FAILURE;
130 return StatusCode::SUCCESS;
139 return StatusCode::FAILURE;
141 if (!conn->connectWrite(
"recreate").isSuccess()) {
143 return StatusCode::FAILURE;
146 return StatusCode::SUCCESS;
153 return StatusCode::FAILURE;
155 if (!
m_wconn->commit().isSuccess()) {
157 return StatusCode::FAILURE;
159 return StatusCode::SUCCESS;
168 return StatusCode::FAILURE;
170 if (!conn->disconnect().isSuccess()) {
172 return StatusCode::FAILURE;
177 return StatusCode::SUCCESS;
185 std::string fidString;
187 if( fidString.empty() ) {
189 m_gCatalog->registerPFN(fidString, fname,
"ROOT_All");
193 ConnMap_t::const_iterator fitr =
m_conns.find(fid);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This file contains the class definition for the Placement class (migrated from POOL).
This file contains the class definition for the Athena::RootConnection class.
This file contains the class definition for the RootSvc class.
This file contains the class definition for the Token class (migrated from POOL).
This class provides the implementation of Athena::RootConnection class, similar to Gaudi IDataConnect...
SmartIF< Gaudi::IFileCatalog > m_gCatalog
StatusCode initialize()
Gaudi Service Interface method implementations:
StatusCode open(const std::string &fname, const std::string &mode)
Open the file fname with open mode mode.
ConnMap_t m_conns
Map of file name keys and connection values.
RootType getType(const std::type_info &type) const
Load the type (dictionary) from Root.
void destructObject(const RootType &type, void *pObj) const
Destruct a given object of type RootType.
StatusCode disconnect(const std::string &fname)
Disconnect the file fname from the service.
void * readObject(const Token &token, void *&pObj)
Read object from Root.
const Token * writeObject(const Placement &placement, const RootType &type, const void *pObj)
Write object of a given class to Root.
StatusCode connect(const std::string &fname)
Connect the file fname to the service.
Athena::RootConnection * m_wconn
StatusCode commitOutput()
Commit data and flush buffer.
Athena::RootConnection * connection(const std::string &fname)
Get the RootConnection associated with file fname.
void * createObject(const RootType &type) const
Create an object of a given RootType.
RootSvc()
Default constructor:
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
virtual ~RootSvc()
Destructor.
SmartIF< Gaudi::IFileCatalogMgr > m_gCatalogMgr
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
constexpr void fromString(std::string_view s)
Automatic conversion from string representation.
static const Guid & null() noexcept
NULL-Guid: static class method.
constexpr void toString(std::span< char, StrLen > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
This class holds all the necessary information to guide the writing of an object in a physical place.
const std::string & containerName() const
Access container name.
This class provides a token that identifies in a unique way objects on the persistent storage.
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
=============================================================================