![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
This class provides the interface between Athena and RootSvc.
More...
#include <RootCnvSvc.h>
|
| RootCnvSvc (const std::string &name, ISvcLocator *pSvcLocator) |
| Standard Service Constructor. More...
|
|
StatusCode | initialize () |
| Gaudi Service Interface method implementations: More...
|
|
StatusCode | finalize () |
|
StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
|
StatusCode | connectOutput (const std::string &file) |
| Connect the output file to the service. More...
|
|
StatusCode | connectOutput (const std::string &file, const std::string &mode) |
| Connect the output file to the service with open mode. More...
|
|
StatusCode | commitOutput (const std::string &output, bool do_commit) |
| Commit pending output. More...
|
|
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
| Create a Generic address using explicit arguments to identify a single object. More...
|
|
StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) |
| Convert an address to string form. More...
|
|
StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) |
| Convert an address in string form to object form. More...
|
|
StatusCode | updateServiceState (IOpaqueAddress *pAddress) |
| Update state of the service. More...
|
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
virtual SmartIF< IAddressCreator > & | addressCreator () |
| Retrieve address creation interface. More...
|
|
virtual StatusCode | configureConverter (long typ, const CLID &clid, IConverter *cnv) |
| Configure the new converter before initialize is called. More...
|
|
virtual StatusCode | initializeConverter (long typ, const CLID &clid, IConverter *cnv) |
| Initialize the new converter. More...
|
|
virtual StatusCode | activateConverter (long typ, const CLID &clid, IConverter *cnv) |
| Activate the new converter after initialization. More...
|
|
virtual void | loadConverter (DataObject *pObject) |
| Load converter or dictionary needed by the converter. More...
|
|
StatusCode | makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject) |
|
typedef std::recursive_mutex | CallMutex |
| Mutex to protect Converter creation. More...
|
|
SmartIF< IDataProviderSvc > | m_dataSvc |
| Pointer to data provider service. More...
|
|
SmartIF< IAddressCreator > | m_addressCreator |
| Pointer to the address creation service interface. More...
|
|
SmartIF< IConversionSvc > | m_cnvSvc |
| Pointer to the IConversionSvc interface of this. More...
|
|
long | m_type |
| Conversion service type. More...
|
|
Workers | m_workers |
| List of conversion workers. More...
|
|
CallMutex | m_conv_mut |
|
This class provides the interface between Athena and RootSvc.
Definition at line 35 of file RootCnvSvc.h.
◆ CallMutex
◆ Workers
◆ RootCnvSvc() [1/3]
Athena::RootCnvSvc::RootCnvSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ RootCnvSvc() [2/3]
Athena::RootCnvSvc::RootCnvSvc |
( |
| ) |
|
|
private |
◆ RootCnvSvc() [3/3]
◆ activateConverter()
StatusCode AthCnvSvc::activateConverter |
( |
long |
typ, |
|
|
const CLID & |
clid, |
|
|
IConverter * |
cnv |
|
) |
| |
|
protectedvirtualinherited |
Activate the new converter after initialization.
Definition at line 536 of file AthCnvSvc.cxx.
540 return StatusCode::SUCCESS;
542 return Status::NO_CONVERTER;
◆ addConverter() [1/2]
StatusCode AthCnvSvc::addConverter |
( |
const CLID & |
clid | ) |
|
|
virtualinherited |
Add converter object to conversion service.
Definition at line 336 of file AthCnvSvc.cxx.
341 if ( 0 != pConverter ) {
343 if (
status.isSuccess() ) {
345 if (
status.isSuccess() ) {
347 if (
status.isSuccess() ) {
348 long conv_typ = pConverter->repSvcType();
349 const CLID& conv_clid = pConverter->objType();
350 typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
351 conv_typ = (conv_typ<0xFF) ? conv_typ : conv_typ&0xFFFFFF00;
352 if ( conv_typ == typ && conv_clid == clid ) {
358 pConverter->release();
360 return Status::NO_CONVERTER;
◆ addConverter() [2/2]
StatusCode AthCnvSvc::addConverter |
( |
IConverter * |
pConverter | ) |
|
|
virtualinherited |
Add converter object to conversion service.
Definition at line 365 of file AthCnvSvc.cxx.
367 if ( 0 != pConverter ) {
368 const CLID& clid = pConverter->objType();
370 m_workers.insert (std::make_pair(clid,WorkerEntry(clid, pConverter)));
371 pConverter->addRef();
372 return StatusCode::SUCCESS;
374 return Status::NO_CONVERTER;
◆ addressCreator() [1/2]
virtual SmartIF<IAddressCreator>& AthCnvSvc::addressCreator |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
Retrieve address creation interface.
Definition at line 300 of file AthCnvSvc.h.
◆ addressCreator() [2/2]
SmartIF< IAddressCreator > & AthCnvSvc::addressCreator |
( |
| ) |
const |
|
virtualinherited |
Retrieve address creator facility.
Definition at line 261 of file AthCnvSvc.cxx.
◆ commitOutput()
StatusCode Athena::RootCnvSvc::commitOutput |
( |
const std::string & |
output, |
|
|
bool |
do_commit |
|
) |
| |
|
virtual |
◆ configureConverter()
StatusCode AthCnvSvc::configureConverter |
( |
long |
typ, |
|
|
const CLID & |
clid, |
|
|
IConverter * |
cnv |
|
) |
| |
|
protectedvirtualinherited |
Configure the new converter before initialize is called.
Definition at line 510 of file AthCnvSvc.cxx.
514 cnv->setConversionSvc(
this).ignore();
516 cnv->setDataProvider(
m_dataSvc).ignore();
517 return StatusCode::SUCCESS;
519 return Status::NO_CONVERTER;
◆ connectOutput() [1/2]
StatusCode Athena::RootCnvSvc::connectOutput |
( |
const std::string & |
file | ) |
|
|
virtual |
◆ connectOutput() [2/2]
StatusCode Athena::RootCnvSvc::connectOutput |
( |
const std::string & |
file, |
|
|
const std::string & |
mode |
|
) |
| |
|
virtual |
Connect the output file to the service with open mode.
Reimplemented from AthCnvSvc.
Definition at line 70 of file RootCnvSvc.cxx.
72 std::string::size_type inx1 =
file.find(
'(');
73 if (inx1 != std::string::npos) {
74 std::string::size_type inx2 =
file.find(
')');
75 if (inx2 == std::string::npos || inx2 !=
file.size() - 1) {
76 return StatusCode::FAILURE;
83 return StatusCode::FAILURE;
◆ conversionSvc()
SmartIF< IConversionSvc > & AthCnvSvc::conversionSvc |
( |
| ) |
const |
|
virtualinherited |
◆ convertAddress()
StatusCode Athena::RootCnvSvc::convertAddress |
( |
const IOpaqueAddress * |
pAddress, |
|
|
std::string & |
refAddress |
|
) |
| |
|
virtual |
Convert an address to string form.
Reimplemented from AthCnvSvc.
Definition at line 113 of file RootCnvSvc.cxx.
114 ATH_MSG_VERBOSE(
"::convertAddress(pAddr = " << pAddress <<
", refPaddr = " << refAddress <<
")");
115 return StatusCode::FAILURE;
◆ converter()
IConverter * AthCnvSvc::converter |
( |
const CLID & |
wanted | ) |
|
|
virtualinherited |
Retrieve converter from list.
Definition at line 394 of file AthCnvSvc.cxx.
399 return worker->second.converter();
404 return worker->second.converter();
407 ATH_MSG_INFO(
"problem adding converter for CLID [" << clid <<
"]");
◆ createAddress() [1/2]
StatusCode Athena::RootCnvSvc::createAddress |
( |
long |
svc_type, |
|
|
const CLID & |
clid, |
|
|
const std::string & |
refAddress, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
virtual |
Convert an address in string form to object form.
Reimplemented from AthCnvSvc.
Definition at line 118 of file RootCnvSvc.cxx.
123 <<
"svc_type=" << svc_type <<
", "
124 <<
"clid=" << clid <<
", "
125 <<
"refaddr=" << refAddress <<
", "
126 <<
"refpaddr=" << refpAddress <<
")");
128 return StatusCode::FAILURE;
◆ createAddress() [2/2]
StatusCode Athena::RootCnvSvc::createAddress |
( |
long |
svc_type, |
|
|
const CLID & |
clid, |
|
|
const std::string * |
par, |
|
|
const unsigned long * |
ip, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
virtual |
Create a Generic address using explicit arguments to identify a single object.
Reimplemented from AthCnvSvc.
Definition at line 98 of file RootCnvSvc.cxx.
104 <<
"svc_type=" << svc_type <<
", "
105 <<
"clid=" << clid <<
", "
106 <<
"par=" <<
par[0] <<
", " <<
par[1] <<
" "
107 <<
"ip=" <<
ip[0] <<
", " <<
ip[1] <<
" "
108 <<
"refpaddr=" << refpAddress <<
")");
109 refpAddress =
new GenericAddress(ROOT_StorageType, clid,
par[0],
par[1],
ip[0],
ip[1]);
110 return StatusCode::SUCCESS;
◆ createConverter()
IConverter * Athena::RootCnvSvc::createConverter |
( |
long |
typ, |
|
|
const CLID & |
clid, |
|
|
const ICnvFactory * |
fac |
|
) |
| |
|
protectedvirtual |
Create new converter using factory.
Reimplemented from AthCnvSvc.
Definition at line 172 of file RootCnvSvc.cxx.
173 ATH_MSG_VERBOSE(
"createConverter typ = " << typ <<
", clid = " << clid);
174 if (typ == ROOT_StorageType) {
177 return ::AthCnvSvc::createConverter(typ, clid, fac);
◆ createObj()
StatusCode AthCnvSvc::createObj |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject *& |
refpObject |
|
) |
| |
|
virtualinherited |
◆ createRep()
StatusCode AthCnvSvc::createRep |
( |
DataObject * |
pObject, |
|
|
IOpaqueAddress *& |
refpAddress |
|
) |
| |
|
virtualinherited |
◆ dataProvider()
SmartIF< IDataProviderSvc > & AthCnvSvc::dataProvider |
( |
| ) |
const |
|
virtualinherited |
Implementation of IConverter: Get Data provider service.
- Returns
- Pointer to data provider service
Definition at line 212 of file AthCnvSvc.cxx.
217 const_cast<SmartIF<IDataProviderSvc>&
>(
m_dataSvc);
◆ disconnectOutput()
StatusCode AthCnvSvc::disconnectOutput |
( |
const std::string & |
output | ) |
|
|
virtualinherited |
◆ fillObjRefs()
StatusCode AthCnvSvc::fillObjRefs |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
virtualinherited |
◆ fillRepRefs()
StatusCode AthCnvSvc::fillRepRefs |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
virtualinherited |
◆ finalize()
StatusCode Athena::RootCnvSvc::finalize |
( |
| ) |
|
|
virtual |
◆ getTPConverter()
◆ getType() [1/2]
◆ getType() [2/2]
RootType Athena::RootCnvSvc::getType |
( |
const std::type_info & |
type | ) |
const |
|
protectedvirtual |
◆ initialize()
StatusCode Athena::RootCnvSvc::initialize |
( |
| ) |
|
|
virtual |
Gaudi Service Interface method implementations:
Reimplemented from AthCnvSvc.
Definition at line 39 of file RootCnvSvc.cxx.
43 return StatusCode::FAILURE;
51 return StatusCode::SUCCESS;
◆ initializeConverter()
StatusCode AthCnvSvc::initializeConverter |
( |
long |
typ, |
|
|
const CLID & |
clid, |
|
|
IConverter * |
cnv |
|
) |
| |
|
protectedvirtualinherited |
Initialize the new converter.
Definition at line 525 of file AthCnvSvc.cxx.
529 return cnv->initialize();
531 return Status::NO_CONVERTER;
◆ interfaceID()
static const InterfaceID& IAthenaRootCnvSvc::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Retrieve interface ID.
Definition at line 35 of file IAthenaRootCnvSvc.h.
36 static const InterfaceID s_iid(
"IAthenaRootCnvSvc", 1, 0);
◆ loadConverter()
void AthCnvSvc::loadConverter |
( |
DataObject * |
pObject | ) |
|
|
protectedvirtualinherited |
Load converter or dictionary needed by the converter.
Definition at line 547 of file AthCnvSvc.cxx.
◆ makeCall()
StatusCode AthCnvSvc::makeCall |
( |
int |
typ, |
|
|
bool |
ignore_add, |
|
|
bool |
ignore_obj, |
|
|
bool |
update, |
|
|
IOpaqueAddress *& |
pAddress, |
|
|
DataObject *& |
pObject |
|
) |
| |
|
protectedinherited |
Definition at line 553 of file AthCnvSvc.cxx.
560 if ( 0 != pAddress || ignore_add ) {
561 if ( 0 != pObject || ignore_obj ) {
562 const CLID& obj_class =
563 (0 != pObject && !ignore_obj) ? pObject->clID()
564 : (0 != pAddress && !ignore_add)
568 if ( !cnv && pObject ) {
578 status = cnv->createObj(pAddress, pObject);
581 status = cnv->fillObjRefs(pAddress, pObject);
584 status = cnv->updateObj(pAddress, pObject);
587 status = cnv->updateObjRefs(pAddress, pObject);
590 status = cnv->createRep(pObject, pAddress);
593 status = cnv->fillRepRefs(pAddress, pObject);
596 status = cnv->updateRep(pAddress, pObject);
599 status = cnv->updateRepRefs(pAddress, pObject);
602 status = StatusCode::FAILURE;
611 msg(MSG::INFO) <<
"No converter for object ";
612 if ( pObject != 0 ) {
613 msg(MSG::INFO) << System::typeinfoName(
typeid(*pObject));
615 msg(MSG::INFO) <<
" CLID= " << obj_class <<
endmsg;
616 return Status::NO_CONVERTER;
618 return Status::INVALID_OBJECT;
620 return Status::INVALID_ADDRESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ objType()
◆ operator=()
◆ queryInterface()
StatusCode Athena::RootCnvSvc::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvInterface |
|
) |
| |
|
virtual |
Reimplemented from AthCnvSvc.
Definition at line 58 of file RootCnvSvc.cxx.
63 return ::AthCnvSvc::queryInterface(riid, ppvInterface);
66 return StatusCode::SUCCESS;
◆ removeConverter()
StatusCode AthCnvSvc::removeConverter |
( |
const CLID & |
clid | ) |
|
|
virtualinherited |
Remove converter object from conversion service (if present).
Definition at line 379 of file AthCnvSvc.cxx.
383 worker->second.converter()->finalize().ignore();
384 worker->second.converter()->release();
387 return StatusCode::SUCCESS;
389 return Status::NO_CONVERTER;
◆ repSvcType()
long AthCnvSvc::repSvcType |
( |
| ) |
const |
|
virtualinherited |
Retrieve the class type of the data store the converter uses.
Definition at line 172 of file AthCnvSvc.cxx.
◆ setAddressCreator()
StatusCode AthCnvSvc::setAddressCreator |
( |
IAddressCreator * |
creator | ) |
|
|
virtualinherited |
Set address creator facility.
Definition at line 243 of file AthCnvSvc.cxx.
249 IConverter* cnv =
i->second.converter();
256 return StatusCode::SUCCESS;
◆ setConversionSvc()
StatusCode AthCnvSvc::setConversionSvc |
( |
IConversionSvc * |
svc | ) |
|
|
virtualinherited |
Implementation of IConverter: Set conversion service the converter is connected to.
Definition at line 224 of file AthCnvSvc.cxx.
226 return StatusCode::FAILURE;
◆ setDataProvider()
StatusCode AthCnvSvc::setDataProvider |
( |
IDataProviderSvc * |
pDataSvc | ) |
|
|
virtualinherited |
Implementation of IConverter: Set Data provider service.
- Returns
- Status code indicating success or failure
- Parameters
-
pService | Pointer to data provider service |
Definition at line 189 of file AthCnvSvc.cxx.
191 if ( !pDataSvc )
return StatusCode::SUCCESS;
198 IConverter* cnv =
i->second.converter();
200 if (cnv->setDataProvider(
m_dataSvc).isFailure()) {
205 return StatusCode::SUCCESS;
◆ updateObj()
StatusCode AthCnvSvc::updateObj |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
refpObject |
|
) |
| |
|
virtualinherited |
◆ updateObjRefs()
StatusCode AthCnvSvc::updateObjRefs |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
virtualinherited |
◆ updateRep()
StatusCode AthCnvSvc::updateRep |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
virtualinherited |
◆ updateRepRefs()
StatusCode AthCnvSvc::updateRepRefs |
( |
IOpaqueAddress * |
pAddress, |
|
|
DataObject * |
pObject |
|
) |
| |
|
virtualinherited |
◆ updateServiceState()
StatusCode Athena::RootCnvSvc::updateServiceState |
( |
IOpaqueAddress * |
pAddress | ) |
|
|
virtual |
Update state of the service.
Reimplemented from AthCnvSvc.
Definition at line 131 of file RootCnvSvc.cxx.
132 ATH_MSG_VERBOSE(
"RootCnvSvc::updateServiceState(paddr = " << pAddress <<
")");
133 return StatusCode::FAILURE;
◆ writeObject()
Write object of a given class to Root, using optional T/P converter.
Implements IAthenaRootCnvSvc.
Definition at line 147 of file RootCnvSvc.cxx.
151 const Token* token = 0;
155 if (tpConverter == 0) {
156 token =
m_rootSvc->writeObject(placement, typeDesc, pObj);
158 void* pers =
m_rootSvc->createObject(typeDesc);
160 token =
m_rootSvc->writeObject(placement, typeDesc, pers);
161 m_rootSvc->destructObject(typeDesc, pers); pers = 0;
◆ SvcFactory< Athena::RootCnvSvc >
◆ m_addressCreator
SmartIF<IAddressCreator> AthCnvSvc::m_addressCreator |
|
protectedinherited |
Pointer to the address creation service interface.
Definition at line 315 of file AthCnvSvc.h.
◆ m_cnvSvc
SmartIF<IConversionSvc> AthCnvSvc::m_cnvSvc |
|
protectedinherited |
Pointer to the IConversionSvc interface of this.
Definition at line 317 of file AthCnvSvc.h.
◆ m_conv_mut
◆ m_dataSvc
SmartIF<IDataProviderSvc> AthCnvSvc::m_dataSvc |
|
protectedinherited |
Pointer to data provider service.
Definition at line 313 of file AthCnvSvc.h.
◆ m_dictSvc
◆ m_rootSvc
◆ m_tpCnvSvc
◆ m_treeName
std::string Athena::RootCnvSvc::m_treeName |
|
private |
◆ m_type
◆ m_workers
List of conversion workers.
Definition at line 321 of file AthCnvSvc.h.
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
StatusCode makeCall(int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
ServiceHandle< ::IRootSvc > m_rootSvc
ServiceHandle to the root service.
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
This class holds all the necessary information to guide the writing of an object in a physical place.
This class provides the interface between Athena and RootSvc.
virtual StatusCode removeConverter(const CLID &clid)
Remove converter object from conversion service (if present).
ServiceHandle< ::IDictLoaderSvc > m_dictSvc
ServiceHandle to the dictionary service.
static const InterfaceID & interfaceID()
Retrieve interface ID.
StatusCode connectOutput(const std::string &file)
Connect the output file to the service.
virtual StatusCode activateConverter(long typ, const CLID &clid, IConverter *cnv)
Activate the new converter after initialization.
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
virtual StatusCode initialize()
Gaudi Service Implementation.
AthCnvSvc()
Default constructor:
#define ATH_MSG_VERBOSE(x)
Placement & setContainerName(const std::string &containerName)
Set container name.
This class provides a token that identifies in a unique way objects on the persistent storage.
virtual void transToPersUntyped(const void *trans, void *pers, MsgStream &msg)=0
Convert transient object representation to persistent.
virtual StatusCode configureConverter(long typ, const CLID &clid, IConverter *cnv)
Configure the new converter before initialize is called.
::StatusCode StatusCode
StatusCode definition for legacy code.
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
AthROOTErrorHandlerSvc * svc
uint32_t CLID
The Class ID type.
Workers m_workers
List of conversion workers.
virtual StatusCode initializeConverter(long typ, const CLID &clid, IConverter *cnv)
Initialize the new converter.
virtual StatusCode addConverter(const CLID &clid)
Add converter object to conversion service.
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
virtual IConverter * converter(const CLID &wanted)
Retrieve converter from list.
Placement & setTechnology(int technology)
Set technology type.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
virtual void loadConverter(DataObject *pObject)
Load converter or dictionary needed by the converter.
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
std::string m_treeName
ROOT TTree name.
This class provides the abstract converter to translate an object to/from its persistent ROOT represe...
#define ATLAS_THREAD_SAFE
ServiceHandle< ::ITPCnvSvc > m_tpCnvSvc
ServiceHandle to the T/P conversion service.
virtual long repSvcType() const
Retrieve the class type of the data store the converter uses.
long m_type
Conversion service type.