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