![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "Gaudi/Property.h"
16 #include "GaudiKernel/DataObject.h"
17 #include "GaudiKernel/System.h"
18 #include "GaudiKernel/IConverter.h"
19 #include "GaudiKernel/IDataProviderSvc.h"
20 #include "GaudiKernel/IOpaqueAddress.h"
25 #include "GaudiKernel/Converter.h"
47 ISvcLocator* pSvcLocator,
96 IConverter *cnv =
i->second.m_converter;
99 if (!cnv->release()) {
100 i->second.m_converter = 0;
113 return StatusCode::SUCCESS;
124 if (!
i->second.converter()->finalize().isSuccess()) {
127 i->second.converter()->release();
140 return StatusCode::SUCCESS;
151 if ( riid == IConversionSvc::interfaceID() ) {
152 *ppvInterface = (IConversionSvc*)
this;
154 else if ( riid == IConverter::interfaceID() ) {
155 *ppvInterface = (IConverter*)
this;
157 else if ( riid == IAddressCreator::interfaceID() ) {
158 *ppvInterface = (IAddressCreator*)
this;
162 return AthService::queryInterface(riid, ppvInterface);
165 return StatusCode::SUCCESS;
191 if ( !pDataSvc )
return StatusCode::SUCCESS;
198 IConverter* cnv =
i->second.converter();
200 if (cnv->setDataProvider(
m_dataSvc).isFailure()) {
205 return StatusCode::SUCCESS;
211 SmartIF<IDataProviderSvc>&
217 const_cast<SmartIF<IDataProviderSvc>&
>(
m_dataSvc);
226 return StatusCode::FAILURE;
231 SmartIF<IConversionSvc>&
237 const_cast<SmartIF<IConversionSvc>&
>(
m_cnvSvc);
249 IConverter* cnv =
i->second.converter();
256 return StatusCode::SUCCESS;
260 SmartIF<IAddressCreator>&
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;
367 if ( 0 != pConverter ) {
368 const CLID& clid = pConverter->objType();
371 pConverter->addRef();
372 return StatusCode::SUCCESS;
374 return Status::NO_CONVERTER;
383 worker->second.converter()->finalize().ignore();
384 worker->second.converter()->release();
387 return StatusCode::SUCCESS;
389 return Status::NO_CONVERTER;
399 return worker->second.converter();
404 return worker->second.converter();
407 ATH_MSG_INFO(
"problem adding converter for CLID [" << clid <<
"]");
424 return StatusCode::SUCCESS;
431 return StatusCode::SUCCESS;
439 return StatusCode::SUCCESS;
450 const unsigned long* ,
451 IOpaqueAddress*& refpAddress)
454 return StatusCode::FAILURE;
460 std::string& refAddress)
463 return StatusCode::FAILURE;
471 IOpaqueAddress*& refpAddress)
474 return StatusCode::FAILURE;
481 return StatusCode::SUCCESS;
496 std::unique_ptr<IConverter> cnv{Converter::Factory::create
497 (ConverterID(typ,clid), serviceLocator().
get() )};
500 typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
501 cnv = Converter::Factory::create
502 (ConverterID(typ,clid), serviceLocator().
get() );
504 return cnv.release();
514 cnv->setConversionSvc(
this).ignore();
516 cnv->setDataProvider(
m_dataSvc).ignore();
517 return StatusCode::SUCCESS;
519 return Status::NO_CONVERTER;
529 return cnv->initialize();
531 return Status::NO_CONVERTER;
540 return StatusCode::SUCCESS;
542 return Status::NO_CONVERTER;
557 IOpaqueAddress*& pAddress,
558 DataObject*& pObject)
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;
JetConstituentVector::iterator iterator
StatusCode makeCall(int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
virtual StatusCode finalize()
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Implementation of IConverter: Update the references of an updated transient object.
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
virtual StatusCode removeConverter(const CLID &clid)
Remove converter object from conversion service (if present).
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:
virtual StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress)
Convert an address to string form.
virtual StatusCode connectOutput(const std::string &outputFile, const std::string &openMode)
Connect the output file to the service with open mode.
virtual StatusCode setAddressCreator(IAddressCreator *creator)
Set address creator facility.
virtual SmartIF< IAddressCreator > & addressCreator() const
Retrieve address creator facility.
virtual StatusCode configureConverter(long typ, const CLID &clid, IConverter *cnv)
Configure the new converter before initialize is called.
virtual StatusCode setConversionSvc(IConversionSvc *svc)
Implementation of IConverter: Set conversion service the converter is connected to.
virtual 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.
virtual SmartIF< IConversionSvc > & conversionSvc() const
Implementation of IConverter: Get conversion service the converter is connected to.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Implementation of IConverter: Update the references of an already converted object.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)
Implementation of IConverter: Set Data provider service.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Implementation of IConverter: Convert the transient object to the requested representation.
const CLID & objType() const
Implementation of IConverter: dummy call.
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)
Implementation of IConverter: Create the transient representation of an object.
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
AthROOTErrorHandlerSvc * svc
uint32_t CLID
The Class ID type.
virtual SmartIF< IDataProviderSvc > & dataProvider() const
Implementation of IConverter: Get Data provider service.
Workers m_workers
List of conversion workers.
virtual StatusCode initializeConverter(long typ, const CLID &clid, IConverter *cnv)
Initialize the new converter.
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)
Implementation of IConverter: Update the converted representation of a transient object.
virtual StatusCode addConverter(const CLID &clid)
Add converter object to conversion service.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Implementation of IConverter: Resolve the references of the converted object.
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)
Implementation of IConverter: Resolve the references of the created transient object.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)
Implementation of IConverter: Update the transient object from the other representation.
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
virtual StatusCode commitOutput(const std::string &output, bool do_commit)
Commit pending output.
virtual IConverter * converter(const CLID &wanted)
Retrieve converter from list.
virtual ~AthCnvSvc()
Destructor:
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.
std::unordered_map< CLID, WorkerEntry > Workers
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
virtual StatusCode disconnectOutput(const std::string &output)
Disconnect output files from the service.
#define ATLAS_THREAD_SAFE
Define macros for attributes used to control the static checker.
virtual long repSvcType() const
Retrieve the class type of the data store the converter uses.
long m_type
Conversion service type.