class TFRowIter


  File:      TFRowIterator.cpp

  Version:   1.0

  Author:    Reiner Rohlfs (GADC)

  History:   1.0   12.08.03  first released version


Function Members (Methods)

public:
TFRowIter(const TFRowIter& rowIter)
~TFRowIter()
static TClass*Class()
voidClearFilterSort()
Bool_tFilter(const char* filter)
virtual TClass*IsA() const
UInt_tMap(UInt_t index)
Bool_tNext()
UInt_toperator*()
TFRowIter&operator=(const TFRowIter& rowIter)
voidReset()
virtual voidShowMembers(TMemberInspector& insp, char* parent)
voidSort(const char* colName)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
private:
TFRowIter(const TFTable* table)

Data Members

private:
UInt_tfMaxIndexnumber of row indexes in fRow
UInt_tfNextIndexthe next row index of fRow for the operator functions
UInt_t*fRowthe selected rows in sorted order
const TFTable*fTablethe table of this iterator

Class Charts

Inheritance Chart:
TFRowIter

Function documentation

TFRowIter(const TFTable * table)
 Private constructor. Use TFTable::MakeRowIterator() to create
 a row iterator.
TFRowIter(const TFRowIter & rowIter)
 copy constructor
void Sort(const char* colName)
 Sort the rows depending on the values of the column "colName".
 If colName is a column with more than one item per row only the
 first item of each row is used to sort the rows.
 The rows are not sorted in the table but a row - index list is sorted.
 Therefore the table cannot be saved into a file with sorted rows.
 But the operator * () will return the row numbers depending on the
 sorting of this function.
 If the column colName does not exist in the table of this iterator nothing
 will happen, no sorting, no warning and no error message.
void ClearFilterSort()
 Resets the sorting of the Sort() - function and clears all
 filters of the Filter() function.
Bool_t Next()
 Increase the internal row counter and the operator * () will return
 the next row number. The order of the returned row number depend on
 the filter ( Filter() - function ) and the sorting ( Sort() - function).
 The function will return kFALSE if there is no further row number.
UInt_t Map(UInt_t index)
 Returns the row number ( 0 based) of the original table after the sorting and
 filter is applied. index is the row index in the virtual sorted and
 filtered table. TF_MAX_ROWS will be returned if index is greater than the
 number of filtered rows.
Bool_t Filter(const char* filter)
 Applies a filter to filter rows of a TFTable or TFGroup. A row that
 does not pass the filter is not returned from the operator * () and
 the operator ->().

 filter is a c - expression without ; at the end. Column names of the
 table can be used as variable names in this filter string. They have the
 same data type as their column. If the column has more than one
 value per row the first value is used in this filter. Of course, the
 column names must fulfill the requirement for c - variable names.
 Beside that "row" can be used to define the row number ( 0 based ).
 row is the row number of the original table without sorting and without
 filter. The variable "row_" is the row number (0 based) of the sorted
 and already filtered row number before the call of this function.

 For each row in the table the column variables in the filter string are
 assigned to the value of the columns at the given row and "row" and "row_"
 in the filter string are set to the row number ( 0 based ). Than the filter
 statement is processed with the ROOT interpreter. If the result is  kTRUE
 the given row will be returned from the operator * () and the
 operator -> (). If the result is kFALSE the given row will not be returned.
 A second call of Filter() will not reset the previous filter but will
 apply the new filter on the already filtered rows.

 The function returns kFALSE if the filter cannot be processed. This means
 either there is a syntax error in the filter string or a used column name
 in the filter string does not exist in the table. The function will write
 an error message into the error stack ( see TFError ).

 example filter strings (assuming c1, c2 and c3 are column names):
    "c1 + 2.4 * c2 >= c3"
    "row > 4 && row < 20"
    "row_ < 40 || c2 <= c1"

~TFRowIter()
{delete [] fRow;}
void Reset()
{fNextIndex = 0;}

Author: (GADC)
Last update: Fri Mar 14 13:55:23 2008

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.