00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TChair
00013 #define ROOT_TChair
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "TTable.h"
00024
00025 class TChair : public TDataSet {
00026
00027 protected:
00028
00029 TTable *fTable;
00030 ULong_t fLastIndx;
00031 void *fLastRow;
00032
00033 TTable *GetThisTable() {return fTable; }
00034 const TTable *GetThisTable() const {return fTable; }
00035 static void *GetOffset(const void *base,ULong_t offset) { return (void *)((Char_t *)base + offset);}
00036 TChair() : fTable(0), fLastIndx(0), fLastRow(0) { ; }
00037
00038 public:
00039
00040 TChair(TTable *table) : fTable(table),fLastIndx(0),fLastRow(0) { ; }
00041 TChair(const TChair &org) : TDataSet(org) {assert(0);}
00042
00043 virtual ~TChair(){;}
00044
00045 virtual void Adopt(Int_t n, void *array){GetThisTable()->Adopt(n,array);}
00046 virtual void AddAt(TDataSet *dataset,Int_t idx);
00047 virtual void AddAt(const void *c, Int_t i){GetThisTable()->AddAt(c,i);}
00048 const void *At(Int_t i) const {return GetThisTable()->At(i);}
00049 virtual void Browse(TBrowser *b){GetThisTable()->Browse(b);}
00050 virtual void CopySet(TChair &chair){GetThisTable()->CopySet(*chair.GetThisTable());}
00051 Int_t CopyRows(const TChair *srcChair, Int_t srcRow=0, Int_t dstRow=0, Int_t nRows=0, Bool_t expand=kFALSE)
00052 {return GetThisTable()->CopyRows(srcChair->GetThisTable(),srcRow,dstRow,nRows,expand);}
00053 virtual void Draw(Option_t *opt){GetThisTable()->Draw(opt);}
00054 virtual TH1 *Draw(TCut varexp, TCut selection, Option_t *option="",
00055 Int_t nentries=1000000000, Int_t firstentry=0)
00056 {return GetThisTable()->Draw(varexp,selection,option,nentries,firstentry);}
00057 virtual TH1 *Draw(const char *varexp, const char *selection, Option_t *option="",
00058 Int_t nentries=1000000000, Int_t firstentry=0) {
00059 return GetThisTable()->Draw(varexp,selection,option,nentries,firstentry);}
00060 virtual Char_t *GetArray() const {return (Char_t *)GetThisTable()->GetArray();}
00061 virtual TClass *GetRowClass() const {return GetThisTable()->GetRowClass();}
00062 virtual Long_t GetNRows() const {return GetThisTable()->GetNRows();}
00063 virtual Long_t GetRowSize() const {return GetThisTable()->GetRowSize();}
00064 virtual Long_t GetTableSize() const{return GetThisTable()->GetTableSize();}
00065 const TTable *Table() const {return fTable; }
00066 virtual TTableDescriptor *GetRowDescriptors() const {return GetThisTable()->GetRowDescriptors();}
00067 virtual const Char_t *GetType() const {return GetThisTable()->GetType();}
00068 virtual void Fit(const char *formula ,const char *varexp, const char *selection="",Option_t *option="",Option_t *goption="",
00069 Int_t nentries=1000000000, Int_t firstentry=0) {
00070 GetThisTable()->Fit(formula,varexp,selection,option,goption,nentries,firstentry);}
00071 virtual Long_t HasData() const { return GetThisTable()->HasData();}
00072 virtual Bool_t IsFolder() const { return GetThisTable()->IsFolder();}
00073 virtual void ls(Option_t *option="") const {GetThisTable()->ls(option);}
00074 virtual void ls(Int_t deep) const {GetThisTable()->ls(deep);}
00075 Int_t NaN() {return GetThisTable()->NaN();}
00076 virtual Char_t *MakeExpression(const Char_t *expressions[],Int_t nExpressions)
00077 {return GetThisTable()->MakeExpression(expressions,nExpressions);}
00078 virtual Char_t *Print(Char_t *buf,Int_t n) const { return GetThisTable()->Print(buf, n);}
00079 virtual void Print(Option_t *opt="") const {GetThisTable()->Print(opt);}
00080 virtual const Char_t *Print(Int_t row, Int_t rownumber=10,
00081 const Char_t *colfirst="",const Char_t *collast="") const {
00082 return GetThisTable()->Print(row,rownumber,colfirst,collast); }
00083 virtual const Char_t *PrintHeader() const {return GetThisTable()->PrintHeader();}
00084 virtual Int_t Purge(Option_t *opt="") {return GetThisTable()->Purge(opt);}
00085
00086 void *ReAllocate(Int_t newsize) { return GetThisTable()->ReAllocate(newsize); }
00087 void *ReAllocate() { return GetThisTable()->ReAllocate(); }
00088 virtual void SavePrimitive(ostream &out, Option_t *option="") {GetThisTable()->SavePrimitive(out,option);}
00089
00090 virtual void Set(Int_t n) {GetThisTable()->Set(n);}
00091 virtual void Set(Int_t n, Char_t *array) {GetThisTable()->Set(n,array);}
00092 virtual void SetNRows(Int_t n) {GetThisTable()->SetNRows(n);}
00093 virtual void Reset(Int_t c=0) {GetThisTable()->Reset(c) ;}
00094 virtual void Update() {GetThisTable()->Update();}
00095 virtual void Update(TDataSet *set, UInt_t opt=0) {GetThisTable()->Update(set,opt);}
00096 void *operator[](Int_t i);
00097 const void *operator[](Int_t i) const;
00098
00099 ClassDef(TChair,0)
00100 };
00101
00102 inline void TChair::AddAt(TDataSet *dataset,Int_t idx)
00103 {TDataSet::AddAt(dataset,idx);}
00104
00105 inline void *TChair::operator[](Int_t i)
00106 {
00107
00108
00109
00110 return (void *)((char *)GetArray()+i*GetRowSize());
00111 }
00112
00113 inline const void *TChair::operator[](Int_t i) const
00114 {
00115
00116
00117 return (const void *)((char *)GetArray()+i*GetRowSize());
00118 }
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253 #endif