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

Class to iterate through a RefRows object. More...

`#include <RefRows.h>`

## Public Member Functions

| RefRowsSliceIter (const RefRows &)
| Construct the iterator on a RefRows object.
void | reset ()
| Reset the iterator to the beginning.
Bool | pastEnd () const
| Is the iterator past the end?
void | operator++ ()
| Go the next slice.
void | operator++ (int)
void | next ()
rownr_t | sliceStart () const
| Get the current slice start, end, or increment.
rownr_t | sliceEnd () const
rownr_t | sliceIncr () const

## Private Attributes

Vector< rownr_t > | itsRows
Bool | itsSliced
rownr_t | itsStart
rownr_t | itsEnd
rownr_t | itsIncr
rownr_t | itsPos
Bool | itsPastEnd

## Detailed Description

Class to iterate through a RefRows object.

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tRefRows

### Prerequisite

- RefRows

### Synopsis

RefRowsSliceIter is useful to iterate through a RefRows object, especially if the RefRows object contains slices. Each step in the iteration returns a Slice object containing the next slice in the RefRows object.
It is used in Table and data manager classes (e.g. StManColumn).

### Example

This example shows how to iterate through a RefRows object (giving a slice) and through each of the slices.

void somefunc (const RefRows& rownrs)
// Iterate through all slices.
RefRowsSliceIter rowiter(rownrs);
while (! rowiter.pastEnd()) {
// Get start, end, and increment for this slice.
rownr_t rownr = rowiter.sliceStart();
rownr_t end = rowiter.sliceEnd();
rownr_t incr = rowiter.sliceIncr();
// Iterate through the row numbers in the slice.
while (rownr <= end) {
rownr += incr;
}
// Go to next slice.
rowiter++;
}
}
casacore::RefRowsSliceIter::RefRowsSliceIter
RefRowsSliceIter(const RefRows &)
Construct the iterator on a RefRows object.
casacore::RefRows
Definition RefRows.h:84
casacore::end
iterator end()
Definition Block.h:594
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44

Definition at line 216 of file RefRows.h.

## Constructor & Destructor Documentation

## RefRowsSliceIter()

casacore::RefRowsSliceIter::RefRowsSliceIter | ( | const RefRows & |  | ) |

Construct the iterator on a RefRows object.

It is set to the beginning.

## Member Function Documentation

## next()

void casacore::RefRowsSliceIter::next | ( |  | ) |

Referenced by operator++(), and operator++().

## operator++() [1/2]

void casacore::RefRowsSliceIter::operator++ | ( |  | ) |

inline

Go the next slice.

Definition at line 232 of file RefRows.h.

References next().

## operator++() [2/2]

void casacore::RefRowsSliceIter::operator++ | ( | int |  | ) |

inline

Definition at line 234 of file RefRows.h.

References next().

## pastEnd()

Bool casacore::RefRowsSliceIter::pastEnd | ( |  | ) | const

inline

Is the iterator past the end?

Definition at line 227 of file RefRows.h.

References itsPastEnd.

## reset()

void casacore::RefRowsSliceIter::reset | ( |  | ) |

Reset the iterator to the beginning.

## sliceEnd()

rownr_t casacore::RefRowsSliceIter::sliceEnd | ( |  | ) | const

inline

Definition at line 243 of file RefRows.h.

References itsEnd.

## sliceIncr()

rownr_t casacore::RefRowsSliceIter::sliceIncr | ( |  | ) | const

inline

Definition at line 245 of file RefRows.h.

References itsIncr.

## sliceStart()

rownr_t casacore::RefRowsSliceIter::sliceStart | ( |  | ) | const

inline

Get the current slice start, end, or increment.

Definition at line 241 of file RefRows.h.

References itsStart.

## Member Data Documentation

## itsEnd

rownr_t casacore::RefRowsSliceIter::itsEnd

private

Definition at line 253 of file RefRows.h.

Referenced by sliceEnd().

## itsIncr

rownr_t casacore::RefRowsSliceIter::itsIncr

private

Definition at line 254 of file RefRows.h.

Referenced by sliceIncr().

## itsPastEnd

Bool casacore::RefRowsSliceIter::itsPastEnd

private

Definition at line 256 of file RefRows.h.

Referenced by pastEnd().

## itsPos

rownr_t casacore::RefRowsSliceIter::itsPos

private

Definition at line 255 of file RefRows.h.

## itsRows

Vector<rownr_t> casacore::RefRowsSliceIter::itsRows

private

Definition at line 250 of file RefRows.h.

## itsSliced

Bool casacore::RefRowsSliceIter::itsSliced

private

Definition at line 251 of file RefRows.h.

## itsStart

rownr_t casacore::RefRowsSliceIter::itsStart

private

Definition at line 252 of file RefRows.h.

Referenced by sliceStart().

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

- tables/Tables/RefRows.h