ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | List of all members
MuonCalibStreamCnvSvc Class Reference

#include <MuonCalibStreamCnvSvc.h>

Inheritance diagram for MuonCalibStreamCnvSvc:
Collaboration diagram for MuonCalibStreamCnvSvc:

Public Types

typedef std::unordered_map< CLID, WorkerEntryWorkers
 

Public Member Functions

 MuonCalibStreamCnvSvc (const std::string &name, ISvcLocator *svc)
 Standard constructor. More...
 
virtual ~MuonCalibStreamCnvSvc ()
 Standard Destructor. More...
 
virtual StatusCode initialize () override
 Initialize the service. More...
 
virtual StatusCode updateServiceState (IOpaqueAddress *pAddress) override
 Update state of the service. More...
 
virtual StatusCode finalize () override
 
@c IConversionSvc implementation
virtual long repSvcType () const override
 Retrieve the class type of the data store the converter uses. More...
 
virtual const CLIDobjType () const override
 Implementation of IConverter: dummy call. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *pService) override
 Implementation of IConverter: Set Data provider service. More...
 
virtual SmartIF< IDataProviderSvc > & dataProvider () const override
 Implementation of IConverter: Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *svc) override
 Implementation of IConverter: Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const override
 Implementation of IConverter: Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator) override
 Set address creator facility. More...
 
virtual SmartIF< IAddressCreator > & addressCreator () const override
 Retrieve address creator facility. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
 Implementation of IConverter: Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
 Implementation of IConverter: Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
 Implementation of IConverter: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the references of an already converted object. More...
 
virtual StatusCode addConverter (const CLID &clid) override
 Add converter object to conversion service. More...
 
virtual StatusCode addConverter (IConverter *pConverter) override
 Add converter object to conversion service. More...
 
virtual StatusCode removeConverter (const CLID &clid) override
 Remove converter object from conversion service (if present). More...
 
virtual IConverter * converter (const CLID &wanted) override
 Retrieve converter from list. More...
 
virtual StatusCode connectOutput (const std::string &outputFile, const std::string &openMode) override
 Connect the output file to the service with open mode. More...
 
virtual StatusCode connectOutput (const std::string &output) override
 Connect the output file to the service. More...
 
virtual StatusCode commitOutput (const std::string &output, bool do_commit) override
 Commit pending output. More...
 
virtual StatusCode disconnectOutput (const std::string &output)
 Disconnect output files from the service. More...
 
@c IConversionSvc implementation
virtual long repSvcType () const override
 Retrieve the class type of the data store the converter uses. More...
 
virtual const CLIDobjType () const override
 Implementation of IConverter: dummy call. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *pService) override
 Implementation of IConverter: Set Data provider service. More...
 
virtual SmartIF< IDataProviderSvc > & dataProvider () const override
 Implementation of IConverter: Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *svc) override
 Implementation of IConverter: Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const override
 Implementation of IConverter: Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator) override
 Set address creator facility. More...
 
virtual SmartIF< IAddressCreator > & addressCreator () const override
 Retrieve address creator facility. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
 Implementation of IConverter: Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
 Implementation of IConverter: Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
 Implementation of IConverter: Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Implementation of IConverter: Update the references of an already converted object. More...
 
virtual StatusCode addConverter (const CLID &clid) override
 Add converter object to conversion service. More...
 
virtual StatusCode addConverter (IConverter *pConverter) override
 Add converter object to conversion service. More...
 
virtual StatusCode removeConverter (const CLID &clid) override
 Remove converter object from conversion service (if present). More...
 
virtual IConverter * converter (const CLID &wanted) override
 Retrieve converter from list. More...
 
virtual StatusCode connectOutput (const std::string &outputFile, const std::string &openMode) override
 Connect the output file to the service with open mode. More...
 
virtual StatusCode connectOutput (const std::string &output) override
 Connect the output file to the service. More...
 
virtual StatusCode commitOutput (const std::string &output, bool do_commit) override
 Commit pending output. More...
 
virtual StatusCode disconnectOutput (const std::string &output)
 Disconnect output files from the service. More...
 

Protected Attributes

std::vector< std::string > m_initCnvs
 

@c IAddressCreator interface implementation

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
 
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. More...
 
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) override
 Convert an address in string form to object form. More...
 
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) override
 Convert an address to string form. More...
 
typedef std::recursive_mutex CallMutex
 Mutex to protect Converter creation. More...
 
virtual SmartIF< IAddressCreator > & addressCreator ()
 Retrieve address creation interface. More...
 
virtual IConverter * createConverter (long typ, const CLID &clid, const ICnvFactory *fac)
 Create new Converter using factory. 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)
 

Detailed Description

Definition at line 7 of file MuonCalibStreamCnvSvc.h.

Member Typedef Documentation

◆ CallMutex

typedef std::recursive_mutex AthCnvSvc::CallMutex
protectedinherited

Mutex to protect Converter creation.

Definition at line 320 of file AthCnvSvc.h.

◆ Workers

typedef std::unordered_map<CLID,WorkerEntry> AthCnvSvc::Workers
inherited

Definition at line 105 of file AthCnvSvc.h.

Constructor & Destructor Documentation

◆ MuonCalibStreamCnvSvc()

MuonCalibStreamCnvSvc::MuonCalibStreamCnvSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard constructor.

Definition at line 19 of file MuonCalibStreamCnvSvc.cxx.

19  :
20  AthCnvSvc(name, svc, MuonCalibStreamAddress::storageType()) //, m_calibEvent(nullptr)
21 {
22  m_initCnvs.push_back("xAOD::EventInfo");
23 
24  declareProperty("InitCnvs", m_initCnvs);
25 }

◆ ~MuonCalibStreamCnvSvc()

MuonCalibStreamCnvSvc::~MuonCalibStreamCnvSvc ( )
virtual

Standard Destructor.

Definition at line 28 of file MuonCalibStreamCnvSvc.cxx.

28 {}

Member Function Documentation

◆ activateConverter()

StatusCode AthCnvSvc::activateConverter ( long  typ,
const CLID clid,
IConverter *  cnv 
)
protectedvirtualinherited

Activate the new converter after initialization.

Definition at line 507 of file AthCnvSvc.cxx.

509 {
510  if (cnv) {
511  return StatusCode::SUCCESS;
512  }
513  return Status::NO_CONVERTER;
514 }

◆ addConverter() [1/2]

StatusCode AthCnvSvc::addConverter ( const CLID clid)
overridevirtualinherited

Add converter object to conversion service.

Definition at line 307 of file AthCnvSvc.cxx.

308 {
309  // First look for the more specific converter
310  long typ = repSvcType();
311  IConverter* pConverter = createConverter(typ, clid, 0);
312  if ( 0 != pConverter ) {
313  StatusCode status = configureConverter( typ, clid, pConverter );
314  if ( status.isSuccess() ) {
315  status = initializeConverter( typ, clid, pConverter );
316  if ( status.isSuccess() ) {
317  status = activateConverter( typ, clid, pConverter );
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 ) {
324  return addConverter(pConverter);
325  }
326  }
327  }
328  }
329  pConverter->release();
330  }
331  return Status::NO_CONVERTER;
332 }

◆ addConverter() [2/2]

StatusCode AthCnvSvc::addConverter ( IConverter *  pConverter)
overridevirtualinherited

Add converter object to conversion service.

Definition at line 336 of file AthCnvSvc.cxx.

337 {
338  if ( 0 != pConverter ) {
339  const CLID& clid = pConverter->objType();
340  removeConverter(clid).ignore();
341  m_workers.insert (std::make_pair(clid,WorkerEntry(clid, pConverter)));
342  pConverter->addRef();
343  return StatusCode::SUCCESS;
344  }
345  return Status::NO_CONVERTER;
346 }

◆ addressCreator() [1/2]

virtual SmartIF<IAddressCreator>& AthCnvSvc::addressCreator ( )
inlineprotectedvirtualinherited

Retrieve address creation interface.

Definition at line 297 of file AthCnvSvc.h.

298  {
299  return m_addressCreator;
300  }

◆ addressCreator() [2/2]

SmartIF< IAddressCreator > & AthCnvSvc::addressCreator ( ) const
overridevirtualinherited

Retrieve address creator facility.

Definition at line 232 of file AthCnvSvc.cxx.

233 {
234  // FIXME: Ideally the return type should be const, but that would require
235  // changes in the Gaudi IConverter base class.
236  SmartIF<IAddressCreator>& svc ATLAS_THREAD_SAFE =
237  const_cast<SmartIF<IAddressCreator>&>(m_addressCreator);
238  return svc;
239 }

◆ commitOutput()

StatusCode AthCnvSvc::commitOutput ( const std::string &  output,
bool  do_commit 
)
overridevirtualinherited

Commit pending output.

Definition at line 400 of file AthCnvSvc.cxx.

401 {
402  return StatusCode::SUCCESS;
403 }

◆ configureConverter()

StatusCode AthCnvSvc::configureConverter ( long  typ,
const CLID clid,
IConverter *  cnv 
)
protectedvirtualinherited

Configure the new converter before initialize is called.

Definition at line 481 of file AthCnvSvc.cxx.

483 {
484  if (cnv) {
485  cnv->setConversionSvc(this).ignore();
486  cnv->setAddressCreator(m_addressCreator).ignore();
487  cnv->setDataProvider(m_dataSvc).ignore();
488  return StatusCode::SUCCESS;
489  }
490  return Status::NO_CONVERTER;
491 
492 }

◆ connectOutput() [1/2]

StatusCode AthCnvSvc::connectOutput ( const std::string &  output)
overridevirtualinherited

Connect the output file to the service.

Definition at line 393 of file AthCnvSvc.cxx.

394 {
395  return StatusCode::SUCCESS;
396 }

◆ connectOutput() [2/2]

StatusCode AthCnvSvc::connectOutput ( const std::string &  outputFile,
const std::string &  openMode 
)
overridevirtualinherited

Connect the output file to the service with open mode.

Definition at line 385 of file AthCnvSvc.cxx.

387 {
388  return connectOutput (outputFile);
389 }

◆ conversionSvc()

SmartIF< IConversionSvc > & AthCnvSvc::conversionSvc ( ) const
overridevirtualinherited

Implementation of IConverter: Get conversion service the converter is connected to.

Definition at line 203 of file AthCnvSvc.cxx.

204 {
205  // FIXME: Ideally the return type should be const, but that would require
206  // changes in the Gaudi IConverter base class.
207  SmartIF<IConversionSvc>& svc ATLAS_THREAD_SAFE =
208  const_cast<SmartIF<IConversionSvc>&>(m_cnvSvc);
209  return svc;
210 }

◆ convertAddress()

StatusCode AthCnvSvc::convertAddress ( const IOpaqueAddress *  pAddress,
std::string &  refAddress 
)
overridevirtualinherited

Convert an address to string form.

Definition at line 430 of file AthCnvSvc.cxx.

432 {
433  refAddress = "";
434  return StatusCode::FAILURE;
435 }

◆ converter()

IConverter * AthCnvSvc::converter ( const CLID wanted)
overridevirtualinherited

Retrieve converter from list.

Definition at line 365 of file AthCnvSvc.cxx.

366 {
367  std::lock_guard<CallMutex> lock(m_conv_mut);
368  Workers::iterator worker = m_workers.find (clid);
369  if ( worker != m_workers.end() ) {
370  return worker->second.converter();
371  }
372  if (addConverter (clid).isSuccess()) {
373  worker = m_workers.find (clid);
374  if (worker != m_workers.end()) {
375  return worker->second.converter();
376  }
377  } else {
378  ATH_MSG_INFO("problem adding converter for CLID [" << clid << "]");
379  }
380  return 0;
381 }

◆ createAddress() [1/2]

StatusCode AthCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string &  refAddress,
IOpaqueAddress *&  refpAddress 
)
overridevirtualinherited

Convert an address in string form to object form.

Definition at line 439 of file AthCnvSvc.cxx.

443 {
444  refpAddress = 0;
445  return StatusCode::FAILURE;
446 }

◆ createAddress() [2/2]

StatusCode AthCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress 
)
overridevirtualinherited

Create a Generic address using explicit arguments to identify a single object.

Definition at line 418 of file AthCnvSvc.cxx.

423 {
424  refpAddress = 0;
425  return StatusCode::FAILURE;
426 }

◆ createConverter()

IConverter * AthCnvSvc::createConverter ( long  typ,
const CLID clid,
const ICnvFactory *  fac 
)
protectedvirtualinherited

Create new Converter using factory.

Definition at line 462 of file AthCnvSvc.cxx.

465 {
466 
467  std::unique_ptr<IConverter> cnv{Converter::Factory::create
468  (ConverterID(typ,clid), serviceLocator().get() )};
469 
470  if (!cnv) {
471  typ = (typ<0xFF) ? typ : typ&0xFFFFFF00;
472  cnv = Converter::Factory::create
473  (ConverterID(typ,clid), serviceLocator().get() );
474  }
475  return cnv.release();
476 
477 }

◆ createObj()

StatusCode AthCnvSvc::createObj ( IOpaqueAddress *  pAddress,
DataObject *&  refpObject 
)
overridevirtualinherited

Implementation of IConverter: Create the transient representation of an object.

Definition at line 244 of file AthCnvSvc.cxx.

245 {
246  return makeCall (CREATE_OBJ, false, true, false, pAddress, refpObject);
247 }

◆ createRep()

StatusCode AthCnvSvc::createRep ( DataObject *  pObject,
IOpaqueAddress *&  refpAddress 
)
overridevirtualinherited

Implementation of IConverter: Convert the transient object to the requested representation.

Definition at line 276 of file AthCnvSvc.cxx.

277 {
278  return makeCall (CREATE_REP, true, false, false, refpAddress, pObject);
279 }

◆ dataProvider()

SmartIF< IDataProviderSvc > & AthCnvSvc::dataProvider ( ) const
overridevirtualinherited

Implementation of IConverter: Get Data provider service.

Returns
Pointer to data provider service

Definition at line 183 of file AthCnvSvc.cxx.

184 {
185  // FIXME: Ideally the return type should be const, but that would require
186  // changes in the Gaudi IConverter base class.
187  SmartIF<IDataProviderSvc>& svc ATLAS_THREAD_SAFE =
188  const_cast<SmartIF<IDataProviderSvc>&>(m_dataSvc);
189  return svc;
190 }

◆ disconnectOutput()

StatusCode AthCnvSvc::disconnectOutput ( const std::string &  output)
virtualinherited

Disconnect output files from the service.

Definition at line 408 of file AthCnvSvc.cxx.

409 {
410  return StatusCode::SUCCESS;
411 }

◆ fillObjRefs()

StatusCode AthCnvSvc::fillObjRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
overridevirtualinherited

Implementation of IConverter: Resolve the references of the created transient object.

Definition at line 252 of file AthCnvSvc.cxx.

253 {
254  return makeCall (FILL_OBJ_REFS, false, true, true, pAddress, pObject);
255 }

◆ fillRepRefs()

StatusCode AthCnvSvc::fillRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
overridevirtualinherited

Implementation of IConverter: Resolve the references of the converted object.


Definition at line 284 of file AthCnvSvc.cxx.

285 {
286  return makeCall (FILL_REP_REFS, true, false, false, pAddress, pObject);
287 }

◆ finalize()

StatusCode AthCnvSvc::finalize ( )
overridevirtualinherited

Definition at line 112 of file AthCnvSvc.cxx.

113 {
114  ATH_MSG_DEBUG ("releasing all workers");
115  for ( Workers::iterator
116  i = m_workers.begin(),
117  iend = m_workers.end();
118  i != iend;
119  ++i ) {
120  if (!i->second.converter()->finalize().isSuccess()) {
121  ATH_MSG_ERROR ("finalizing worker w/ clid=[" << i->first << "]");
122  }
123  i->second.converter()->release();
124  }
125  //m_workers.clear();
126  Workers().swap (m_workers);
127 
128  if (m_addressCreator) m_addressCreator->addRef();
129  if (m_dataSvc) m_dataSvc->addRef();
130  if (m_cnvSvc) m_cnvSvc->addRef();
131 
132  m_addressCreator = 0;
133  m_dataSvc = 0;
134  m_cnvSvc = 0;
135 
136  return StatusCode::SUCCESS;
137 }

◆ initialize()

StatusCode MuonCalibStreamCnvSvc::initialize ( )
overridevirtual

Initialize the service.

Reimplemented from AthCnvSvc.

Definition at line 31 of file MuonCalibStreamCnvSvc.cxx.

31  {
32  ATH_MSG_INFO("Initializing MuonCalibStreamCnvSvc");
33 
35 
36  SmartIF<IClassIDSvc> clidSvc{service("ClassIDSvc")};
37  ATH_CHECK( clidSvc.isValid() );
38 
39  // Initialize the converters
40  std::vector<std::string>::const_iterator it = m_initCnvs.begin();
41  std::vector<std::string>::const_iterator it_e = m_initCnvs.end();
42  for (; it != it_e; ++it) {
43  CLID id;
44  ATH_MSG_DEBUG(" Try to obtain CLID for " << (*it));
45  ATH_CHECK(clidSvc->getIDOfTypeName(*it, id));
46 
47  ATH_MSG_DEBUG(" " << *it << " has CLID " << id);
48  IConverter *cnv = converter(id);
49  if (!cnv) {
50  ATH_MSG_WARNING(" Cannot get converter for " << (*it));
51  } else {
52  ATH_MSG_DEBUG(" Converter " << cnv->objType() << " for " << (*it));
53  }
54  }
55  return StatusCode::SUCCESS;
56 }

◆ initializeConverter()

StatusCode AthCnvSvc::initializeConverter ( long  typ,
const CLID clid,
IConverter *  cnv 
)
protectedvirtualinherited

Initialize the new converter.

Definition at line 496 of file AthCnvSvc.cxx.

498 {
499  if (cnv) {
500  return cnv->initialize();
501  }
502  return Status::NO_CONVERTER;
503 }

◆ loadConverter()

void AthCnvSvc::loadConverter ( DataObject *  pObject)
protectedvirtualinherited

Load converter or dictionary needed by the converter.

Definition at line 518 of file AthCnvSvc.cxx.

519 {
520 }

◆ makeCall()

StatusCode AthCnvSvc::makeCall ( int  typ,
bool  ignore_add,
bool  ignore_obj,
bool  update,
IOpaqueAddress *&  pAddress,
DataObject *&  pObject 
)
protectedinherited

Definition at line 524 of file AthCnvSvc.cxx.

530 {
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)
536  ? pAddress->clID()
537  : CLID_NULL;
538  IConverter* cnv = converter(obj_class);
539  if ( !cnv && pObject ) {
540  //Give it a try to autoload the class (dictionary) for which the converter is needed
541  loadConverter( pObject);
542  cnv = converter(obj_class);
543  }
544 
545  StatusCode status(StatusCode::FAILURE);
546  if ( 0 != cnv ) {
547  switch(typ) {
548  case CREATE_OBJ:
549  status = cnv->createObj(pAddress, pObject);
550  break;
551  case FILL_OBJ_REFS:
552  status = cnv->fillObjRefs(pAddress, pObject);
553  break;
554  case UPDATE_OBJ:
555  status = cnv->updateObj(pAddress, pObject);
556  break;
557  case UPDATE_OBJ_REFS:
558  status = cnv->updateObjRefs(pAddress, pObject);
559  break;
560  case CREATE_REP:
561  status = cnv->createRep(pObject, pAddress);
562  break;
563  case FILL_REP_REFS:
564  status = cnv->fillRepRefs(pAddress, pObject);
565  break;
566  case UPDATE_REP:
567  status = cnv->updateRep(pAddress, pObject);
568  break;
569  case UPDATE_REP_REFS:
570  status = cnv->updateRepRefs(pAddress, pObject);
571  break;
572  default:
573  status = StatusCode::FAILURE;
574  break;
575  }
576  if ( status.isSuccess() && update ) {
577  status = updateServiceState(pAddress);
578  }
579  return status;
580  }
581  status.ignore();
582  msg(MSG::INFO) << "No converter for object ";
583  if ( pObject != 0 ) {
584  msg(MSG::INFO) << System::typeinfoName(typeid(*pObject));
585  }
586  msg(MSG::INFO) << " CLID= " << obj_class << endmsg;
587  return Status::NO_CONVERTER;
588  }
589  return Status::INVALID_OBJECT;
590  }
591  return Status::INVALID_ADDRESS;
592 }

◆ objType()

const CLID & AthCnvSvc::objType ( ) const
overridevirtualinherited

Implementation of IConverter: dummy call.

Definition at line 150 of file AthCnvSvc.cxx.

151 {
152  return CLID_NULL;
153 }

◆ removeConverter()

StatusCode AthCnvSvc::removeConverter ( const CLID clid)
overridevirtualinherited

Remove converter object from conversion service (if present).

Definition at line 350 of file AthCnvSvc.cxx.

351 {
352  Workers::iterator worker = m_workers.find (clid);
353  if ( worker != m_workers.end() ) {
354  worker->second.converter()->finalize().ignore();
355  worker->second.converter()->release();
356 
357  m_workers.erase (worker);
358  return StatusCode::SUCCESS;
359  }
360  return Status::NO_CONVERTER;
361 }

◆ repSvcType()

long AthCnvSvc::repSvcType ( ) const
overridevirtualinherited

Retrieve the class type of the data store the converter uses.

Definition at line 143 of file AthCnvSvc.cxx.

144 {
145  return m_type;
146 }

◆ setAddressCreator()

StatusCode AthCnvSvc::setAddressCreator ( IAddressCreator *  creator)
overridevirtualinherited

Set address creator facility.

Definition at line 214 of file AthCnvSvc.cxx.

215 {
216  m_addressCreator = creator;
219  for(Workers::iterator i=start; i != stop; ++i ) {
220  IConverter* cnv = i->second.converter();
221  if ( 0 != cnv ) {
222  if (cnv->setAddressCreator(m_addressCreator).isFailure()) {
223  ATH_MSG_ERROR ("setting Address Creator");
224  }
225  }
226  }
227  return StatusCode::SUCCESS;
228 }

◆ setConversionSvc()

StatusCode AthCnvSvc::setConversionSvc ( IConversionSvc *  svc)
overridevirtualinherited

Implementation of IConverter: Set conversion service the converter is connected to.

Definition at line 195 of file AthCnvSvc.cxx.

196 {
197  return StatusCode::FAILURE;
198 }

◆ setDataProvider()

StatusCode AthCnvSvc::setDataProvider ( IDataProviderSvc *  pDataSvc)
overridevirtualinherited

Implementation of IConverter: Set Data provider service.

Returns
Status code indicating success or failure
Parameters
pServicePointer to data provider service

Definition at line 160 of file AthCnvSvc.cxx.

161 {
162  if ( !pDataSvc ) return StatusCode::SUCCESS; //Atlas does not use DataSvc
163  if ( m_dataSvc ) m_dataSvc->release();
164  m_dataSvc = pDataSvc;
165  m_dataSvc->addRef();
168  for(Workers::iterator i=start; i != stop; ++i ) {
169  IConverter* cnv = i->second.converter();
170  if ( 0 != cnv ) {
171  if (cnv->setDataProvider(m_dataSvc).isFailure()) {
172  ATH_MSG_ERROR ("setting Data Provider");
173  }
174  }
175  }
176  return StatusCode::SUCCESS;
177 }

◆ updateObj()

StatusCode AthCnvSvc::updateObj ( IOpaqueAddress *  pAddress,
DataObject *  refpObject 
)
overridevirtualinherited

Implementation of IConverter: Update the transient object from the other representation.

Definition at line 260 of file AthCnvSvc.cxx.

261 {
262  return makeCall (UPDATE_OBJ, false, true, false, pAddress, pObject);
263 }

◆ updateObjRefs()

StatusCode AthCnvSvc::updateObjRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
overridevirtualinherited

Implementation of IConverter: Update the references of an updated transient object.

Definition at line 268 of file AthCnvSvc.cxx.

269 {
270  return makeCall (UPDATE_OBJ_REFS, false, true, true, pAddress, pObject);
271 }

◆ updateRep()

StatusCode AthCnvSvc::updateRep ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
overridevirtualinherited

Implementation of IConverter: Update the converted representation of a transient object.

Definition at line 292 of file AthCnvSvc.cxx.

293 {
294  return makeCall (UPDATE_REP, true, false, false, pAddress, pObject);
295 }

◆ updateRepRefs()

StatusCode AthCnvSvc::updateRepRefs ( IOpaqueAddress *  pAddress,
DataObject *  pObject 
)
overridevirtualinherited

Implementation of IConverter: Update the references of an already converted object.

Definition at line 300 of file AthCnvSvc.cxx.

301 {
302  return makeCall (UPDATE_REP_REFS, true, false, false, pAddress, pObject);
303 }

◆ updateServiceState()

StatusCode MuonCalibStreamCnvSvc::updateServiceState ( IOpaqueAddress *  pAddress)
overridevirtual

Update state of the service.

Reimplemented from AthCnvSvc.

Definition at line 59 of file MuonCalibStreamCnvSvc.cxx.

59  {
60  if (pAddress != 0) {
61  GenericAddress *pAddr = dynamic_cast<GenericAddress *>(pAddress);
62  if (pAddr != 0) { return StatusCode::SUCCESS; }
63  }
64  return StatusCode::FAILURE;
65 }

Member Data Documentation

◆ m_addressCreator

SmartIF<IAddressCreator> AthCnvSvc::m_addressCreator
protectedinherited

Pointer to the address creation service interface.

Definition at line 312 of file AthCnvSvc.h.

◆ m_cnvSvc

SmartIF<IConversionSvc> AthCnvSvc::m_cnvSvc
protectedinherited

Pointer to the IConversionSvc interface of this.

Definition at line 314 of file AthCnvSvc.h.

◆ m_conv_mut

CallMutex AthCnvSvc::m_conv_mut
protectedinherited

Definition at line 321 of file AthCnvSvc.h.

◆ m_dataSvc

SmartIF<IDataProviderSvc> AthCnvSvc::m_dataSvc
protectedinherited

Pointer to data provider service.

Definition at line 310 of file AthCnvSvc.h.

◆ m_initCnvs

std::vector<std::string> MuonCalibStreamCnvSvc::m_initCnvs
protected

Definition at line 18 of file MuonCalibStreamCnvSvc.h.

◆ m_type

long AthCnvSvc::m_type
protectedinherited

Conversion service type.

Definition at line 316 of file AthCnvSvc.h.

◆ m_workers

Workers AthCnvSvc::m_workers
protectedinherited

List of conversion workers.

Definition at line 318 of file AthCnvSvc.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AthCnvSvc::makeCall
StatusCode makeCall(int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
Definition: AthCnvSvc.cxx:524
AthCnvSvc::addConverter
virtual StatusCode addConverter(const CLID &clid) override
Add converter object to conversion service.
Definition: AthCnvSvc.cxx:307
UPDATE_REP
@ UPDATE_REP
Definition: AthCnvSvc.cxx:36
CREATE_REP
@ CREATE_REP
Definition: AthCnvSvc.cxx:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCnvSvc::m_conv_mut
CallMutex m_conv_mut
Definition: AthCnvSvc.h:321
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
AthCnvSvc::activateConverter
virtual StatusCode activateConverter(long typ, const CLID &clid, IConverter *cnv)
Activate the new converter after initialization.
Definition: AthCnvSvc.cxx:507
AthCnvSvc::updateServiceState
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress)
Update state of the service.
Definition: AthCnvSvc.cxx:450
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthCnvSvc::m_addressCreator
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
Definition: AthCnvSvc.h:312
FILL_OBJ_REFS
@ FILL_OBJ_REFS
Definition: AthCnvSvc.cxx:31
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
AthCnvSvc::AthCnvSvc
AthCnvSvc()
Default constructor:
AthCnvSvc::removeConverter
virtual StatusCode removeConverter(const CLID &clid) override
Remove converter object from conversion service (if present).
Definition: AthCnvSvc.cxx:350
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
AthCnvSvc::configureConverter
virtual StatusCode configureConverter(long typ, const CLID &clid, IConverter *cnv)
Configure the new converter before initialize is called.
Definition: AthCnvSvc.cxx:481
UPDATE_REP_REFS
@ UPDATE_REP_REFS
Definition: AthCnvSvc.cxx:37
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Athena::typeinfoName
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
Definition: AthenaKernel/src/ClassName.cxx:23
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonCalibStreamCnvSvc::m_initCnvs
std::vector< std::string > m_initCnvs
Definition: MuonCalibStreamCnvSvc.h:18
AthCnvSvc::m_cnvSvc
SmartIF< IConversionSvc > m_cnvSvc
Pointer to the IConversionSvc interface of this.
Definition: AthCnvSvc.h:314
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthCnvSvc::m_workers
Workers m_workers
List of conversion workers.
Definition: AthCnvSvc.h:318
AthCnvSvc::initializeConverter
virtual StatusCode initializeConverter(long typ, const CLID &clid, IConverter *cnv)
Initialize the new converter.
Definition: AthCnvSvc.cxx:496
MuonCalibStreamAddress::storageType
static constexpr long storageType()
Definition: MuonCalibStreamAddress.h:25
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
UPDATE_OBJ_REFS
@ UPDATE_OBJ_REFS
Definition: AthCnvSvc.cxx:33
AthCnvSvc::createConverter
virtual IConverter * createConverter(long typ, const CLID &clid, const ICnvFactory *fac)
Create new Converter using factory.
Definition: AthCnvSvc.cxx:462
AthCnvSvc::converter
virtual IConverter * converter(const CLID &wanted) override
Retrieve converter from list.
Definition: AthCnvSvc.cxx:365
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
AthCnvSvc::loadConverter
virtual void loadConverter(DataObject *pObject)
Load converter or dictionary needed by the converter.
Definition: AthCnvSvc.cxx:518
AthCnvSvc::Workers
std::unordered_map< CLID, WorkerEntry > Workers
Definition: AthCnvSvc.h:105
AthCnvSvc::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
Definition: AthCnvSvc.h:310
AthCnvSvc::repSvcType
virtual long repSvcType() const override
Retrieve the class type of the data store the converter uses.
Definition: AthCnvSvc.cxx:143
merge.status
status
Definition: merge.py:17
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
AthCnvSvc::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition: AthCnvSvc.cxx:104
FILL_REP_REFS
@ FILL_REP_REFS
Definition: AthCnvSvc.cxx:35
AthCnvSvc::connectOutput
virtual StatusCode connectOutput(const std::string &outputFile, const std::string &openMode) override
Connect the output file to the service with open mode.
Definition: AthCnvSvc.cxx:385
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67
CREATE_OBJ
@ CREATE_OBJ
Definition: AthCnvSvc.cxx:30
AthCnvSvc::m_type
long m_type
Conversion service type.
Definition: AthCnvSvc.h:316
UPDATE_OBJ
@ UPDATE_OBJ
Definition: AthCnvSvc.cxx:32