casacore
Public Member Functions | Private Attributes | List of all members
casacore::RefRowsSliceIter Class Reference

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

#include <RefRows.h>

Public Member Functions

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

Private Attributes

Vector< rownr_titsRows
 
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

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++;
}
}
RefRowsSliceIter(const RefRows &)
Construct the iterator on a RefRows object.
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46

Definition at line 218 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++().

◆ operator++() [1/2]

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

Go the next slice.

Definition at line 234 of file RefRows.h.

References next().

◆ operator++() [2/2]

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

Definition at line 236 of file RefRows.h.

References next().

◆ pastEnd()

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

Is the iterator past the end?

Definition at line 229 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 245 of file RefRows.h.

References itsEnd.

◆ sliceIncr()

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

Definition at line 247 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 243 of file RefRows.h.

References itsStart.

Member Data Documentation

◆ itsEnd

rownr_t casacore::RefRowsSliceIter::itsEnd
private

Definition at line 255 of file RefRows.h.

Referenced by sliceEnd().

◆ itsIncr

rownr_t casacore::RefRowsSliceIter::itsIncr
private

Definition at line 256 of file RefRows.h.

Referenced by sliceIncr().

◆ itsPastEnd

Bool casacore::RefRowsSliceIter::itsPastEnd
private

Definition at line 258 of file RefRows.h.

Referenced by pastEnd().

◆ itsPos

rownr_t casacore::RefRowsSliceIter::itsPos
private

Definition at line 257 of file RefRows.h.

◆ itsRows

Vector<rownr_t> casacore::RefRowsSliceIter::itsRows
private

Definition at line 252 of file RefRows.h.

◆ itsSliced

Bool casacore::RefRowsSliceIter::itsSliced
private

Definition at line 253 of file RefRows.h.

◆ itsStart

rownr_t casacore::RefRowsSliceIter::itsStart
private

Definition at line 254 of file RefRows.h.

Referenced by sliceStart().


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