| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Converter Class Reference

Converter base class. More...

`#include <GaudiKernel/Converter.h>`

Inheritance diagram for Converter:
[legend]
Collaboration diagram for Converter:
[legend]

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

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

## Protected Member Functions
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator. More...
SmartIF< IMessageSvc > & | msgSvc () const
| Retrieve pointer to message service. More...
SmartIF< IDataManagerSvc > & | dataManager () const
| Get Data Manager service. More...

## Private Member Functions
StatusCode | service_i (const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
| implementation of service method More...
StatusCode | service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppSvc) const

## Private Attributes
long | m_storageType
| Storage type. More...
const CLID | m_classType
| Class type the converter can handle. More...
SmartIF< IAddressCreator > | m_addressCreator
| Pointer to the address creation service interface. More...
SmartIF< IDataProviderSvc > | m_dataProvider
| Pointer to data provider service. More...
SmartIF< IDataManagerSvc > | m_dataManager
| Pointer to data manager service. More...
SmartIF< IConversionSvc > | m_conversionSvc
| Pointer to the connected conversion service. More...
SmartIF< ISvcLocator > | m_svcLocator
| Service Locator reference. More...
SmartIF< IMessageSvc > | m_messageSvc
| MessageSvc reference. More...

## Additional Inherited Members
Protected Attributes inherited from implements< IConverter >
std::atomic_ulong | m_refCount
| Reference counter. More...

## Detailed Description

Converter base class.

See interface for detailed description, arguments and return values

Author
  Markus Frank

Version
  1.0

Definition at line 24 of file Converter.h.

## Member Typedef Documentation

## ◆ Factory

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

Definition at line 26 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 104 of file Converter.cpp.

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

## Member Function Documentation

## ◆ addressCreator()

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

Retrieve address creator facility.

Access the transient store.

Definition at line 89 of file Converter.cpp.

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

## ◆ 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 80 of file Converter.cpp.

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

## ◆ createObj()

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

Create the transient representation of an object.

Definition at line 19 of file Converter.cpp.

19 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ createRep()

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

Convert the transient object to the requested representation.

Definition at line 31 of file Converter.cpp.

31 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ dataManager()

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

Get Data Manager service.

Get data manager service.

Definition at line 71 of file Converter.cpp.

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

## ◆ dataProvider()

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

Get Data provider service.

Get data provider service.

Definition at line 68 of file Converter.cpp.

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

## ◆ fillObjRefs()

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

Resolve the references of the created transient object.

Definition at line 22 of file Converter.cpp.

22 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ fillRepRefs()

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

Resolve the references of the converted object.

Definition at line 34 of file Converter.cpp.

34 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ finalize()

StatusCode Converter::finalize | ( |  | ) |
| override

Initialize the converter.

Finalize the converter.

Definition at line 50 of file Converter.cpp.

50 {
51 // release services
52 m_messageSvc = nullptr;
53 m_dataManager = nullptr;
54 m_dataProvider = nullptr;
55 m_conversionSvc = nullptr;
56 m_addressCreator = nullptr;
57 return StatusCode::SUCCESS;
58 }
Converter::m_addressCreator
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
Definition: Converter.h:115
Converter::m_dataManager
SmartIF< IDataManagerSvc > m_dataManager
Pointer to data manager service.
Definition: Converter.h:119
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Converter::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
MessageSvc reference.
Definition: Converter.h:125
Converter::m_conversionSvc
SmartIF< IConversionSvc > m_conversionSvc
Pointer to the connected conversion service.
Definition: Converter.h:121
Converter::m_dataProvider
SmartIF< IDataProviderSvc > m_dataProvider
Pointer to data provider service.
Definition: Converter.h:117

## ◆ i_repSvcType()

long Converter::i_repSvcType | ( |  | ) | const
| virtual

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

Definition at line 16 of file Converter.cpp.

16 { return m_storageType; }
Converter::m_storageType
long m_storageType
Storage type.
Definition: Converter.h:111

## ◆ initialize()

StatusCode Converter::initialize | ( |  | ) |
| override

Initialize the converter.

Definition at line 43 of file Converter.cpp.

43 {
44 // Get a reference to the Message Service
45 if ( !msgSvc() ) { return StatusCode::FAILURE; }
46 return StatusCode::SUCCESS;
47 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Converter::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
Definition: Converter.cpp:95
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ msgSvc()

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

Retrieve pointer to message service.

— Retrieve pointer to message service

Definition at line 95 of file Converter.cpp.

95 {
96 if ( !m_messageSvc ) {
97 m_messageSvc = serviceLocator();
98 if ( !m_messageSvc ) { throw GaudiException( "Service [MessageSvc] not found", "Converter", StatusCode::FAILURE ); }
99 }
100 return m_messageSvc;
101 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
Converter::m_messageSvc
SmartIF< IMessageSvc > m_messageSvc
MessageSvc reference.
Definition: Converter.h:125
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Converter::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Converter.cpp:92

## ◆ objType()

const CLID & Converter::objType | ( |  | ) | const
| override

Retrieve the class type of objects the converter produces.

Definition at line 13 of file Converter.cpp.

13 { return m_classType; }
Converter::m_classType
const CLID m_classType
Class type the converter can handle.
Definition: Converter.h:113

## ◆ service() [1/3]

template<class T >

StatusCode Converter::service | ( | const std::string & | name,
|  | T *& | psvc,
|  | bool | createIf = `false`
| ) |  | const
| inline

Access a service by name, creating it if it doesn't already exist.

Definition at line 88 of file Converter.h.

88 {
89 return service_i( name, createIf, T::interfaceID(), (void**)&psvc );
90 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Converter::service_i
StatusCode service_i(const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: Converter.cpp:107

## ◆ service() [2/3]

template<class T >

StatusCode Converter::service | ( | const std::string & | type,
|  | const std::string & | name,
|  | T *& | psvc
| ) |  | const
| inline

Access a service by name, type creating it if it doesn't already exist.

Definition at line 94 of file Converter.h.

94 {
95 return service_i( type, name, T::interfaceID(), reinterpret_cast<void**>( &psvc ) );
96 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Converter::service_i
StatusCode service_i(const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: Converter.cpp:107
gaudirun.type
type
Definition: gaudirun.py:142

## ◆ service() [3/3]

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 129 of file Converter.cpp.

129 {
130 SmartIF<INamedInterface> cnvsvc( conversionSvc() );
131 SmartIF<IService> svc;
132 if ( cnvsvc ) {
133 const ServiceLocatorHelper helper( *serviceLocator(), "Converter", cnvsvc->name() );
134 svc = helper.service( name, false, createIf );
135 }
136 return svc;
137 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes
Definition: ServiceLocatorHelper.h:17
SmartIF< INamedInterface >
Converter::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition: Converter.cpp:80
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Converter::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Converter.cpp:92

## ◆ service_i() [1/2]

StatusCode Converter::service_i | ( | const std::string & | svcName,
|  | bool | createIf,
|  | const InterfaceID & | iid,
|  | void ** | ppSvc
| ) |  | const
| private

implementation of service method

Definition at line 107 of file Converter.cpp.

108 {
109 // Check for name of conversion service
110 SmartIF<INamedInterface> cnvsvc( conversionSvc() );
111 if ( cnvsvc ) {
112 const ServiceLocatorHelper helper( *serviceLocator(), "Converter", cnvsvc->name() );
113 return helper.getService( svcName, createIf, iid, ppSvc );
114 }
115 return StatusCode::FAILURE;
116 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes
Definition: ServiceLocatorHelper.h:17
SmartIF< INamedInterface >
Converter::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition: Converter.cpp:80
ServiceLocatorHelper::getService
StatusCode getService(const std::string &name, bool createIf, const InterfaceID &iid, void **ppSvc) const
Definition: ServiceLocatorHelper.h:41
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Converter::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Converter.cpp:92

## ◆ service_i() [2/2]

StatusCode Converter::service_i | ( | const std::string & | svcType,
|  | const std::string & | svcName,
|  | const InterfaceID & | iid,
|  | void ** | ppSvc
| ) |  | const
| private

Definition at line 118 of file Converter.cpp.

119 {
120 // Check for name of conversion service
121 SmartIF<INamedInterface> cnvsvc( conversionSvc() );
122 if ( cnvsvc ) {
123 const ServiceLocatorHelper helper( *serviceLocator(), "Converter", cnvsvc->name() );
124 return helper.createService( svcType, svcName, iid, ppSvc );
125 }
126 return StatusCode::FAILURE;
127 }
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes
Definition: ServiceLocatorHelper.h:17
SmartIF< INamedInterface >
Converter::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition: Converter.cpp:80
ServiceLocatorHelper::createService
StatusCode createService(const std::string &name, const InterfaceID &iid, void **ppSvc) const
Definition: ServiceLocatorHelper.cpp:21
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Converter::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Converter.cpp:92

## ◆ serviceLocator()

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

Retrieve pointer to service locator.

— Retrieve pointer to service locator

Definition at line 92 of file Converter.cpp.

92 { return m_svcLocator; }
Converter::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service Locator reference.
Definition: Converter.h:123

## ◆ setAddressCreator()

StatusCode Converter::setAddressCreator | ( | IAddressCreator * | creator | ) |
| override

Set address creator facility.

Definition at line 83 of file Converter.cpp.

83 {
84 m_addressCreator = creator;
85 return StatusCode::SUCCESS;
86 }
Converter::m_addressCreator
SmartIF< IAddressCreator > m_addressCreator
Pointer to the address creation service interface.
Definition: Converter.h:115
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ setConversionSvc()

StatusCode Converter::setConversionSvc | ( | IConversionSvc * | svc | ) |
| override

Set conversion service the converter is connected to.

Definition at line 74 of file Converter.cpp.

74 {
75 m_conversionSvc = svc;
76 return StatusCode::SUCCESS;
77 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Converter::m_conversionSvc
SmartIF< IConversionSvc > m_conversionSvc
Pointer to the connected conversion service.
Definition: Converter.h:121

## ◆ setDataProvider()

StatusCode Converter::setDataProvider | ( | IDataProviderSvc * | svc | ) |
| override

Set Data provider service.

Set data provider service.

Definition at line 61 of file Converter.cpp.

61 {
62 m_dataProvider = svc;
63 m_dataManager = svc;
64 return StatusCode::SUCCESS;
65 }
Converter::m_dataManager
SmartIF< IDataManagerSvc > m_dataManager
Pointer to data manager service.
Definition: Converter.h:119
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Converter::m_dataProvider
SmartIF< IDataProviderSvc > m_dataProvider
Pointer to data provider service.
Definition: Converter.h:117

## ◆ updateObj()

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

Update the transient object from the other representation.

Definition at line 25 of file Converter.cpp.

25 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ updateObjRefs()

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

Update the references of an updated transient object.

Definition at line 28 of file Converter.cpp.

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

## ◆ updateRep()

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

Update the converted representation of a transient object.

Definition at line 37 of file Converter.cpp.

37 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ updateRepRefs()

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

Update the references of an already converted object.

Definition at line 40 of file Converter.cpp.

40 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## Member Data Documentation

## ◆ m_addressCreator

SmartIF<IAddressCreator> Converter::m_addressCreator
| mutable private

Pointer to the address creation service interface.

Definition at line 115 of file Converter.h.

## ◆ m_classType

const CLID Converter::m_classType
| private

Class type the converter can handle.

Definition at line 113 of file Converter.h.

## ◆ m_conversionSvc

SmartIF<IConversionSvc> Converter::m_conversionSvc
| mutable private

Pointer to the connected conversion service.

Definition at line 121 of file Converter.h.

## ◆ m_dataManager

SmartIF<IDataManagerSvc> Converter::m_dataManager
| mutable private

Pointer to data manager service.

Definition at line 119 of file Converter.h.

## ◆ m_dataProvider

SmartIF<IDataProviderSvc> Converter::m_dataProvider
| mutable private

Pointer to data provider service.

Definition at line 117 of file Converter.h.

## ◆ m_messageSvc

SmartIF<IMessageSvc> Converter::m_messageSvc
| mutable private

MessageSvc reference.

Definition at line 125 of file Converter.h.

## ◆ m_storageType

long Converter::m_storageType
| private

Storage type.

Definition at line 111 of file Converter.h.

## ◆ m_svcLocator

SmartIF<ISvcLocator> Converter::m_svcLocator
| mutable private

Service Locator reference.

Definition at line 123 of file Converter.h.

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

- GaudiKernel/GaudiKernel/Converter.h
- GaudiKernel/src/Lib/Converter.cpp