TableIterProxy.h

Classes

TableIterProxy -- Proxy for table iterator access. (full description)

class TableIterProxy

Interface

Public Members
TableIterProxy()
TableIterProxy (const TableProxy& tab, const Vector<String>& columns, const String& order, const String& sortType)
TableIterProxy (const TableIterProxy&)
~TableIterProxy()
TableIterProxy& operator= (const TableIterProxy&)
Bool isNull() const
const TableIterator& iterator() const
Bool nextPart (TableProxy& table)
TableProxy next()
void reset()

Description

Review Status

Reviewed By:
Paul Shannon
Date Reviewed:
1995/09/15
Programs:
Tests:

Prerequisite

Etymology

TableIterProxy holds a TableIterator object for the table glish client.

Synopsis

TableIterProxy gives access to the table iterator functionality. It is primarily meant to be used in classes that wrap access to it from scripting languages (like Glish and Python). However, it can also be used directly from other C++ code.

A TableIterProxy object is usually created by class TableProxy.

Example

    // Get a table proxy.
    TableProxy proxy("sometable");
    Vector<String> columns(1, "SOMECOL");
    TableIterProxy tgi (proxy, columns, "a", "q");
    TableProxy subTable;
    // Iterate through the table.
    while (tgi.next (subTable)) {
       ..use Table object subTable.table()
    }

Member Description

TableIterProxy()

Default constructor initializes to not open. This constructor is only needed for the Block container.

TableIterProxy (const TableProxy& tab, const Vector<String>& columns, const String& order, const String& sortType)

Construct for the given table column(s). Order and sortType are case-insentive strings and only the first character in it is important. order[0]=a means ascending; d means descending. sortType[0]=q means quicksort, i means insertion sort, n means nosort, otherwise heapsort.

TableIterProxy (const TableIterProxy&)

Copy constructor (copy semantics).

~TableIterProxy()

TableIterProxy& operator= (const TableIterProxy&)

Assignment (copy semantics).

Bool isNull() const

Is the internal iterator object null?

const TableIterator& iterator() const

Get the TableIterator object.

Bool nextPart (TableProxy& table)

Get the next subtable and return it in the TableProxy argument. When no more subtables are available, it returns False.

TableProxy next()

Iterate to the next part (for Python use). An IterError exception is thrown at the end of the loop.

void reset()

Reset the iterator (for Python use).