Concept A concrete data type corresponding to a single row in a database table of configuration data. More...
#include <TDbiConfigSet.hxx>
Classes | |
struct | Param |
Internal structure used by TDbiCfgDialog to store Name/Value/Type triplets. More... | |
Public Member Functions | |
virtual | ~TDbiConfigSet () |
virtual TDbiTableRow * | CreateTableRow () const |
Int_t | GetAggregateNo () const |
UInt_t | GetNumParams () const |
string | GetParamName (UInt_t parNo) const |
TDbiFieldType | GetParamType (UInt_t parNo) const |
string | GetParamValue (UInt_t parNo) const |
void | Clear (const Option_t *="") |
void | PushBack (const string &name, const string &value, const TDbiFieldType &type) |
Purpose: Add another entry to the end of the existing row. | |
void | SetAggregateNo (Int_t aggNo) |
virtual void | Fill (TDbiInRowStream &rs, const TDbiValidityRec *vrec) |
virtual void | Store (TDbiOutRowStream &ors, const TDbiValidityRec *vrec) const |
virtual Bool_t | CanL2Cache () const |
Replace this with a function returning true in order to use the level 2 disk cache. | |
TDbiResultSet * | GetOwner () const |
virtual UInt_t | GetIndex (UInt_t defIndex) const |
void | SetOwner (TDbiResultSet *owner) |
Private Attributes | |
vector< Param * > | fParams |
Int_t | fAggregateNo |
Concept A concrete data type corresponding to a single row in a database table of configuration data.
Purpose Table row proxy for all Config data. Contact: A.Finch@lancaster.ac.uk
Definition at line 44 of file TDbiConfigSet.hxx.
TDbiConfigSet::~TDbiConfigSet | ( | ) | [virtual] |
Definition at line 36 of file TDbiConfigSet.cxx.
References fParams.
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.
void TDbiConfigSet::Clear | ( | const Option_t * | = "" |
) | [inline] |
Definition at line 63 of file TDbiConfigSet.hxx.
References fParams.
Referenced by TDbiConfigStream::operator<<().
00063 { fParams.clear(); }
virtual TDbiTableRow* TDbiConfigSet::CreateTableRow | ( | ) | const [inline, virtual] |
Implements TDbiTableRow.
Definition at line 54 of file TDbiConfigSet.hxx.
00054 { 00055 return new TDbiConfigSet; }
void TDbiConfigSet::Fill | ( | TDbiInRowStream & | rs, | |
const TDbiValidityRec * | vrec | |||
) | [virtual] |
Purpose: Fill object from Result Set Arguments: rs in Result Set used to fill object vrec in Associated validity record (or 0 if filling TDbiValidityRec) Return: Contact: N. West Specification:- ============= o Fill object from current (and only) row of Result Set.
Implements TDbiTableRow.
Definition at line 107 of file TDbiConfigSet.cxx.
References TDbiRowStream::CurColFieldType(), TDbiRowStream::CurColName(), TDbiInRowStream::CurColValue(), fAggregateNo, fParams, TDbiValidityRec::GetAggregateNo(), TDbiRowStream::IncrementCurCol(), TDbiConfigSet::Param::Name, TDbiRowStream::NumCols(), TDbiConfigSet::Param::Type, and TDbiConfigSet::Param::Value.
00108 { 00109 00110 // Program Notes:- 00111 // ============= 00112 00113 // None. 00114 00115 00116 // Don't count leading SeqNo or ROW_COUNTER, they have already been skipped. 00117 UInt_t numParams = rs.NumCols()-2; 00118 00119 for (UInt_t iParam = 0; iParam < numParams; ++iParam ) { 00120 Param* par = new Param; 00121 par->Name = rs.CurColName(); 00122 par->Value = rs.CurColValue(); 00123 par->Type = rs.CurColFieldType(); 00124 00125 fParams.push_back(par); 00126 rs.IncrementCurCol(); 00127 } 00128 00129 fAggregateNo = vrec->GetAggregateNo (); 00130 00131 }
Int_t TDbiConfigSet::GetAggregateNo | ( | ) | const [inline, virtual] |
Reimplemented from TDbiTableRow.
Definition at line 56 of file TDbiConfigSet.hxx.
References fAggregateNo.
00056 { return fAggregateNo; }
virtual UInt_t TDbiTableRow::GetIndex | ( | UInt_t | defIndex | ) | const [inline, virtual, inherited] |
Reimplemented in TDemo2_DB_Table, and TDemo_DB_Table.
Definition at line 65 of file TDbiTableRow.hxx.
Referenced by TDbiResultSet::BuildLookUpTable().
UInt_t TDbiConfigSet::GetNumParams | ( | ) | const [inline] |
Definition at line 57 of file TDbiConfigSet.hxx.
References fParams.
Referenced by GetParamName(), GetParamType(), GetParamValue(), operator<<(), and TDbiConfigStream::operator>>().
00057 { return fParams.size(); }
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; }
string TDbiConfigSet::GetParamName | ( | UInt_t | parNo | ) | const |
Purpose: Get the name of selected parameter. Arguments: parNo in parNo (in range 0..GetNumParams()) Return: The name of selected parameter or "" if parNo out of range. Contact: N. West Specification:- ============= o Get the name of selected parameter or "" if parNo out of range.
Definition at line 150 of file TDbiConfigSet.cxx.
References fParams, and GetNumParams().
Referenced by operator<<(), and TDbiConfigStream::operator>>().
00150 { 00151 00152 00153 // Program Notes:- 00154 // ============= 00155 00156 // None. 00157 00158 return ( parNo <= GetNumParams() ) ? 00159 fParams[parNo]->Name : ""; 00160 00161 }
TDbiFieldType TDbiConfigSet::GetParamType | ( | UInt_t | parNo | ) | const |
Definition at line 164 of file TDbiConfigSet.cxx.
References fParams, GetNumParams(), and TDbi::kUnknown.
Referenced by operator<<().
00164 { 00165 // 00166 // 00167 // Purpose: Get the type of selected parameter. 00168 // 00169 // Arguments: 00170 // parNo in parNo (in range 0..GetNumParams()) 00171 // 00172 // Return: The type of selected parameter 00173 // or TDbi::kUnknown if parNo out of range. 00174 // 00175 // Contact: N. West 00176 // 00177 // Specification:- 00178 // ============= 00179 // 00180 // o Get the type of selected parameter or TDbi::kUnknown if 00181 // parNo out of range. 00182 00183 // Program Notes:- 00184 // ============= 00185 00186 // None. 00187 00188 return ( parNo <= GetNumParams() ) ? 00189 fParams[parNo]->Type : TDbiFieldType(TDbi::kUnknown); 00190 00191 }
string TDbiConfigSet::GetParamValue | ( | UInt_t | parNo | ) | const |
Purpose: Get the value of selected parameter. Arguments: parNo in parNo (in range 0..GetNumParams()) Return: The value of selected parameter or "" if parNo out of range. Contact: N. West Specification:- ============= o Get the value of selected parameter or "" if parNo out of range.
Definition at line 209 of file TDbiConfigSet.cxx.
References fParams, and GetNumParams().
Referenced by operator<<(), and TDbiConfigStream::operator>>().
00209 { 00210 00211 // Program Notes:- 00212 // ============= 00213 00214 // None. 00215 00216 return ( parNo <= GetNumParams() ) ? 00217 fParams[parNo]->Value : ""; 00218 00219 }
void TDbiConfigSet::PushBack | ( | const string & | name, | |
const string & | value, | |||
const TDbiFieldType & | type | |||
) |
Purpose: Add another entry to the end of the existing row.
Definition at line 223 of file TDbiConfigSet.cxx.
References fParams.
Referenced by TDbiConfigStream::operator<<().
00225 { 00226 // 00227 // 00228 00229 fParams.push_back(new Param(name,value,type)); 00230 }
void TDbiConfigSet::SetAggregateNo | ( | Int_t | aggNo | ) | [inline] |
Definition at line 67 of file TDbiConfigSet.hxx.
References fAggregateNo.
Referenced by TDbiConfigStream::operator<<(), and TDbiConfigStream::Write().
00067 { fAggregateNo = aggNo; }
void TDbiTableRow::SetOwner | ( | TDbiResultSet * | owner | ) | [inline, inherited] |
Definition at line 68 of file TDbiTableRow.hxx.
References TDbiTableRow::fOwner.
Referenced by ClassImp().
00068 {fOwner = owner;}
void TDbiConfigSet::Store | ( | TDbiOutRowStream & | ors, | |
const TDbiValidityRec * | vrec | |||
) | const [virtual] |
Purpose: Stream object to output row stream Arguments: ors in Output row stream. vrec in =0. If filling other table rows it points to the associated validity record. Return: Contact: N. West Specification:- ============= o Stream object to output row stream. Program Notes:- ============= This method sneaks round the back of the TDbiRowStream interface and directly uses the private Store method as the data is already in string form. Its all in a good cause because this allows TDbiConfigSet to output data from any type of table.
Reimplemented from TDbiTableRow.
Definition at line 259 of file TDbiConfigSet.cxx.
References fParams, and TDbiOutRowStream::Store().
00260 { 00261 00262 for ( vector<Param*>::const_iterator itr = fParams.begin(); 00263 itr != fParams.end(); 00264 ++itr ) ors.Store((*itr)->Value.c_str()); 00265 00266 }
Int_t TDbiConfigSet::fAggregateNo [private] |
Aggregate number or:- -1 Non-aggregated data or multiple aggregates -2 undefined aggregates
Definition at line 104 of file TDbiConfigSet.hxx.
Referenced by Fill(), GetAggregateNo(), and SetAggregateNo().
vector<Param*> TDbiConfigSet::fParams [private] |
Definition at line 99 of file TDbiConfigSet.hxx.
Referenced by Clear(), Fill(), GetNumParams(), GetParamName(), GetParamType(), GetParamValue(), PushBack(), Store(), and ~TDbiConfigSet().