StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TTableIter.h
1 // @(#)root/table:$Id$
2 // Author: Valery Fine(fine@bnl.gov) 03/12/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TTableIter
12 #define ROOT_TTableIter
13 
15 // //
16 // TTableIter - class iterator to loop over sorted TTable's //
17 // //
19 
20 #include "TObject.h"
21 
22 class TTableSorter;
23 
24 class TTableIter : public TObject {
25 private:
26  const TTableSorter *fTableSorter;
27  Int_t fIndx;
28  Int_t fTotalKeys;
29  Int_t fFirstIndx;
30  TTableIter(const TTableIter &org); // Intentioanlly not implemented
31  TTableIter &operator=(const TTableIter &org); // Intentioanlly not implemented
32 protected:
33  TTableIter(){;}
34 
35 public:
36  TTableIter(const TTableSorter *table, Float_t &keyvalue);
37  TTableIter(const TTableSorter *table, Double_t &keyvalue);
38  TTableIter(const TTableSorter *table, Int_t &keyvalue);
39  TTableIter(const TTableSorter *table, Long_t &keyvalue);
40  TTableIter(const TTableSorter *table, Short_t &keyvalue);
41 
42  virtual ~TTableIter(){;}
43 
44  Int_t CountKey(Float_t &keyvalue);
45  Int_t CountKey(Long_t &keyvalue);
46  Int_t CountKey(Int_t &keyvalue);
47  Int_t CountKey(Short_t &keyvalue);
48  Int_t CountKey(Double_t &keyvalue);
49 
50  Int_t GetNRows() const;
51  Int_t Next();
52  Int_t Next(Int_t idx);
53  Int_t Reset(Int_t indx=0);
54  Int_t operator()();
55  Int_t operator[](Int_t idx);
56  ClassDef(TTableIter,0) // Iterator over "sorted" TTable objects
57 };
58 
59 //_____________________________________________________________________
60 inline Int_t TTableIter::GetNRows() const { return fTotalKeys;}
61 //_____________________________________________________________________
62 inline Int_t TTableIter::operator()() { return Next();}
63 
64 //_____________________________________________________________________
65 inline Int_t TTableIter::operator[](Int_t idx) { return Next(idx);}
66 
67 #endif
Int_t Reset(Int_t indx=0)
to be documented
Definition: TTableIter.cxx:139
Int_t Next()
to be documented
Definition: TTableIter.cxx:115
Int_t CountKey(Float_t &keyvalue)
to be documented
Definition: TTableIter.cxx:71