00001 #ifndef TDemo_DB_Table_hxx_seen 00002 #define TDemo_DB_Table_hxx_seen 00003 00004 00005 00006 #include "TResultSetHandle.hxx" // Needed for TDemo_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 DEMO_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 00020 ///\endverbatim 00021 class TDemo_DB_Table : public TTableRow { 00022 00023 //using TObject::Print; 00024 using TTableRow::Fill; 00025 00026 public: 00027 00028 /// Required default constructor 00029 TDemo_DB_Table(); 00030 00031 /// Required copy constructor 00032 TDemo_DB_Table(const TDemo_DB_Table& from); 00033 00034 virtual ~TDemo_DB_Table(); 00035 00036 /// Standard Getters (here they just give access to the row's state but could 00037 /// equally well perform services based on that state e.g. apply calibration.) 00038 int GetChannelId() const { return fChannelId; } 00039 Int_t GetIParm1() const { return fIParm1;} 00040 Int_t GetIParm2() const { return fIParm2;} 00041 Int_t GetIParm3() const { return fIParm3;} 00042 Float_t GetFParm1() const { return fFParm1;} 00043 Float_t GetFParm2() const { return fFParm2;} 00044 Float_t GetFParm3() const { return fFParm3;} 00045 00046 /// Return unique "Natural Index" of row in table. Optional, the default is to return the row 00047 /// position, which is unique but arbitrary. 00048 virtual UInt_t GetIndex(UInt_t defIndex) const {return fChannelId;} 00049 00050 /// Required method to create new row. 00051 virtual TTableRow* MakeTableRow() const {return new TDemo_DB_Table;} 00052 00053 /// Required method to fill self from a ResultInputStream. 00054 virtual void Fill(TResultInputStream& ris); 00055 virtual void Print(const Option_t* = "") const; 00056 00057 private: 00058 00059 /// Channel ID 00060 int fChannelId; 00061 /// Integer parameters 00062 Int_t fIParm1, fIParm2, fIParm3; 00063 /// Floating point parameters 00064 Float_t fFParm1, fFParm2, fFParm3; 00065 00066 ClassDef(TDemo_DB_Table,1) 00067 00068 }; 00069 00070 #endif