00001 // $Id: DbiDemoData2.h,v 1.7 2003/05/01 11:50:28 west Exp $ 00002 00003 #ifndef DBIDEMODATA2_H 00004 #define DBIDEMODATA2_H 00005 00007 // DbiDemoData2 // 00008 // // 00009 // Package: Dbi (Database Interface). // 00010 // // 00011 // Concept: A concrete data type corresponding to a single row in a // 00012 // database table of aggregated data. // 00013 // // 00014 // Purpose: Example type for test and demonstration purposes. // 00015 // // 00016 // N. West 02/2001 // 00018 00019 #include "Rtypes.h" 00020 #include "DatabaseInterface/DbiTableRow.h" 00021 #include "LeakChecker/Lea.h" 00022 00023 class DbiValidityRec; 00024 00025 class DbiDemoData2 : public DbiTableRow 00026 { 00027 00028 using TObject::Compare; // So won't be hidden 00029 00030 public: 00031 00032 // Constructors and destructors. 00033 DbiDemoData2() { LEA_CTOR; } 00034 DbiDemoData2(const DbiDemoData2& from) 00035 : DbiTableRow(from) { LEA_CTOR; *this = from; } 00036 virtual ~DbiDemoData2(){ LEA_DTOR; }; 00037 00038 // State testing member functions 00039 Bool_t CanL2Cache() const { return kTRUE; } 00040 Bool_t Compare(const DbiDemoData2& that ) const { 00041 return fSubSystem == that.fSubSystem 00042 && fAggregateNo == that.fAggregateNo 00043 && fData == that.fData; } 00044 Int_t GetAggregateNo() const { return fAggregateNo; } 00045 UInt_t GetIndex(UInt_t /* defIndex */) const { return fSubSystem/10; } 00046 UInt_t GetSubSystem() const { return fSubSystem; } 00047 Float_t GetData() const { return fData; } 00048 00049 virtual DbiTableRow* CreateTableRow() const { 00050 return new DbiDemoData2; } 00051 00052 // I/O member functions 00053 virtual void Fill(DbiResultSet& rs, 00054 const DbiValidityRec* vrec); 00055 virtual void Store(DbiOutRowStream& ors, 00056 const DbiValidityRec* vrec) const; 00057 00058 00059 private: 00060 00061 // Data members 00062 00063 Int_t fAggregateNo; // Aggregate number 00064 Int_t fSubSystem; 00065 Float_t fData; 00066 00067 ClassDef(DbiDemoData2,0) // Example aggregated data type. 00068 00069 }; 00070 00071 #endif // DBIDEMODATA2_H
1.3.9.1