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");
53 }
catch (std::exception& e) {
54 ATH_MSG_FATAL (
"Set up Catalog - caught exception: " << e.what());
55 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
62 for (ConnMap_t::const_iterator itr =
m_conns.begin(), iend =
m_conns.end(); itr != iend; ++itr) {
63 if (!itr->second->disconnect().isSuccess()) {
71 return ::AthService::finalize();
95 unsigned long ientry = 0;
96 if (!
m_wconn->write(pObj, ientry).isSuccess()) {
105 void* pObj =
type.Construct();
118 std::string fidString, ftype;
119 m_catalog->lookupFileByPFN(fname, fidString, ftype);
120 if( fidString.empty() ) {
121 m_catalog->registerPFN(fname,
"ROOT_All", fidString);
126 ConnMap_t::const_iterator fitr =
m_conns.find(fid);
129 m_conns.insert(std::make_pair(fid, conn));
135 return StatusCode::FAILURE;
137 return StatusCode::SUCCESS;
146 return StatusCode::FAILURE;
148 if (!conn->connectWrite(
"recreate").isSuccess()) {
150 return StatusCode::FAILURE;
153 return StatusCode::SUCCESS;
160 return StatusCode::FAILURE;
162 if (!
m_wconn->commit().isSuccess()) {
164 return StatusCode::FAILURE;
166 return StatusCode::SUCCESS;
175 return StatusCode::FAILURE;
177 if (!conn->disconnect().isSuccess()) {
179 return StatusCode::FAILURE;
184 return StatusCode::SUCCESS;
193 std::string fidString, ftype;
194 m_catalog->lookupFileByPFN(fname, fidString, ftype);
195 if( fidString.empty() ) {
196 m_catalog->registerPFN(fname,
"ROOT_All", fidString);
201 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....