|
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,
49 base_class (
name, pSvcLocator),
89 IConverter *cnv =
i->second.m_converter;
92 if (!cnv->release()) {
93 i->second.m_converter = 0;
109 return StatusCode::SUCCESS;
120 if (!
i->second.converter()->finalize().isSuccess()) {
123 i->second.converter()->release();
136 return StatusCode::SUCCESS;
162 if ( !pDataSvc )
return StatusCode::SUCCESS;
169 IConverter* cnv =
i->second.converter();
171 if (cnv->setDataProvider(
m_dataSvc).isFailure()) {
176 return StatusCode::SUCCESS;
182 SmartIF<IDataProviderSvc>&
188 const_cast<SmartIF<IDataProviderSvc>&
>(
m_dataSvc);
197 return StatusCode::FAILURE;
202 SmartIF<IConversionSvc>&
208 const_cast<SmartIF<IConversionSvc>&
>(
m_cnvSvc);
220 IConverter* cnv =
i->second.converter();
227 return StatusCode::SUCCESS;
231 SmartIF<IAddressCreator>&
312 if ( 0 != pConverter ) {
314 if (
status.isSuccess() ) {
316 if (
status.isSuccess() ) {
318 if (
status.isSuccess() ) {
319 long conv_typ = pConverter->repSvcType();
320 const CLID& conv_clid = pConverter->objType();
321 typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
322 conv_typ = (conv_typ<0xFF) ? conv_typ : conv_typ&0xFFFFFF00;
323 if ( conv_typ == typ && conv_clid == clid ) {
329 pConverter->release();
331 return Status::NO_CONVERTER;
338 if ( 0 != pConverter ) {
339 const CLID& clid = pConverter->objType();
342 pConverter->addRef();
343 return StatusCode::SUCCESS;
345 return Status::NO_CONVERTER;
354 worker->second.converter()->finalize().ignore();
355 worker->second.converter()->release();
358 return StatusCode::SUCCESS;
360 return Status::NO_CONVERTER;
370 return worker->second.converter();
375 return worker->second.converter();
378 ATH_MSG_INFO(
"problem adding converter for CLID [" << clid <<
"]");
395 return StatusCode::SUCCESS;
402 return StatusCode::SUCCESS;
410 return StatusCode::SUCCESS;
421 const unsigned long* ,
422 IOpaqueAddress*& refpAddress)
425 return StatusCode::FAILURE;
431 std::string& refAddress)
434 return StatusCode::FAILURE;
442 IOpaqueAddress*& refpAddress)
445 return StatusCode::FAILURE;
452 return StatusCode::SUCCESS;
467 std::unique_ptr<IConverter> cnv{Converter::Factory::create
468 (ConverterID(typ,clid), serviceLocator().
get() )};
471 typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
472 cnv = Converter::Factory::create
473 (ConverterID(typ,clid), serviceLocator().
get() );
475 return cnv.release();
485 cnv->setConversionSvc(
this).ignore();
487 cnv->setDataProvider(
m_dataSvc).ignore();
488 return StatusCode::SUCCESS;
490 return Status::NO_CONVERTER;
500 return cnv->initialize();
502 return Status::NO_CONVERTER;
511 return StatusCode::SUCCESS;
513 return Status::NO_CONVERTER;
528 IOpaqueAddress*& pAddress,
529 DataObject*& pObject)
531 if ( 0 != pAddress || ignore_add ) {
532 if ( 0 != pObject || ignore_obj ) {
533 const CLID& obj_class =
534 (0 != pObject && !ignore_obj) ? pObject->clID()
535 : (0 != pAddress && !ignore_add)
539 if ( !cnv && pObject ) {
549 status = cnv->createObj(pAddress, pObject);
552 status = cnv->fillObjRefs(pAddress, pObject);
555 status = cnv->updateObj(pAddress, pObject);
558 status = cnv->updateObjRefs(pAddress, pObject);
561 status = cnv->createRep(pObject, pAddress);
564 status = cnv->fillRepRefs(pAddress, pObject);
567 status = cnv->updateRep(pAddress, pObject);
570 status = cnv->updateRepRefs(pAddress, pObject);
573 status = StatusCode::FAILURE;
582 msg(MSG::INFO) <<
"No converter for object ";
583 if ( pObject != 0 ) {
586 msg(MSG::INFO) <<
" CLID= " << obj_class <<
endmsg;
587 return Status::NO_CONVERTER;
589 return Status::INVALID_OBJECT;
591 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 updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the converted representation of a transient object.
virtual StatusCode addConverter(const CLID &clid) override
Add converter object to conversion service.
virtual StatusCode commitOutput(const std::string &output, bool do_commit) override
Commit pending output.
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.
virtual StatusCode setAddressCreator(IAddressCreator *creator) override
Set address creator facility.
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an updated transient object.
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
virtual StatusCode setConversionSvc(IConversionSvc *svc) override
Implementation of IConverter: Set conversion service the converter is connected to.
AthCnvSvc()
Default constructor:
virtual StatusCode removeConverter(const CLID &clid) override
Remove converter object from conversion service (if present).
virtual StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress) override
Convert an address to string form.
virtual StatusCode configureConverter(long typ, const CLID &clid, IConverter *cnv)
Configure the new converter before initialize is called.
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
::StatusCode StatusCode
StatusCode definition for legacy code.
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the created transient object.
AthROOTErrorHandlerSvc * svc
virtual SmartIF< IDataProviderSvc > & dataProvider() const override
Implementation of IConverter: Get Data provider service.
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 updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an already converted object.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject) override
Implementation of IConverter: Update the transient object from the other representation.
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
virtual const CLID & objType() const override
Implementation of IConverter: dummy call.
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
virtual ~AthCnvSvc()
Destructor:
virtual StatusCode finalize() override
virtual IConverter * converter(const CLID &wanted) override
Retrieve converter from list.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
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 long repSvcType() const override
Retrieve the class type of the data store the converter uses.
virtual StatusCode disconnectOutput(const std::string &output)
Disconnect output files from the service.
#define ATLAS_THREAD_SAFE
virtual SmartIF< IConversionSvc > & conversionSvc() const override
Implementation of IConverter: Get conversion service the converter is connected to.
virtual StatusCode setDataProvider(IDataProviderSvc *pService) override
Implementation of IConverter: Set Data provider service.
virtual SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
Define macros for attributes used to control the static checker.
virtual StatusCode initialize() override
Gaudi Service Implementation.
virtual StatusCode connectOutput(const std::string &outputFile, const std::string &openMode) override
Connect the output file to the service with open mode.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
long m_type
Conversion service type.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) override
Create a Generic address using explicit arguments to identify a single object.