All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IConverter Class Referenceabstract

The data converters are responsible to translate data from one representation into another. More...

#include <GaudiKernel/IConverter.h>

Inheritance diagram for IConverter:
Collaboration diagram for IConverter:

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 Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 

Public Member Functions

 DeclareInterfaceID (IConverter, 3, 0)
 InterfaceID. More...
 
virtual StatusCode initialize ()=0
 Initialize the converter. More...
 
virtual StatusCode finalize ()=0
 Terminate the converter. More...
 
virtual const CLIDobjType () const =0
 Retrieve the class type of objects the converter produces. More...
 
virtual long repSvcType () const =0
 Retrieve the class type of the data store the converter uses. More...
 
virtual StatusCode setDataProvider (IDataProviderSvc *pService)=0
 Set Data provider service. More...
 
virtual SmartIF
< IDataProviderSvc > & 
dataProvider () const =0
 Get Data provider service. More...
 
virtual StatusCode setConversionSvc (IConversionSvc *pService)=0
 Set conversion service the converter is connected to. More...
 
virtual SmartIF< IConversionSvc > & conversionSvc () const =0
 Get conversion service the converter is connected to. More...
 
virtual StatusCode setAddressCreator (IAddressCreator *creator)=0
 Set address creator facility. More...
 
virtual SmartIF
< IAddressCreator > & 
addressCreator () const =0
 Get address creation interface needed to resolve links between objects. More...
 
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)=0
 Create the transient representation of an object. More...
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0
 Resolve the references of the created transient object. More...
 
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)=0
 Update the transient object from the other representation. More...
 
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0
 Update the references of an updated transient object. More...
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)=0
 Convert the transient object to the requested representation. More...
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0
 Resolve the references of the converted object. More...
 
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)=0
 Update the converted representation of a transient object. More...
 
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)=0
 Update the references of an already converted object. More...
 
virtual ~IConverter ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::string > getInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

The data converters are responsible to translate data from one representation into another.

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

  • Answer (when asked) which kind of representation the converter is able to create.
  • Retrieve the source object from the source store.
  • Create the requested representation using the information contained in the source object.
  • Inform the registry entry of the created object that the object is now loaded.
  • This registry entry is located in the data store which is supposed to manage the requested object.
  • Register all leafs of the created object with the data store which is supposed to manage the requested object. Registering does not mean to create these representations, but rather to inform about the existence.

The interface should cover the entry points of concrete converter instances in order to serve conversion requests.

Author
Markus Frank
Version
1.0

Definition at line 57 of file IConverter.h.

Member Enumeration Documentation

Status code.

Enumerator
INVALID_ADDRESS 

Invalid address information.

INVALID_OBJECT 

Object to be converted is invalid.

NO_MEMORY 

No more memory available.

BAD_STORAGE_TYPE 

Invalid storage type.

NO_SOURCE_OBJECT 

Error retrieving source data from source store.

ICONVERSIONSVC_LAST_ERROR 

Last entry.

Definition at line 203 of file IConverter.h.

203  {
209  NO_MEMORY,
216  };
Invalid address information.
Definition: IConverter.h:205
Error retrieving source data from source store.
Definition: IConverter.h:213
Object to be converted is invalid.
Definition: IConverter.h:207
Invalid storage type.
Definition: IConverter.h:211
No more memory available.
Definition: IConverter.h:209

Constructor & Destructor Documentation

virtual IConverter::~IConverter ( )
inlinevirtual

Virtual destructor.

Definition at line 200 of file IConverter.h.

200 {}

Member Function Documentation

virtual SmartIF<IAddressCreator>& IConverter::addressCreator ( ) const
pure virtual

Get address creation interface needed to resolve links between objects.

Returns
Pointer to IAddressCreator interface

Implemented in PersistencySvc, ConversionSvc, and Converter.

virtual SmartIF<IConversionSvc>& IConverter::conversionSvc ( ) const
pure virtual

Get conversion service the converter is connected to.

Returns
Pointer to IConversionSvc interface

Implemented in PersistencySvc, ConversionSvc, and Converter.

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.

Returns
Status code indicating success or failure
Parameters
pAddressOpaque address information to retrieve the requested object from the store in order to produce the transient object.
refpObjectReference to location of pointer of the created object.

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootNTupleCnv, Gaudi::RootConverter, Converter, Gaudi::RootDatabaseCnv, Gaudi::RootDirectoryCnv, RootHistCnv::RHistogramCnv< T, S, Q >, RootHistCnv::RFileCnv, RootHistCnv::RNTupleCnv, RootHistCnv::DirectoryCnv, and RootHistCnv::RDirectoryCnv.

virtual StatusCode IConverter::createRep ( DataObject pObject,
IOpaqueAddress *&  refpAddress 
)
pure virtual

Convert the transient object to the requested representation.

e.g. conversion to persistent objects.

Returns
Status code indicating success or failure
Parameters
pObjectPointer to location of the object
refpAddressReference to location of pointer with the object address.

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootDirectoryCnv, Gaudi::RootConverter, Converter, Gaudi::RootNTupleCnv, HistogramPersistencySvc, RootHistCnv::RConverter, RootHistCnv::RFileCnv, RootHistCnv::RNTupleCnv, RootHistCnv::PersSvc, RootHistCnv::RDirectoryCnv, and RootHistCnv::DirectoryCnv.

virtual SmartIF<IDataProviderSvc>& IConverter::dataProvider ( ) const
pure virtual

Get Data provider service.

Returns
Pointer to data provider service

Implemented in PersistencySvc, ConversionSvc, and Converter.

IConverter::DeclareInterfaceID ( IConverter  ,
,
 
)
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.

Returns
Status code indicating success or failure
Parameters
pAddressOpaque address information to retrieve the requested object from the store.
pObjectPointer to location of the object

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootNTupleCnv, Gaudi::RootConverter, Converter, Gaudi::RootDirectoryCnv, and RootHistCnv::RDirectoryCnv.

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.

Returns
Status code indicating success or failure
Parameters
pObjectPointer to location of the object

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootDirectoryCnv, Gaudi::RootConverter, Gaudi::RootNTupleCnv, and Converter.

virtual StatusCode IConverter::finalize ( )
pure virtual

Terminate the converter.

Returns
Status code indicating success or failure
Exceptions
exception(STL standard) in case of fatal errors

Implemented in PersistencySvc, Gaudi::RootCnvSvc, ConversionSvc, HistogramPersistencySvc, Gaudi::RootStatCnv, EvtPersistencySvc, Converter, RootHistCnv::RNTupleCnv, RootHistCnv::PersSvc, and DetPersistencySvc.

virtual StatusCode IConverter::initialize ( )
pure virtual

Initialize the converter.

Returns
Status code indicating success or failure
Exceptions
exception(STL standard) in case of fatal errors

Implemented in PersistencySvc, Gaudi::RootCnvSvc, ConversionSvc, HistogramPersistencySvc, Gaudi::RootStatCnv, EvtPersistencySvc, Converter, RootHistCnv::RFileCnv, RootHistCnv::RNTupleCnv, RootHistCnv::PersSvc, and DetPersistencySvc.

virtual const CLID& IConverter::objType ( ) const
pure virtual

Retrieve the class type of objects the converter produces.

Returns
Class type of the created object.

Implemented in PersistencySvc, ConversionSvc, and Converter.

virtual long IConverter::repSvcType ( ) const
pure virtual

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

Returns
Class type information about the source data store type the converter will use to retrieve the information.

Implemented in PersistencySvc, ConversionSvc, Gaudi::RootConverter, and RootHistCnv::RConverter.

virtual StatusCode IConverter::setAddressCreator ( IAddressCreator creator)
pure virtual

Set address creator facility.

Parameters
creatorReference to address creator interface
Returns
Status code indicating success or failure.

Implemented in PersistencySvc, ConversionSvc, and Converter.

virtual StatusCode IConverter::setConversionSvc ( IConversionSvc pService)
pure virtual

Set conversion service the converter is connected to.

Returns
Status code indicating success or failure
Parameters
pServicePointer to IConversionSvc interface

Implemented in PersistencySvc, ConversionSvc, and Converter.

virtual StatusCode IConverter::setDataProvider ( IDataProviderSvc pService)
pure virtual

Set Data provider service.

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

Implemented in PersistencySvc, ConversionSvc, and Converter.

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.

Returns
Status code indicating success or failure
Parameters
pAddressOpaque address information to retrieve the requested object from the store.
pObjectPointer to the object to be updated.

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootNTupleCnv, Gaudi::RootDirectoryCnv, Converter, RootHistCnv::RHistogramCnv< T, S, Q >, and RootHistCnv::RNTupleCnv.

virtual StatusCode IConverter::updateObjRefs ( IOpaqueAddress pAddress,
DataObject pObject 
)
pure virtual

Update the references of an updated transient object.

After the object was updated also 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.

Returns
Status code indicating success or failure
Parameters
pAddressOpaque address information to retrieve the requested object from the store.
pObjectPointer to location of the object

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootNTupleCnv, Gaudi::RootDirectoryCnv, and Converter.

virtual StatusCode IConverter::updateRep ( IOpaqueAddress pAddress,
DataObject pObject 
)
pure virtual

Update the converted representation of a transient object.

Returns
Status code indicating success or failure
Parameters
pObjectPointer to location of the object
refpAddressReference to location of pointer with the object address.

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootNTupleCnv, Gaudi::RootDirectoryCnv, Converter, RootHistCnv::RFileCnv, RootHistCnv::RNTupleCnv, and RootHistCnv::RDirectoryCnv.

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.

Returns
Status code indicating success or failure
Parameters
pAddressPointer to location of object address with the store.
pObjectPointer to location of the object

Implemented in ConversionSvc, PersistencySvc, Gaudi::RootNTupleCnv, Gaudi::RootDirectoryCnv, and Converter.


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