![]() |
|
|
Generated: 18 Jul 2008 |
#include <GaudiKernel/IConverter.h>
Inheritance diagram for IConverter:


Concrete examples are e.g. converters creating transient objects representing parts of an event from the persistent (and disk based) representations. Converters will have to deal with the technology both representations are based on: in the upper example they have to know about the database internals as well as the structure of the transient representations. The converters know about the mechanism to retrieve persistent objects (ZEBRA, Objectivity, ) and only pass abstract instances of the converted objects, hence shielding the calling service from internals.
Data converters are meant to be light. This means there should not be all-in-one converters, which are able to convert the "world", but rather many converters. Each converter is then able to create a representation of a given type.
In order to function a converter must be able to
The interface should cover the entry points of concrete converter instances in order to serve conversion requests.
Definition at line 61 of file IConverter.h.
Public Types | |
| enum | Status { INVALID_ADDRESS = IInterface::LAST_ERROR+1, INVALID_OBJECT, NO_MEMORY, BAD_STORAGE_TYPE, NO_SOURCE_OBJECT, ICONVERSIONSVC_LAST_ERROR } |
| Status code. More... | |
Public Member Functions | |
| virtual StatusCode | initialize ()=0 |
| Initialize the converter. | |
| virtual StatusCode | finalize ()=0 |
| Terminate the converter. | |
| virtual const CLID & | objType () const=0 |
| Retrieve the class type of objects the converter produces. | |
| virtual long | repSvcType () const=0 |
| Retrieve the class type of the data store the converter uses. | |
| virtual StatusCode | setDataProvider (IDataProviderSvc *pService)=0 |
| Set Data provider service. | |
| virtual IDataProviderSvc * | dataProvider () const=0 |
| Get Data provider service. | |
| virtual StatusCode | setConversionSvc (IConversionSvc *pService)=0 |
| Set conversion service the converter is connected to. | |
| virtual IConversionSvc * | conversionSvc () const=0 |
| Get conversion service the converter is connected to. | |
| virtual StatusCode | setAddressCreator (IAddressCreator *creator)=0 |
| Set address creator facility. | |
| virtual IAddressCreator * | addressCreator () const=0 |
| Get address creation interface needed to resolve links between objects. | |
| virtual StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)=0 |
| Create the transient representation of an object. | |
| virtual StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0 |
| Resolve the references of the created transient object. | |
| virtual StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)=0 |
| Update the transient object from the other representation. | |
| virtual StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0 |
| Update the references of an updated transient object. | |
| virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)=0 |
| Convert the transient object to the requested representation. | |
| virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0 |
| Resolve the references of the converted object. | |
| virtual StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject)=0 |
| Update the converted representation of a transient object. | |
| virtual StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0 |
| Update the references of an already converted object. | |
Static Public Member Functions | |
| static const InterfaceID & | interfaceID () |
| Retrieve interface ID. | |
| enum IConverter::Status |
Status code.
Reimplemented from IInterface.
Reimplemented in IConversionSvc.
Definition at line 204 of file IConverter.h.
00204 { 00206 INVALID_ADDRESS = IInterface::LAST_ERROR+1, 00208 INVALID_OBJECT, 00210 NO_MEMORY, 00212 BAD_STORAGE_TYPE, 00214 NO_SOURCE_OBJECT, 00216 ICONVERSIONSVC_LAST_ERROR 00217 };
| static const InterfaceID& IConverter::interfaceID | ( | ) | [inline, static] |
Retrieve interface ID.
Reimplemented from IInterface.
Reimplemented in IConversionSvc.
Definition at line 64 of file IConverter.h.
References IID_IConverter.
00064 { return IID_IConverter; }
| virtual StatusCode IConverter::initialize | ( | ) | [pure virtual] |
Initialize the converter.
| exception | (STL standard) in case of fatal errors |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbCnvSvc, DetPersistencySvc, EvtPersistencySvc, HistogramPersistencySvc, PersistencySvc, HbookCnv::HFileCnv, HbookCnv::HNTupleCnv, HbookCnv::PersSvc, RootHistCnv::PersSvc, and RootHistCnv::RNTupleCnv.
Referenced by ConversionSvc::initializeConverter().
| virtual StatusCode IConverter::finalize | ( | ) | [pure virtual] |
Terminate the converter.
| exception | (STL standard) in case of fatal errors |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbCnvSvc, DetPersistencySvc, EvtPersistencySvc, HistogramPersistencySvc, PersistencySvc, HbookCnv::HNTupleCnv, HbookCnv::PersSvc, RootHistCnv::PersSvc, and RootHistCnv::RNTupleCnv.
| virtual const CLID& IConverter::objType | ( | ) | const [pure virtual] |
Retrieve the class type of objects the converter produces.
Implemented in ConversionSvc, Converter, and PersistencySvc.
Referenced by ConversionSvc::addConverter().
| virtual long IConverter::repSvcType | ( | ) | const [pure virtual] |
Retrieve the class type of the data store the converter uses.
Implemented in ConversionSvc, PoolDbBaseCnv, PersistencySvc, HbookCnv::HConverter, and RootHistCnv::RConverter.
Referenced by PersistencySvc::addCnvService(), PersistencySvc::addConverter(), ConversionSvc::addConverter(), TagCollectionSvc::connect(), NTupleSvc::connect(), PersistencySvc::repSvcType(), and PersistencySvc::service().
| virtual StatusCode IConverter::setDataProvider | ( | IDataProviderSvc * | pService | ) | [pure virtual] |
Set Data provider service.
| pService | Pointer to data provider service |
Implemented in ConversionSvc, Converter, PoolDbCnvSvc, and PersistencySvc.
Referenced by PersistencySvc::addCnvService(), ConversionSvc::configureConverter(), NTupleSvc::createService(), MultiStoreSvc::setDataLoader(), and DataSvc::setDataLoader().
| virtual IDataProviderSvc* IConverter::dataProvider | ( | ) | const [pure virtual] |
Get Data provider service.
Implemented in ConversionSvc, Converter, and PersistencySvc.
| virtual StatusCode IConverter::setConversionSvc | ( | IConversionSvc * | pService | ) | [pure virtual] |
Set conversion service the converter is connected to.
| pService | Pointer to IConversionSvc interface |
Implemented in ConversionSvc, Converter, and PersistencySvc.
Referenced by ConversionSvc::configureConverter().
| virtual IConversionSvc* IConverter::conversionSvc | ( | ) | const [pure virtual] |
Get conversion service the converter is connected to.
Implemented in ConversionSvc, Converter, and PersistencySvc.
Referenced by PersistencySvc::addCnvService(), PersistencySvc::getService(), and PersistencySvc::service().
| virtual StatusCode IConverter::setAddressCreator | ( | IAddressCreator * | creator | ) | [pure virtual] |
Set address creator facility.
| creator | Reference to address creator interface |
Implemented in ConversionSvc, Converter, and PersistencySvc.
Referenced by PersistencySvc::addCnvService(), and ConversionSvc::configureConverter().
| virtual IAddressCreator* IConverter::addressCreator | ( | ) | const [pure virtual] |
Get address creation interface needed to resolve links between objects.
Implemented in ConversionSvc, Converter, and PersistencySvc.
| virtual StatusCode IConverter::createObj | ( | IOpaqueAddress * | pAddress, | |
| DataObject *& | refpObject | |||
| ) | [pure virtual] |
Create the transient representation of an object.
The transient representation is created by loading the persistent object using the source information contained in the address.
| pAddress | Opaque address information to retrieve the requested object from the store in order to produce the transient object. | |
| refpObject | Reference to location of pointer of the created object. |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDatabaseCnv, PoolDbDirectoryCnv, PoolDbNTupleCnv, PersistencySvc, HbookCnv::H1DCnv, HbookCnv::H2DCnv, HbookCnv::HDirectoryCnv, HbookCnv::HFileCnv, HbookCnv::HNTupleCnv, RootHistCnv::DirectoryCnv, RootHistCnv::RDirectoryCnv, RootHistCnv::RFileCnv, RootHistCnv::RHistogramCnv< T, S, Q >, and RootHistCnv::RNTupleCnv.
Referenced by DataSvc::loadObject(), PersistencySvc::makeCall(), and ConversionSvc::makeCall().
| virtual StatusCode IConverter::fillObjRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [pure virtual] |
Resolve the references of the created transient object.
After the object creation references of the objects pointing to objects outside its scope will have to be filled. The actual objects will not be loaded, but the recipe to load them will be present.
| pAddress | Opaque address information to retrieve the requested object from the store. | |
| pObject | Pointer to location of the object |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDirectoryCnv, PoolDbNTupleCnv, PersistencySvc, HbookCnv::HDirectoryCnv, and RootHistCnv::RDirectoryCnv.
Referenced by DataSvc::loadObject(), PersistencySvc::makeCall(), and ConversionSvc::makeCall().
| virtual StatusCode IConverter::updateObj | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | refpObject | |||
| ) | [pure virtual] |
Update the transient object from the other representation.
The transient representation will be updated by loading the persistent object using the source information contained in the address and then refill transient data.
| pAddress | Opaque address information to retrieve the requested object from the store. | |
| pObject | Pointer to the object to be updated. |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDirectoryCnv, PoolDbNTupleCnv, PersistencySvc, HbookCnv::H1DCnv, HbookCnv::H2DCnv, HbookCnv::HNTupleCnv, RootHistCnv::RHistogramCnv< T, S, Q >, and RootHistCnv::RNTupleCnv.
Referenced by PersistencySvc::makeCall(), ConversionSvc::makeCall(), NTupleSvc::readRecord(), and DataSvc::updateObject().
| virtual StatusCode IConverter::updateObjRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [pure virtual] |
Update the references of an updated transient object.
After the object was updated alse the references of the objects pointing to objects outside its scope will have to be filled. The actual pointers to objects will only be filled if already present. Otherwise only the recipe to load them will be present.
| pAddress | Opaque address information to retrieve the requested object from the store. | |
| pObject | Pointer to location of the object |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDirectoryCnv, PoolDbKeyedContainerCnv, PoolDbNTupleCnv, and PersistencySvc.
Referenced by PersistencySvc::makeCall(), ConversionSvc::makeCall(), NTupleSvc::readRecord(), and DataSvc::updateObject().
| virtual StatusCode IConverter::createRep | ( | DataObject * | pObject, | |
| IOpaqueAddress *& | refpAddress | |||
| ) | [pure virtual] |
Convert the transient object to the requested representation.
e.g. conversion to persistent objects.
| pObject | Pointer to location of the object | |
| refpAddress | Reference to location of pointer with the object address. |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDirectoryCnv, PoolDbNTupleCnv, HistogramPersistencySvc, PersistencySvc, HbookCnv::HConverter, HbookCnv::HDirectoryCnv, HbookCnv::HFileCnv, HbookCnv::HNTupleCnv, HbookCnv::PersSvc, RootHistCnv::DirectoryCnv, RootHistCnv::PersSvc, RootHistCnv::RConverter, RootHistCnv::RDirectoryCnv, RootHistCnv::RFileCnv, and RootHistCnv::RNTupleCnv.
Referenced by EventLoopMgr::finalize(), PersistencySvc::makeCall(), ConversionSvc::makeCall(), OutputStream::writeObjects(), and NTupleSvc::writeRecord().
| virtual StatusCode IConverter::fillRepRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [pure virtual] |
Resolve the references of the converted object.
After the requested representation was created the references in this representation must be resolved.
| pObject | Pointer to location of the object |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbNTupleCnv, PersistencySvc, and HbookCnv::PersSvc.
Referenced by EventLoopMgr::finalize(), PersistencySvc::makeCall(), ConversionSvc::makeCall(), OutputStream::writeObjects(), and NTupleSvc::writeRecord().
| virtual StatusCode IConverter::updateRep | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [pure virtual] |
Update the converted representation of a transient object.
| pObject | Pointer to location of the object | |
| refpAddress | Reference to location of pointer with the object address. |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDirectoryCnv, PoolDbNTupleCnv, PersistencySvc, HbookCnv::H1DCnv, HbookCnv::H2DCnv, HbookCnv::HDirectoryCnv, HbookCnv::HFileCnv, HbookCnv::HNTupleCnv, RootHistCnv::RDirectoryCnv, RootHistCnv::RFileCnv, and RootHistCnv::RNTupleCnv.
Referenced by PersistencySvc::makeCall(), ConversionSvc::makeCall(), NTupleSvc::save(), and NTupleSvc::updateDirectories().
| virtual StatusCode IConverter::updateRepRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [pure virtual] |
Update the references of an already converted object.
The object must be retrieved before it can be updated.
| pAddress | Pointer to location of object address with the store. | |
| pObject | Pointer to location of the object |
Implemented in ConversionSvc, Converter, PoolDbBaseCnv, PoolDbDirectoryCnv, PoolDbNTupleCnv, and PersistencySvc.
Referenced by PersistencySvc::makeCall(), ConversionSvc::makeCall(), NTupleSvc::save(), and NTupleSvc::updateDirectories().