28 base_class(name, pSvcLocator),
36 for (ConnMap_t::iterator itr =
m_conns.begin(), iend =
m_conns.end(); itr != iend; ++itr) {
37 delete itr->second; itr->second = 0;
44 if (!::AthService::initialize().isSuccess()) {
46 return StatusCode::FAILURE;
50 m_catalog->setWriteCatalog(
"xmlcatalog_file:RootFileCatalog.xml");
52 }
catch (std::exception& e) {
53 ATH_MSG_FATAL (
"Set up Catalog - caught exception: " << e.what());
54 return StatusCode::FAILURE;
57 return StatusCode::SUCCESS;
61 for (ConnMap_t::const_iterator itr =
m_conns.begin(), iend =
m_conns.end(); itr != iend; ++itr) {
62 if (!itr->second->disconnect().isSuccess()) {
70 return ::AthService::finalize();
94 unsigned long ientry = 0;
95 if (!
m_wconn->write(pObj, ientry).isSuccess()) {
104 void* pObj =
type.Construct();
117 std::string fidString, ftype;
118 m_catalog->lookupFileByPFN(fname, fidString, ftype);
119 if( fidString.empty() ) {
120 m_catalog->registerPFN(fname,
"ROOT_All", fidString);
125 ConnMap_t::const_iterator fitr =
m_conns.find(fid);
128 m_conns.insert(std::make_pair(fid, conn));
134 return StatusCode::FAILURE;
136 return StatusCode::SUCCESS;
145 return StatusCode::FAILURE;
147 if (!conn->connectWrite(
"recreate").isSuccess()) {
149 return StatusCode::FAILURE;
152 return StatusCode::SUCCESS;
159 return StatusCode::FAILURE;
161 if (!
m_wconn->commit().isSuccess()) {
163 return StatusCode::FAILURE;
165 return StatusCode::SUCCESS;
174 return StatusCode::FAILURE;
176 if (!conn->disconnect().isSuccess()) {
178 return StatusCode::FAILURE;
183 return StatusCode::SUCCESS;
192 std::string fidString, ftype;
193 m_catalog->lookupFileByPFN(fname, fidString, ftype);
194 if( fidString.empty() ) {
195 m_catalog->registerPFN(fname,
"ROOT_All", fidString);
200 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...
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.
pool::IFileCatalog * m_catalog
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.
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....