Logo ROOT   6.12/07
Reference Guide
TTableIter.h
Go to the documentation of this file.
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 
14 //////////////////////////////////////////////////////////////////////////
15 // //
16 // TTableIter - class iterator to loop over sorted TTable's //
17 // //
18 //////////////////////////////////////////////////////////////////////////
19 
20 #include "TObject.h"
21 
22 class TTableSorter;
23 
24 class TTableIter : public TObject {
25 private:
30  TTableIter(const TTableIter &org); // Intentioanlly not implemented
31  TTableIter &operator=(const TTableIter &org); // Intentioanlly not implemented
32 protected:
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
float Float_t
Definition: RtypesCore.h:53
virtual ~TTableIter()
Definition: TTableIter.h:42
int Int_t
Definition: RtypesCore.h:41
Int_t fIndx
Definition: TTableIter.h:27
Int_t operator[](Int_t idx)
Definition: TTableIter.h:65
#define ClassDef(name, id)
Definition: Rtypes.h:320
Int_t fTotalKeys
Definition: TTableIter.h:28
Int_t operator()()
Definition: TTableIter.h:62
Int_t Next()
to be documented
Definition: TTableIter.cxx:115
short Short_t
Definition: RtypesCore.h:35
const TTableSorter * fTableSorter
Definition: TTableIter.h:26
long Long_t
Definition: RtypesCore.h:50
Int_t CountKey(Float_t &keyvalue)
to be documented
Definition: TTableIter.cxx:71
double Double_t
Definition: RtypesCore.h:55
Int_t fFirstIndx
Definition: TTableIter.h:29
#define org(otri, vertexptr)
Definition: triangle.c:1037
Mother of all ROOT objects.
Definition: TObject.h:37
TTableIter & operator=(const TTableIter &org)
Int_t GetNRows() const
Definition: TTableIter.h:60