24#include "GaudiKernel/DataObject.h"
25#include "GaudiKernel/IOpaqueAddress.h"
26#include "GaudiKernel/IRegistry.h"
35 std::string name_from_clid(
const CLID clid) {
37 o <<
"AthenaRootCnv_" << clid;
45 ::
AthMessaging((pSvcLocator != 0 ? msgSvc() : 0), ::name_from_clid(id)),
46 m_cnvSvc(
"Athena::RootCnvSvc/AthenaRootCnvSvc", ::name_from_clid(id)),
54 m_cnvSvc(
"Athena::RootCnvSvc/AthenaRootCnvSvc", ::name_from_clid(CLID_NULL)),
64 if (!::Converter::initialize().isSuccess()) {
66 return StatusCode::FAILURE;
70 CLID clid = this->objType();
79 ATH_MSG_INFO(
"Cannot get T/P converter, will write transient type [" <<
m_ttype.Name() <<
", clid = " << clid <<
"]");
87 return StatusCode::FAILURE;
90 return StatusCode::SUCCESS;
94 return ::Converter::finalize();
98 return ROOT_StorageType;
102 return ROOT_StorageType;
120 return StatusCode::FAILURE;
124 ATH_MSG_VERBOSE(
"fillObjRefs(pAddr = " << pAddr <<
", " <<
"pObj = " << pObj <<
")...");
125 return StatusCode::FAILURE;
133 return StatusCode::FAILURE;
135 CLID clid = pObj->clID();
136 IRegistry* pR = pObj->registry();
139 return StatusCode::FAILURE;
141 std::string p[2] = {
"", pR->identifier() };
142 unsigned long ip[2] = { 0, 0 };
144 ATH_MSG_DEBUG(
"writing [" << objType() <<
"/" << p[1] <<
"]");
147 if (token == 0 || !
m_cnvSvc->createAddress(this->repSvcType(), clid, p, ip, pAddr).isSuccess()) {
149 return StatusCode::FAILURE;
151 ATH_MSG_DEBUG(
"writing [" << objType() <<
"/" << p[1] <<
"] [done], entry = " << ip[0]);
152 return StatusCode::SUCCESS;
156 ATH_MSG_VERBOSE(
"fillRepRefs(pAddr = " << pAddr <<
", " <<
"pObj = " << pObj <<
")...");
157 return StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
uint32_t CLID
The Class ID type.
This file contains the class definition for the IAthenaRootCnvSvc interface class.
This file contains the class definition for the IRootSvc interface class.
This file contains the class definition for the Placement class (migrated from POOL).
This file contains the class definition for the Athena::RootCnv class.
convert to and from a SG storable
This file contains the class definition for the Token class (migrated from POOL).
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddr, DataObject *pObj)
Resolve the references of the created transient object.
RootType m_ttype
transient type
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create a transient object from a ROOT persistent representation.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddr, DataObject *pObj)
Resolve the references of the created transient object.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create a ROOT persistent representation for a transient object.
ServiceHandle< ::IAthenaRootCnvSvc > m_cnvSvc
ServiceHandle to the conversion service.
virtual StatusCode finalize()
virtual ~RootCnv()
Destructor.
RootCnv()
Default constructor:
long repSvcType() const
Retrieve the class type of the data store the converter uses.
static long storageType()
RootType m_ptype
persistent type
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)