Logo ROOT   6.16/01
Reference Guide
TTableIter.cxx
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
12//////////////////////////////////////////////////////////////////////////
13// //
14// TTableIter - class iterator to loop over sorted TTable's //
15// //
16//////////////////////////////////////////////////////////////////////////
17
18#include "TTableIter.h"
19#include "TTableSorter.h"
20
22
23////////////////////////////////////////////////////////////////////////////////
24///to be documented
25
27 : fTableSorter(table), fIndx(0), fFirstIndx(0)
28{
29 CountKey(keyvalue);
30}
31
32////////////////////////////////////////////////////////////////////////////////
33///to be documented
34
36 : fTableSorter(table), fIndx(0), fFirstIndx(0)
37{
38 CountKey(keyvalue);
39}
40
41////////////////////////////////////////////////////////////////////////////////
42///to be documented
43
45 : fTableSorter(table), fIndx(0), fFirstIndx(0)
46{
47 CountKey(keyvalue);
48}
49
50////////////////////////////////////////////////////////////////////////////////
51///to be documented
52
54 : fTableSorter(table), fIndx(0), fFirstIndx(0)
55{
56 CountKey(keyvalue);
57}
58
59////////////////////////////////////////////////////////////////////////////////
60///to be documented
61
63 : fTableSorter(table), fIndx(0), fFirstIndx(0)
64{
65 CountKey(keyvalue);
66}
67
68////////////////////////////////////////////////////////////////////////////////
69///to be documented
70
72{
74 return GetNRows();
75}
76////////////////////////////////////////////////////////////////////////////////
77///to be documented
78
80{
82 return GetNRows();
83}
84
85////////////////////////////////////////////////////////////////////////////////
86///to be documented
87
89{
91 return GetNRows();
92}
93
94////////////////////////////////////////////////////////////////////////////////
95///to be documented
96
98{
100 return GetNRows();
101}
102
103////////////////////////////////////////////////////////////////////////////////
104///to be documented
105
107{
109 return GetNRows();
110}
111
112////////////////////////////////////////////////////////////////////////////////
113///to be documented
114
116{
117 Int_t rowIndx = -1;
118 if (fIndx < fTotalKeys) {
120 fIndx++;
121 }
122 return rowIndx;
123}
124
125////////////////////////////////////////////////////////////////////////////////
126///to be documented
127
129{
130 Int_t rowIndx = -1;
131 if (idx < fTotalKeys)
132 rowIndx = fTableSorter->GetIndex(UInt_t(fFirstIndx+idx));
133 return rowIndx;
134}
135
136////////////////////////////////////////////////////////////////////////////////
137///to be documented
138
140{
141 Int_t oldIdx = fIndx;
143 return oldIdx;
144}
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
long Long_t
Definition: RtypesCore.h:50
short Short_t
Definition: RtypesCore.h:35
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:363
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 GetNRows() const
Definition: TTableIter.h:60
Int_t CountKey(Float_t &keyvalue)
to be documented
Definition: TTableIter.cxx:71
Int_t fTotalKeys
Definition: TTableIter.h:28
Int_t fFirstIndx
Definition: TTableIter.h:29
const TTableSorter * fTableSorter
Definition: TTableIter.h:26
Int_t fIndx
Definition: TTableIter.h:27
Int_t GetIndex(UInt_t sortedIndex) const
returns the original index of the row by its sorted index
virtual Int_t CountKey(const void *key, Int_t firstIndx=0, Bool_t bSearch=kTRUE, Int_t *firstRow=0) const
CountKey counts the number of rows with the key value equal "key".
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
void table()
Definition: table.C:85