The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Converter Class Reference

Converter base class. More...

#include <GaudiKernel/Converter.h>

Inheritance diagram for Converter:
Collaboration diagram for Converter:

Public Types

using Factory = Gaudi::PluginService::Factory<IConverter*( ISvcLocator* )>
 
- Public Types inherited from implements< IConverter >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
using iids
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 

Public Member Functions

StatusCode initialize () override
 Initialize the converter.
 
StatusCode finalize () override
 Initialize the converter.
 
StatusCode setDataProvider (IDataProviderSvc *svc) override
 Set Data provider service.
 
SmartIF< IDataProviderSvc > & dataProvider () const override
 Get Data provider service.
 
StatusCode setConversionSvc (IConversionSvc *svc) override
 Set conversion service the converter is connected to.
 
SmartIF< IConversionSvc > & conversionSvc () const override
 Get conversion service the converter is connected to.
 
StatusCode setAddressCreator (IAddressCreator *creator) override
 Set address creator facility.
 
SmartIF< IAddressCreator > & addressCreator () const override
 Retrieve address creator facility.
 
const CLIDobjType () const override
 Retrieve the class type of objects the converter produces.
 
virtual long i_repSvcType () const
 Retrieve the class type of the data store the converter uses.
 
StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) override
 Create the transient representation of an object.
 
StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Resolve the references of the created transient object.
 
StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) override
 Update the transient object from the other representation.
 
StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Update the references of an updated transient object.
 
StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) override
 Convert the transient object to the requested representation.
 
StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Resolve the references of the converted object.
 
StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject) override
 Update the converted representation of a transient object.
 
StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) override
 Update the references of an already converted object.
 
 Converter (long storage_type, const CLID &class_type, ISvcLocator *svc=0)
 Standard Constructor.
 
SmartIF< IServiceservice (const std::string &name, const bool createIf=true) const
 Return a pointer to the service identified by name (or "type/name")
 
- Public Member Functions inherited from implements< IConverter >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
 implements ()=default
 Default constructor.
 
 implements (const implements &)
 Copy constructor (zero the reference count)
 
implementsoperator= (const implements &)
 Assignment operator (do not touch the reference count).
 
unsigned long addRef () const override
 Reference Interface instance.
 
unsigned long release () const override
 Release Interface instance.
 
unsigned long refCount () const override
 Current reference count.
 

Protected Member Functions

SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator.
 
SmartIF< IMessageSvc > & msgSvc () const
 Retrieve pointer to message service.
 
SmartIF< IDataManagerSvc > & dataManager () const
 Get Data Manager service.
 
- Protected Member Functions inherited from implements< IConverter >
unsigned long decRef () const override
 

Private Attributes

long m_storageType
 Storage type.
 
const CLID m_classType
 Class type the converter can handle.
 
SmartIF< IAddressCreatorm_addressCreator
 Pointer to the address creation service interface.
 
SmartIF< IDataProviderSvcm_dataProvider
 Pointer to data provider service.
 
SmartIF< IDataManagerSvcm_dataManager
 Pointer to data manager service.
 
SmartIF< IConversionSvcm_conversionSvc
 Pointer to the connected conversion service.
 
SmartIF< ISvcLocatorm_svcLocator
 Service Locator reference.
 
SmartIF< IMessageSvcm_messageSvc
 MessageSvc reference.
 

Additional Inherited Members

- Protected Attributes inherited from implements< IConverter >
std::atomic_ulong m_refCount
 Reference counter.
 

Detailed Description

Converter base class.

See interface for detailed description, arguments and return values

Author
Markus Frank
Version
1.0

Definition at line 33 of file Converter.h.

Member Typedef Documentation

◆ Factory

using Converter::Factory = Gaudi::PluginService::Factory<IConverter*( ISvcLocator* )>

Definition at line 35 of file Converter.h.

Constructor & Destructor Documentation

◆ Converter()

Converter::Converter ( long storage_type,
const CLID & class_type,
ISvcLocator * svc = 0 )

Standard Constructor.

Definition at line 113 of file Converter.cpp.

114 : m_storageType( storage_type ), m_classType( class_type ), m_svcLocator( svc ) {}
const CLID m_classType
Class type the converter can handle.
Definition Converter.h:110
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
Definition Converter.h:120
long m_storageType
Storage type.
Definition Converter.h:108

Member Function Documentation

◆ addressCreator()

SmartIF< IAddressCreator > & Converter::addressCreator ( ) const
override

Retrieve address creator facility.

Access the transient store.

Definition at line 98 of file Converter.cpp.

98{ return m_addressCreator; }
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
Definition Converter.h:112

◆ conversionSvc()

SmartIF< IConversionSvc > & Converter::conversionSvc ( ) const
override

Get conversion service the converter is connected to.

Get data conversion service the converter is connected to.

Definition at line 89 of file Converter.cpp.

89{ return m_conversionSvc; }
SmartIF< IConversionSvc > m_conversionSvc
Pointer to the connected conversion service.
Definition Converter.h:118

◆ createObj()

StatusCode Converter::createObj ( IOpaqueAddress * pAddress,
DataObject *& refpObject )
override

Create the transient representation of an object.

Definition at line 28 of file Converter.cpp.

28{ return StatusCode::SUCCESS; }
constexpr static const auto SUCCESS
Definition StatusCode.h:99

◆ createRep()

StatusCode Converter::createRep ( DataObject * pObject,
IOpaqueAddress *& refpAddress )
override

Convert the transient object to the requested representation.

Definition at line 40 of file Converter.cpp.

40{ return StatusCode::SUCCESS; }

◆ dataManager()

SmartIF< IDataManagerSvc > & Converter::dataManager ( ) const
protected

Get Data Manager service.

Get data manager service.

Definition at line 80 of file Converter.cpp.

80{ return m_dataManager; }
SmartIF< IDataManagerSvc > m_dataManager
Pointer to data manager service.
Definition Converter.h:116

◆ dataProvider()

SmartIF< IDataProviderSvc > & Converter::dataProvider ( ) const
override

Get Data provider service.

Get data provider service.

Definition at line 77 of file Converter.cpp.

77{ return m_dataProvider; }
SmartIF< IDataProviderSvc > m_dataProvider
Pointer to data provider service.
Definition Converter.h:114

◆ fillObjRefs()

StatusCode Converter::fillObjRefs ( IOpaqueAddress * pAddress,
DataObject * pObject )
override

Resolve the references of the created transient object.

Definition at line 31 of file Converter.cpp.

31{ return StatusCode::SUCCESS; }

◆ fillRepRefs()

StatusCode Converter::fillRepRefs ( IOpaqueAddress * pAddress,
DataObject * pObject )
override

Resolve the references of the converted object.

Definition at line 43 of file Converter.cpp.

43{ return StatusCode::SUCCESS; }

◆ finalize()

StatusCode Converter::finalize ( )
override

Initialize the converter.

Finalize the converter.

Definition at line 59 of file Converter.cpp.

59 {
60 // release services
61 m_messageSvc = nullptr;
62 m_dataManager = nullptr;
63 m_dataProvider = nullptr;
64 m_conversionSvc = nullptr;
65 m_addressCreator = nullptr;
67}
SmartIF< IMessageSvc > m_messageSvc
MessageSvc reference.
Definition Converter.h:122

◆ i_repSvcType()

long Converter::i_repSvcType ( ) const
virtual

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

Definition at line 25 of file Converter.cpp.

25{ return m_storageType; }

◆ initialize()

StatusCode Converter::initialize ( )
override

Initialize the converter.

Definition at line 52 of file Converter.cpp.

52 {
53 // Get a reference to the Message Service
54 if ( !msgSvc() ) { return StatusCode::FAILURE; }
56}
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
constexpr static const auto FAILURE
Definition StatusCode.h:100

◆ msgSvc()

SmartIF< IMessageSvc > & Converter::msgSvc ( ) const
protected

Retrieve pointer to message service.

— Retrieve pointer to message service

Definition at line 104 of file Converter.cpp.

104 {
105 if ( !m_messageSvc ) {
107 if ( !m_messageSvc ) { throw GaudiException( "Service [MessageSvc] not found", "Converter", StatusCode::FAILURE ); }
108 }
109 return m_messageSvc;
110}
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.

◆ objType()

const CLID & Converter::objType ( ) const
override

Retrieve the class type of objects the converter produces.

Definition at line 22 of file Converter.cpp.

22{ return m_classType; }

◆ service()

SmartIF< IService > Converter::service ( const std::string & name,
const bool createIf = true ) const

Return a pointer to the service identified by name (or "type/name")

Definition at line 116 of file Converter.cpp.

116 {
117 SmartIF<INamedInterface> cnvsvc( conversionSvc() );
118 SmartIF<IService> svc;
119 if ( cnvsvc ) {
120 const ServiceLocatorHelper helper( *serviceLocator(), "Converter", cnvsvc->name() );
121 svc = helper.service( name, false, createIf );
122 }
123 return svc;
124}
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition Converter.cpp:89

◆ serviceLocator()

SmartIF< ISvcLocator > & Converter::serviceLocator ( ) const
protected

Retrieve pointer to service locator.

— Retrieve pointer to service locator

Definition at line 101 of file Converter.cpp.

101{ return m_svcLocator; }

◆ setAddressCreator()

StatusCode Converter::setAddressCreator ( IAddressCreator * creator)
override

Set address creator facility.

Definition at line 92 of file Converter.cpp.

92 {
95}
creator
Definition Write.py:23

◆ setConversionSvc()

StatusCode Converter::setConversionSvc ( IConversionSvc * svc)
override

Set conversion service the converter is connected to.

Definition at line 83 of file Converter.cpp.

83 {
84 m_conversionSvc = svc;
86}

◆ setDataProvider()

StatusCode Converter::setDataProvider ( IDataProviderSvc * svc)
override

Set Data provider service.

Set data provider service.

Definition at line 70 of file Converter.cpp.

70 {
71 m_dataProvider = svc;
72 m_dataManager = svc;
74}

◆ updateObj()

StatusCode Converter::updateObj ( IOpaqueAddress * pAddress,
DataObject * refpObject )
override

Update the transient object from the other representation.

Definition at line 34 of file Converter.cpp.

34{ return StatusCode::SUCCESS; }

◆ updateObjRefs()

StatusCode Converter::updateObjRefs ( IOpaqueAddress * pAddress,
DataObject * pObject )
override

Update the references of an updated transient object.

Definition at line 37 of file Converter.cpp.

37{ return StatusCode::SUCCESS; }

◆ updateRep()

StatusCode Converter::updateRep ( IOpaqueAddress * pAddress,
DataObject * pObject )
override

Update the converted representation of a transient object.

Definition at line 46 of file Converter.cpp.

46{ return StatusCode::SUCCESS; }

◆ updateRepRefs()

StatusCode Converter::updateRepRefs ( IOpaqueAddress * pAddress,
DataObject * pObject )
override

Update the references of an already converted object.

Definition at line 49 of file Converter.cpp.

49{ return StatusCode::SUCCESS; }

Member Data Documentation

◆ m_addressCreator

SmartIF<IAddressCreator> Converter::m_addressCreator
mutableprivate

Pointer to the address creation service interface.

Definition at line 112 of file Converter.h.

◆ m_classType

const CLID Converter::m_classType
private

Class type the converter can handle.

Definition at line 110 of file Converter.h.

◆ m_conversionSvc

SmartIF<IConversionSvc> Converter::m_conversionSvc
mutableprivate

Pointer to the connected conversion service.

Definition at line 118 of file Converter.h.

◆ m_dataManager

SmartIF<IDataManagerSvc> Converter::m_dataManager
mutableprivate

Pointer to data manager service.

Definition at line 116 of file Converter.h.

◆ m_dataProvider

SmartIF<IDataProviderSvc> Converter::m_dataProvider
mutableprivate

Pointer to data provider service.

Definition at line 114 of file Converter.h.

◆ m_messageSvc

SmartIF<IMessageSvc> Converter::m_messageSvc
mutableprivate

MessageSvc reference.

Definition at line 122 of file Converter.h.

◆ m_storageType

long Converter::m_storageType
private

Storage type.

Definition at line 108 of file Converter.h.

◆ m_svcLocator

SmartIF<ISvcLocator> Converter::m_svcLocator
mutableprivate

Service Locator reference.

Definition at line 120 of file Converter.h.


The documentation for this class was generated from the following files: