Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdb2RooNTupleConverter< P, R, P_ELEMENT_CONVERSION_RULES, R_ELEMENT_CONVERSION_RULES > Class Template Reference

The converter for Cdb N-Tuples. More...

#include <CdbBdb2RooNTupleConverter.hh>

Inheritance diagram for CdbBdb2RooNTupleConverter< P, R, P_ELEMENT_CONVERSION_RULES, R_ELEMENT_CONVERSION_RULES >:

CdbBdb2RooPayloadConverter< P, R > CdbRooConverterBase List of all members.

Public Member Functions

 CdbBdb2RooNTupleConverter ()
 Default constructor.


Protected Member Functions

virtual CdbStatus userDefinedConversion (const BdbRef(BdbObject)&theInputObjectRef, R *&theOutputObjectPtr) const
 Implement a user-defined conversion.


Detailed Description

template<class P, class R, class P_ELEMENT_CONVERSION_RULES = CdbBdbNTupleConversionReverseRules_Default< typename P::ElementType >, class R_ELEMENT_CONVERSION_RULES = CdbRooNTupleConversionReverseRules_Default< typename R::ElementType >>
class CdbBdb2RooNTupleConverter< P, R, P_ELEMENT_CONVERSION_RULES, R_ELEMENT_CONVERSION_RULES >

The converter for Cdb N-Tuples.

This class represents a family of converters based on types of persistent classes passed as template parameters.

The parameters of the template are:

'P' - the input "Bdb" object type. This type should be a model of CDB persistent N-Tuples based on an abstract interface of the CdbBdbNTupleP class.

'R' - the output "Roo" object type. The actual type has to be a model of the 'CdbRooNTupleR< R::element_type >' class.

'P_ELEMENT_CONVERSION_RULES' - rules for converting a persistent element type into its transient counterpart for the "Bdb" technology.

'R_ELEMENT_CONVERSION_RULES' - rules for converting a persistent element type into its transient counterpart for the "Roo" technology.

Tests for a compatibility of actual types used as template parameters will be be performed both at a compilation and run time.

By default the converter will be using default conversion rules for element types, which is good for elementary types. For complex user defined types the corresponding element type converters must be provided.

CLASS DESIGN NOTES:

1. The persistent type verification is performed by the direct base class of the converter and in the c-tor of the current class (for a compliance with the model of Generic N-tuples).

2. All (but the default) class's constructors, its assignment operator, and its destructor are generated automatically by a C++ compiler. They're all public.

3. Two element conversion rules (one for each technology) are needed to avoid knowing direct element type conversion rules like:

P::ElementType -> R::ElementType

We're replacing this with an indirect (through a common transient) type conversion chain:

P::ElementType -> T -> R::ElementType

See more details in the implementation file of the class.

See also:
class CdbBdb2RooPayloadConverter

class CdbBdbNTupleConversionReverseRules_Default

class CdbRooNTupleConversionReverseRules_Default

Definition at line 71 of file CdbBdb2RooNTupleConverter.hh.


Constructor & Destructor Documentation

template<class P, class R, class P_ELEMENT_CONVERSION_RULES, class R_ELEMENT_CONVERSION_RULES>
CdbBdb2RooNTupleConverter< P, R, P_ELEMENT_CONVERSION_RULES, R_ELEMENT_CONVERSION_RULES >::CdbBdb2RooNTupleConverter  
 

Default constructor.

It will perform additional type checking for the specified persistent types.

Definition at line 40 of file CdbBdb2RooNTupleConverter.cc.

References CdbBdbSchemaUtils::instance(), CdbBdbSchemaUtils::isA(), and CdbBdbSchemaUtils::typeNumberToClassName().


Member Function Documentation

template<class P, class R, class P_ELEMENT_CONVERSION_RULES, class R_ELEMENT_CONVERSION_RULES>
CdbStatus CdbBdb2RooNTupleConverter< P, R, P_ELEMENT_CONVERSION_RULES, R_ELEMENT_CONVERSION_RULES >::userDefinedConversion const BdbRef(BdbObject)&    theInputObjectRef,
R *&    theOutputObjectPtr
const [protected, virtual]
 

Implement a user-defined conversion.

Implements the corresponding method from the base class or interface.

See also:
CdbRooConverterBase::userDefinedConversion()

Implements CdbBdb2RooPayloadConverter< P, R >.

Definition at line 96 of file CdbBdb2RooNTupleConverter.cc.

References BdbRef(), CdbStatus::Error, and CdbStatus::Success.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:17 2005 for CDB by doxygen1.3-rc3