00001 #ifndef TDemo2_DB_Table_hxx_seen 00002 #define TDemo2_DB_Table_hxx_seen 00003 00004 00005 00006 #include "TResultSetHandle.hxx" // Needed for TDemo2_DB_Table_LinkDef.hxx 00007 #include "TTableRow.hxx" 00008 00009 00010 ///\verbatim 00011 /// This is an example TTableRow subclass used to read rows of 00012 /// demonstration DEMO2_DB_TABLE. It can be used as the starting point 00013 /// for other subclasses. 00014 /// 00015 /// For table XXX_YYY (all tables names are upper case) the corresponding TTableRow subclass is 00016 /// 00017 /// ND::TXxx_Yyy (arbitrary capitalisation). 00018 /// 00019 /// This is a demonstration table row. It is the same structure as DEMO_DB_TABLE, just for 00020 /// a different demonstration. 00021 ///\endverbatim 00022 class TDemo2_DB_Table : public TTableRow { 00023 00024 //using TObject::Print; 00025 using TTableRow::Fill; 00026 00027 public: 00028 00029 /// Required default constructor 00030 TDemo2_DB_Table(); 00031 00032 /// Required copy constructor 00033 TDemo2_DB_Table(const TDemo2_DB_Table& from); 00034 00035 virtual ~TDemo2_DB_Table(); 00036 00037 /// Standard Getters (here they just give access to the row's state but could 00038 /// equally well perform services based on that state e.g. apply calibration.) 00039 int GetChannelId() const { return fChannelId; } 00040 Int_t GetIParm1() const { return fIParm1;} 00041 Int_t GetIParm2() const { return fIParm2;} 00042 Int_t GetIParm3() const { return fIParm3;} 00043 Float_t GetFParm1() const { return fFParm1;} 00044 Float_t GetFParm2() const { return fFParm2;} 00045 Float_t GetFParm3() const { return fFParm3;} 00046 00047 /// Return unique "Natural Index" of row in table. Optional, the default is to return the row 00048 /// position, which is unique but arbitrary. 00049 virtual UInt_t GetIndex(UInt_t defIndex) const {return fChannelId;} 00050 00051 /// Required method to create new row. 00052 virtual TTableRow* MakeTableRow() const {return new TDemo2_DB_Table;} 00053 00054 /// Required method to fill self from a ResultInputStream. 00055 virtual void Fill(TResultInputStream& ris); 00056 virtual void Print(const Option_t* = "") const; 00057 00058 private: 00059 00060 /// Channel ID 00061 int fChannelId; 00062 /// Integer parameters 00063 Int_t fIParm1, fIParm2, fIParm3; 00064 /// Floating point parameters 00065 Float_t fFParm1, fFParm2, fFParm3; 00066 00067 ClassDef(TDemo2_DB_Table,1) 00068 00069 }; 00070 00071 #endif