#include <TDemo_DB_Table.hxx>
Public Member Functions | |
TDemo_DB_Table () | |
Required default constructor. | |
TDemo_DB_Table (const TDemo_DB_Table &from) | |
Required copy constructor. | |
virtual | ~TDemo_DB_Table () |
int | GetChannelId () const |
Int_t | GetIParm1 () const |
Int_t | GetIParm2 () const |
Int_t | GetIParm3 () const |
Float_t | GetFParm1 () const |
Float_t | GetFParm2 () const |
Float_t | GetFParm3 () const |
virtual UInt_t | GetIndex (UInt_t defIndex) const |
virtual TTableRow * | MakeTableRow () const |
Required method to create new row. | |
virtual void | Fill (TResultInputStream &ris) |
Required method to fill self from a ResultInputStream. | |
virtual void | Print (const Option_t *="") const |
virtual TDbiTableRow * | CreateTableRow () const |
virtual void | Fill (TDbiInRowStream &rs, const TDbiValidityRec *vrec) |
const char * | GetName () const |
Return class name but strip off leading "T". | |
virtual Bool_t | CanL2Cache () const |
Replace this with a function returning true in order to use the level 2 disk cache. | |
virtual Int_t | GetAggregateNo () const |
TDbiResultSet * | GetOwner () const |
void | SetOwner (TDbiResultSet *owner) |
virtual void | Store (TDbiOutRowStream &, const TDbiValidityRec *) const |
Private Attributes | |
int | fChannelId |
Channel ID. | |
Int_t | fIParm1 |
Integer parameters. | |
Int_t | fIParm2 |
Int_t | fIParm3 |
Float_t | fFParm1 |
Floating point parameters. | |
Float_t | fFParm2 |
Float_t | fFParm3 |
This is an example TTableRow subclass used to read rows of demonstration DEMO_DB_TABLE. It can be used as the starting point for other subclasses. For table XXX_YYY (all tables names are upper case) the corresponding TTableRow subclass is ND::TXxx_Yyy (arbitrary capitalisation). This is a demonstration table row
Definition at line 21 of file TDemo_DB_Table.hxx.
TDemo_DB_Table::TDemo_DB_Table | ( | ) |
Required default constructor.
Definition at line 24 of file TDemo_DB_Table.cxx.
References SK_DBI_Trace.
00024 { 00025 00026 // Default constructor 00027 00028 SK_DBI_Trace("TDemo_DB_Table: Default ctor at:" << (void*) this); 00029 00030 }
TDemo_DB_Table::TDemo_DB_Table | ( | const TDemo_DB_Table & | from | ) |
Required copy constructor.
Definition at line 35 of file TDemo_DB_Table.cxx.
References SK_DBI_Trace.
00035 { 00036 00037 // Copy constructor 00038 00039 SK_DBI_Trace("TDemo_DB_Table: Copy ctor at:" << (void*) this); 00040 00041 *this = from; 00042 00043 }
TDemo_DB_Table::~TDemo_DB_Table | ( | ) | [virtual] |
Definition at line 47 of file TDemo_DB_Table.cxx.
References SK_DBI_Trace.
00047 { 00048 00049 // Destructor 00050 00051 SK_DBI_Trace("TDemo_DB_Table: dtor at:" << (void*) this); 00052 00053 }
virtual Bool_t TDbiTableRow::CanL2Cache | ( | ) | const [inline, virtual, inherited] |
Replace this with a function returning true in order to use the level 2 disk cache.
Definition at line 59 of file TDbiTableRow.hxx.
virtual TDbiTableRow* TTableRow::CreateTableRow | ( | ) | const [inline, virtual, inherited] |
Implements TDbiTableRow.
Definition at line 25 of file TTableRow.hxx.
References TTableRow::MakeTableRow().
00025 { return this->MakeTableRow();}
virtual void TTableRow::Fill | ( | TDbiInRowStream & | rs, | |
const TDbiValidityRec * | vrec | |||
) | [inline, virtual, inherited] |
Implements TDbiTableRow.
Definition at line 27 of file TTableRow.hxx.
00027 { 00028 TResultInputStream ris(rs); 00029 this->Fill(ris); 00030 }
void TDemo_DB_Table::Fill | ( | TResultInputStream & | ris | ) | [virtual] |
Required method to fill self from a ResultInputStream.
This method is used to fill a row. A ResultInputStream is an object with operator >> methods for most basic types.
Individual data items are read from it in the order in which they appear in the database table but notice that the first two rows (SEQNO and ROW_COUNTER) which are not part of the row's state, do not have to be skipped.
Also notice how the row state can include objects even though the stored state can only store basic types. E_CHAN_ID is stored as a MySQL INT but is used to fill a TTFBChannelId.
Reimplemented from TTableRow.
Definition at line 57 of file TDemo_DB_Table.cxx.
References fChannelId, fFParm1, fFParm2, fFParm3, fIParm1, fIParm2, and fIParm3.
00057 { 00058 00059 /// This method is used to fill a row. A ResultInputStream is an object 00060 /// with operator >> methods for most basic types. 00061 /// 00062 /// Individual data items are read from it in the order in which they 00063 /// appear in the database table but notice that the first two rows (SEQNO 00064 /// and ROW_COUNTER) which are not part of the row's state, do not have to 00065 /// be skipped. 00066 /// 00067 /// Also notice how the row state can include objects even though the 00068 /// stored state can only store basic types. E_CHAN_ID is stored as a 00069 /// MySQL INT but is used to fill a TTFBChannelId. 00070 00071 00072 UInt_t id; 00073 ris >> id >> fIParm1 >> fIParm2 >> fIParm3 >> fFParm1 >> fFParm2 >> fFParm3; 00074 fChannelId = id; 00075 00076 }
virtual Int_t TDbiTableRow::GetAggregateNo | ( | ) | const [inline, virtual, inherited] |
Reimplemented in TDbiConfigSet, TDbiLogEntry, and TDbiValidityRec.
Definition at line 62 of file TDbiTableRow.hxx.
Referenced by TDbiResultSet::BuildLookUpTable().
int TDemo_DB_Table::GetChannelId | ( | ) | const [inline] |
Standard Getters (here they just give access to the row's state but could equally well perform services based on that state e.g. apply calibration.)
Definition at line 38 of file TDemo_DB_Table.hxx.
References fChannelId.
00038 { return fChannelId; }
Float_t TDemo_DB_Table::GetFParm1 | ( | ) | const [inline] |
Float_t TDemo_DB_Table::GetFParm2 | ( | ) | const [inline] |
Float_t TDemo_DB_Table::GetFParm3 | ( | ) | const [inline] |
virtual UInt_t TDemo_DB_Table::GetIndex | ( | UInt_t | defIndex | ) | const [inline, virtual] |
Return unique "Natural Index" of row in table. Optional, the default is to return the row position, which is unique but arbitrary.
Reimplemented from TDbiTableRow.
Definition at line 48 of file TDemo_DB_Table.hxx.
References fChannelId.
00048 {return fChannelId;}
Int_t TDemo_DB_Table::GetIParm1 | ( | ) | const [inline] |
Int_t TDemo_DB_Table::GetIParm2 | ( | ) | const [inline] |
Int_t TDemo_DB_Table::GetIParm3 | ( | ) | const [inline] |
const char* TTableRow::GetName | ( | ) | const [inline, inherited] |
Return class name but strip off leading "T".
Definition at line 38 of file TTableRow.hxx.
00038 { 00039 const char* name = TObject::GetName(); 00040 if ( strncmp("",name,4) == 0 ) name += 4; 00041 if ( strncmp("T", name,1) == 0 ) name += 1; 00042 return name; 00043 }
TDbiResultSet* TDbiTableRow::GetOwner | ( | ) | const [inline, inherited] |
Definition at line 63 of file TDbiTableRow.hxx.
References TDbiTableRow::fOwner.
Referenced by TDbiResultSet::BuildLookUpTable(), and TDbiResultSetAgg::GetValidityRec().
00063 { return fOwner; }
virtual TTableRow* TDemo_DB_Table::MakeTableRow | ( | ) | const [inline, virtual] |
Required method to create new row.
Implements TTableRow.
Definition at line 51 of file TDemo_DB_Table.hxx.
00051 {return new TDemo_DB_Table;}
void TDemo_DB_Table::Print | ( | const Option_t * | = "" |
) | const [virtual] |
Definition at line 80 of file TDemo_DB_Table.cxx.
References fChannelId, fFParm1, fFParm2, fFParm3, fIParm1, fIParm2, fIParm3, and SK_DBI_Log.
Referenced by main().
00080 { 00081 00082 // Programming note: The arg isn't used but is there so as to avoid compiler 00083 // warnings about hidden method TObject::Print(const Option_t*). 00084 00085 SK_DBI_Log("DEMO_DB_TABLE row for channel " << fChannelId 00086 << " integer parms: " << fIParm1 << "," << fIParm2 << "," << fIParm3 00087 << " floating point parms " << fFParm1 << "," << fFParm2 << "," << fFParm3 ); 00088 00089 }
void TDbiTableRow::SetOwner | ( | TDbiResultSet * | owner | ) | [inline, inherited] |
Definition at line 68 of file TDbiTableRow.hxx.
References TDbiTableRow::fOwner.
Referenced by ClassImp().
00068 {fOwner = owner;}
virtual void TDbiTableRow::Store | ( | TDbiOutRowStream & | , | |
const TDbiValidityRec * | ||||
) | const [inline, virtual, inherited] |
Reimplemented in TDbiConfigSet, and TDbiLogEntry.
Definition at line 73 of file TDbiTableRow.hxx.
Referenced by TDbiSqlValPacket::AddRow().
int TDemo_DB_Table::fChannelId [private] |
Channel ID.
Definition at line 60 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetChannelId(), GetIndex(), and Print().
Float_t TDemo_DB_Table::fFParm1 [private] |
Floating point parameters.
Definition at line 64 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetFParm1(), and Print().
Float_t TDemo_DB_Table::fFParm2 [private] |
Definition at line 64 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetFParm2(), and Print().
Float_t TDemo_DB_Table::fFParm3 [private] |
Definition at line 64 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetFParm3(), and Print().
Int_t TDemo_DB_Table::fIParm1 [private] |
Integer parameters.
Definition at line 62 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetIParm1(), and Print().
Int_t TDemo_DB_Table::fIParm2 [private] |
Definition at line 62 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetIParm2(), and Print().
Int_t TDemo_DB_Table::fIParm3 [private] |
Definition at line 62 of file TDemo_DB_Table.hxx.
Referenced by Fill(), GetIParm3(), and Print().