00001 #ifndef DBIVALRECSET 00002 #define DBIVALRECSET 00003 00004 /** 00005 * 00006 * $Id: TDbiValRecSet.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $ 00007 * 00008 * \class TDbiValRecSet 00009 * 00010 * 00011 * \brief 00012 * <b>Concept</b> A set of TDbiValidityRecs 00013 * 00014 * \brief 00015 * <b>Purpose</b> Provides a sequential access mechanism for an entire 00016 * table via its auxillary Validity Range table 00017 * 00018 * Contact: A.Finch@lancaster.ac.uk 00019 * 00020 * 00021 */ 00022 00023 #include <map> 00024 #include <string> 00025 00026 00027 class TDbiResultSet; 00028 class TDbiValidityRec; 00029 00030 class TDbiValRecSet 00031 { 00032 00033 public: 00034 00035 // Constructors and destructors. 00036 TDbiValRecSet(const string& tableName,UInt_t dbNo,UInt_t seqNo=0); 00037 virtual ~TDbiValRecSet(); 00038 00039 // State testing member functions 00040 UInt_t GetDbNo() const { return fDbNo; } 00041 UInt_t GetNumRows() const; 00042 const string GetTableName() const; 00043 const TDbiValidityRec* GetTableRow(UInt_t rowNum) const; 00044 const TDbiValidityRec* GetTableRowBySeqNo(UInt_t seqNo) const; 00045 00046 // State changing member functions 00047 00048 private: 00049 00050 // Data members 00051 00052 //// Database number used to fill 00053 UInt_t fDbNo; 00054 00055 /// Result holding table of TDbiValidityRec 00056 TDbiResultSet* fResult; 00057 00058 /// Lookup SeqNo -> TDbiValidityRec 00059 /// lazy creation - see GetTableRowBySeqNo 00060 mutable map<UInt_t,const TDbiValidityRec*>fSeqNoToRec; 00061 00062 ClassDef(TDbiValRecSet,0) // A set of TDbiValidityRecs 00063 00064 }; 00065 00066 00067 00068 #endif // DBIVALRECSET 00069