00001 #ifndef TDBITABLEROW_H 00002 #define TDBITABLEROW_H 00003 00004 ////////////////////////////////////////////////////////////////////////// 00005 //////////////////////////// ROOT API //////////////////////////// 00006 ////////////////////////////////////////////////////////////////////////// 00007 00008 /** 00009 * 00010 * $Id: TDbiTableRow.hxx,v 1.2 2011/06/09 14:44:29 finch Exp $ 00011 * 00012 * \class TDbiTableRow 00013 * 00014 * 00015 * \brief 00016 * <b>Concept</b> Abstract interface to TableRow objects. Each database 00017 * table consists of a collection of TableRow objects. 00018 * 00019 * \brief 00020 * <b>Purpose</b> Provides a generic interface to TableRow objects permiting 00021 * much of the database machinery to be generic. 00022 * 00023 * \brief 00024 * <b>Subclass obligations</b> All subclasses must have public default 00025 * and constructors. 00026 * 00027 * \brief 00028 * <b>Program Notes</b> It inherits from TObject only so that it can get 00029 * the class name at execution time. 00030 * 00031 * Contact: A.Finch@lancaster.ac.uk 00032 * 00033 * 00034 */ 00035 00036 #include "TObject.h" 00037 #include <string> 00038 #include <cassert> 00039 00040 00041 class TDbiOutRowStream; 00042 class TDbiResultSet; 00043 class TDbiInRowStream; 00044 class TDbiTableProxy; 00045 class TDbiValidityRec; 00046 00047 class TDbiTableRow : public TObject 00048 { 00049 00050 public: 00051 00052 // Constructors and destructors. 00053 TDbiTableRow(); 00054 TDbiTableRow(const TDbiTableRow& from); 00055 virtual ~TDbiTableRow(); 00056 00057 // State testing member functions 00058 /// Replace this with a function returning true in order to use the level 2 disk cache. 00059 virtual Bool_t CanL2Cache() const { return kFALSE; } 00060 //virtual Bool_t CanL2Cache() const { return kTRUE; } //FOR TESTS 00061 00062 virtual Int_t GetAggregateNo() const { return -1; } 00063 TDbiResultSet* GetOwner() const { return fOwner; } 00064 virtual TDbiTableRow* CreateTableRow() const =0; 00065 virtual UInt_t GetIndex(UInt_t defIndex) const {return defIndex;} 00066 00067 // State modifying member functions 00068 void SetOwner(TDbiResultSet* owner) {fOwner = owner;} 00069 00070 // I/O member functions 00071 virtual void Fill(TDbiInRowStream& rs, 00072 const TDbiValidityRec* vrec) =0; 00073 virtual void Store(TDbiOutRowStream& /* ors */, 00074 const TDbiValidityRec* /* vrec */) const { assert(0); } 00075 00076 private: 00077 00078 // Data members 00079 00080 /// The owning TDbiResultSet, if any. 00081 TDbiResultSet * fOwner; 00082 00083 ClassDef(TDbiTableRow,0) // TDbiTableRow for a specific database table. 00084 00085 }; 00086 00087 00088 00089 #endif // TDBITABLEROW_H 00090