BaseTabIter.h
Classes
- BaseTableIterator -- Base class for table iterator (full description)
Interface
- Public Members
- BaseTableIterator (BaseTable*, const Block<String>& columnNames, const PtrBlock<ObjCompareFunc*>&, const Block<Int>& orders, int option)
- BaseTableIterator* clone() const
- virtual ~BaseTableIterator()
- virtual void reset()
- virtual BaseTable* next()
- Protected Members
- BaseTableIterator (const BaseTableIterator&)
- Private Members
- BaseTableIterator& operator= (const BaseTableIterator&)
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
Prerequisite
Etymology
BaseTableIterator is the base class for the classes doing
the actual iterating through a table.
Synopsis
BaseTableIterator is the base class for the table iterators.
It is a letter class of the envelope TableIterator.
Currently there are no classes derived from BaseTableIterator,
since it can do all the work itself. However, in the future
this need not to be true anymore.
BaseTableIterator iterates by sorting the table in the required
order and then creating a RefTable for each step containing the
rows for that iteration step. Each iteration step assembles the
rows with equal key values.
To Do
- better support of user-supplied compare functions,
maybe using special classes.
Member Description
BaseTableIterator (BaseTable*, const Block<String>& columnNames, const PtrBlock<ObjCompareFunc*>&, const Block<Int>& orders, int option)
Create the table iterator to iterate through the given
columns in the given order. The given compare functions
will be used for the sort and to compare if values are equal.
If a function pointer is zero, the default compare function
from ObjCompare will be used.
BaseTableIterator* clone() const
Clone this iterator.
virtual void reset()
Reset the iterator (i.e. restart iteration).
Return the next group.
Copy constructor (to be used by clone)
BaseTableIterator& operator= (const BaseTableIterator&)
Assignment is not needed, because the assignment operator in
the envelope class TableIterator has reference semantics.
Declaring it private, makes it unusable.