casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::TableIterProxy Class Reference

Proxy for table iterator access. More...

#include <TableIterProxy.h>

Public Member Functions

 TableIterProxy ()
 Default constructor initializes to not open. More...
 
 TableIterProxy (const TableProxy &tab, const Vector< String > &columns, const String &order, const String &sortType, const Vector< Double > &intervals=Vector< Double >())
 Construct iterator for the given table column(s). More...
 
 TableIterProxy (const TableIterProxy &)
 Copy constructor (copy semantics). More...
 
 ~TableIterProxy ()
 
TableIterProxyoperator= (const TableIterProxy &)
 Assignment (copy semantics). More...
 
Bool isNull () const
 Is the internal iterator object null? More...
 
const TableIteratoriterator () const
 Get the TableIterator object. More...
 
Bool nextPart (TableProxy &table)
 Get the next subtable and return it in the TableProxy argument. More...
 
TableProxy next ()
 Iterate to the next part (for Python use). More...
 
void reset ()
 Reset the iterator (for Python use). More...
 

Private Member Functions

void makeStepIter (const Table &tab, const Block< String > &columns, const Vector< Double > &iterSteps, TableIterator::Order order, TableIterator::Option sortType)
 Make an iterator where iteration intervals may have been given. More...
 

Private Attributes

TableIterator iter_p
 
Bool firstTime_p
 

Detailed Description

Proxy for table iterator access.

Intended use:

Public interface

Review Status

Reviewed By:
Paul Shannon
Date Reviewed:
1995/09/15
Test programs:
tgtable.g

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()
}

Definition at line 86 of file TableIterProxy.h.

Constructor & Destructor Documentation

casacore::TableIterProxy::TableIterProxy ( )

Default constructor initializes to not open.

This constructor is only needed for the Block container.

casacore::TableIterProxy::TableIterProxy ( const TableProxy tab,
const Vector< String > &  columns,
const String order,
const String sortType,
const Vector< Double > &  intervals = VectorDouble >() 
)

Construct iterator 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, h means heapsort, otherwise parsort
For each column an iteration interval can be given making it possible to iterate in e.g. time chunks of 1 minute. Not given or zero means no interval is given for that column, thus a normal comparison is done. It can only be used for numerical columns (not complex). However, if for a string column the interbval is set to non-zero, it means that case-insensitive comparison will be used.

casacore::TableIterProxy::TableIterProxy ( const TableIterProxy )

Copy constructor (copy semantics).

casacore::TableIterProxy::~TableIterProxy ( )

Member Function Documentation

Bool casacore::TableIterProxy::isNull ( ) const
inline

Is the internal iterator object null?

Definition at line 118 of file TableIterProxy.h.

References casacore::TableIterator::isNull(), and iter_p.

const TableIterator& casacore::TableIterProxy::iterator ( ) const
inline

Get the TableIterator object.

Definition at line 122 of file TableIterProxy.h.

References iter_p.

void casacore::TableIterProxy::makeStepIter ( const Table tab,
const Block< String > &  columns,
const Vector< Double > &  iterSteps,
TableIterator::Order  order,
TableIterator::Option  sortType 
)
private

Make an iterator where iteration intervals may have been given.

TableProxy casacore::TableIterProxy::next ( )

Iterate to the next part (for Python use).

An IterError exception is thrown at the end of the loop.

Bool casacore::TableIterProxy::nextPart ( TableProxy table)

Get the next subtable and return it in the TableProxy argument.

When no more subtables are available, it returns False.

TableIterProxy& casacore::TableIterProxy::operator= ( const TableIterProxy )

Assignment (copy semantics).

void casacore::TableIterProxy::reset ( )

Reset the iterator (for Python use).

Member Data Documentation

Bool casacore::TableIterProxy::firstTime_p
private

Definition at line 147 of file TableIterProxy.h.

TableIterator casacore::TableIterProxy::iter_p
private

Definition at line 146 of file TableIterProxy.h.

Referenced by isNull(), and iterator().


The documentation for this class was generated from the following file: