Loading...
Searching...
No Matches
casacore::TableIterProxy Class Reference
tables package (libcasa_tables) » Tables_module

More...

`#include <TableIterProxy.h>`

## Public Member Functions

| TableIterProxy ()
| Default constructor initializes to not open.
| 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).
| 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.
TableProxy | next ()
| Iterate to the next part (for Python use).
void | reset ()
| Reset the iterator (for Python use).

## 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.

## 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

- class TableIterator

### 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()
}
casacore::TableIterProxy::TableIterProxy
TableIterProxy()
Default constructor initializes to not open.
casacore::TableProxy
Definition TableProxy.h:101
casacore::TableProxy::table
Table & table()
Return the table object.
Definition TableProxy.h:590
casacore::Table
Definition Table.h:157
casacore::Vector
Definition Vector.h:82

Definition at line 84 of file TableIterProxy.h.

## Constructor & Destructor Documentation

## TableIterProxy() [1/3]

casacore::TableIterProxy::TableIterProxy | ( |  | ) |

Default constructor initializes to not open.

This constructor is only needed for the Block container.

Referenced by operator=(), and TableIterProxy().

## TableIterProxy() [2/3]

casacore::TableIterProxy::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).

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.

References casacore::order().

## TableIterProxy() [3/3]

casacore::TableIterProxy::TableIterProxy | ( | const TableIterProxy & |  | ) |

Copy constructor (copy semantics).

References TableIterProxy().

## ~TableIterProxy()

casacore::TableIterProxy::~TableIterProxy | ( |  | ) |

## Member Function Documentation

## isNull()

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

inline

Is the internal iterator object null?

Definition at line 116 of file TableIterProxy.h.

References iter_p.

## iterator()

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

inline

Get the TableIterator object.

Definition at line 120 of file TableIterProxy.h.

References iter_p.

## makeStepIter()

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.

References casacore::order().

## next()

TableProxy casacore::TableIterProxy::next | ( |  | ) |

Iterate to the next part (for Python use).

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

## nextPart()

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.

## operator=()

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

Assignment (copy semantics).

References TableIterProxy().

## reset()

void casacore::TableIterProxy::reset | ( |  | ) |

Reset the iterator (for Python use).

## Member Data Documentation

## firstTime_p

Bool casacore::TableIterProxy::firstTime_p

private

Definition at line 145 of file TableIterProxy.h.

## iter_p

TableIterator casacore::TableIterProxy::iter_p

private

Definition at line 144 of file TableIterProxy.h.

Referenced by isNull(), and iterator().

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

- tables/Tables/TableIterProxy.h