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

CdbBdb2RooPayloadConversionFwk.hh

Go to the documentation of this file.
00001 #ifndef CDBROOCONVERSIONFWK_BDB_2_ROO_PAYLOAD_CONVERSION_FWK_HH
00002 #define CDBROOCONVERSIONFWK_BDB_2_ROO_PAYLOAD_CONVERSION_FWK_HH
00003 
00004 // File and Version Information:
00005 //      $Id: CdbBdb2RooPayloadConversionFwk.hh,v 1.4 2005/11/11 02:07:41 gapon Exp $
00006 
00007 #include "CdbBase/CdbCPtr.hh"
00008 
00009 #include <Rtypes.h>
00010 
00011 #include <vector>
00012 
00013 class CdbRooConverterBase;
00014 class CdbBdb2RooPayloadConvertersDict;
00015 class CdbRooConverterDict;
00016 
00017 /// A simplified interface to the "payload" conversion framework.
00018 /**
00019   * More details...
00020   */
00021 class CdbBdb2RooPayloadConversionFwk {
00022 
00023 public:
00024 
00025   /// Modify the current value of the "verbose" mode
00026   /**
00027     * The method will also return the previous value of the mode.
00028     */
00029     static bool setVerbose( bool newModeFlag );
00030 
00031   /// Modify the current value of the "debug" mode
00032   /**
00033     * The method will also return the previous value of the mode.
00034     */
00035     static bool setDebug( bool newModeFlag );
00036 
00037   /// Modify the current value of the "doNotCompress" mode
00038   /**
00039     * The method will also return the previous value of the mode.
00040     */
00041     static bool setDoNotCompress( bool newModeFlag );
00042 
00043   /// Register a converter
00044   /**
00045     * The operation if successfull will return CdbStatus::Success. Other values will
00046     * be treated as errors.
00047     */
00048     static CdbStatus registerConverter( const CdbCPtr< CdbRooConverterBase >& thePtr );
00049     static CdbStatus registerConverters( const std::vector< CdbCPtr< CdbRooConverterDict > >& theDicts);
00050 
00051   /// Start a test conversion in a context of the specified MetaData
00052   /**
00053     * Test using the "regular" (as opposed to "merging") converters.
00054     */
00055     static CdbStatus testConversion( UShort_t theOriginId,
00056                                      UShort_t theConditionId,
00057                                      bool     isPartitionableFlag,
00058                                      UShort_t thePartitionId,
00059                                      UShort_t theClusterId,
00060                                      UShort_t theIncrementId );
00061 
00062   /// Start a test conversion in a context of the specified MetaData
00063   /**
00064     * Test using the "merging" (as opposed to "regular") converters.
00065     */
00066     static CdbStatus testConversion( UShort_t                     theOriginId,
00067                                      const std::vector<UShort_t>& theConditionId,
00068                                      bool                         isPartitionableFlag,
00069                                      UShort_t                     thePartitionId,
00070                                      UShort_t                     theClusterId,
00071                                      UShort_t                     theIncrementId );
00072 
00073   /// Start the definition file driven conversion
00074   /**
00075     * The method will run the conversion using the specified "defition file" and converters
00076     * registered using the above defined method. The definition file maps conditions
00077     * onto persistent classes of the corresponding "payload" objects. Only those conditions
00078     * whose converters are registered at a time when the conversion start would be converted.
00079     *
00080     * Note, this method will employ both "regular" and "merging" converters. A proper
00081     * parameterization which converter to use for which condition(s) is done via
00082     * the definition file.
00083     *
00084     * The operation if successfull will return CdbStatus::Success. Other values will
00085     * be treated as errors.
00086     *
00087     * @see CdbBdb2RooPayloadConversionFwk::registerConverter()
00088     */
00089     static CdbStatus doConversion( const char* theDefinitionFileName );
00090 
00091 private:
00092 
00093   /// Convert objects in the context of the specified MetaData
00094   /**
00095     * This is a regular conversion version. It uses "regular" (as opposed to "merging")
00096     * converters.
00097     */
00098     static  CdbStatus convertMetadata( UShort_t theOriginId,
00099                                        UShort_t theConditionId,
00100                                        bool     isPartitionableFlag,
00101                                        UShort_t thePartitionId,
00102                                        UShort_t theClusterId,
00103                                        UShort_t theIncrementId );
00104 
00105   /// Convert objects in the context of the specified MetaData
00106   /**
00107     * This is a regular conversion version. It uses "merging" (as opposed to "regular")
00108     * converters.
00109     */
00110     static  CdbStatus convertMetadata( UShort_t                     theOriginId,
00111                                        const std::vector<UShort_t>& theConditionId,
00112                                        bool                         isPartitionableFlag,
00113                                        UShort_t                     thePartitionId,
00114                                        UShort_t                     theClusterId,
00115                                        UShort_t                     theIncrementId );
00116 
00117   /// A dictionary of regular "one-to-one" converters
00118 
00119     static CdbBdb2RooPayloadConvertersDict* regularConvertersDict( );
00120 
00121   /// A dictionary of merging "many-to-one" converters
00122 
00123     static CdbBdb2RooPayloadConvertersDict* mergingConvertersDict( );
00124 
00125 private:
00126 
00127     static bool verboseModeFlag;        // default value: true
00128     static bool debugModeFlag;          // default value: false
00129     static bool doNotCompressModeFlag;  // default value: false
00130 };
00131 
00132 #endif  // CDBROOCONVERSIONFWK_BDB_2_ROO_PAYLOAD_CONVERSION_FWK_HH

Generated on Mon Dec 5 18:21:59 2005 for CDB by doxygen1.3-rc3