casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ()
 
uInt sliceStart () const
 Get the current slice start, end, or increment. More...
 
uInt sliceEnd () const
 
uInt sliceIncr () const
 

Private Attributes

Vector< uIntitsRows
 
Bool itsSliced
 
uInt itsStart
 
uInt itsEnd
 
uInt itsIncr
 
uInt 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.
uInt rownr = rowiter.sliceStart();
uInt end = rowiter.sliceEnd();
uInt incr = rowiter.sliceIncr();
// Iterate through the row numbers in the slice.
while (rownr <= end) {
rownr += incr;
}
// Go to next slice.
rowiter++;
}
}

Definition at line 208 of file RefRows.h.

Constructor & Destructor Documentation

casacore::RefRowsSliceIter::RefRowsSliceIter ( const RefRows )

Construct the iterator on a RefRows object.

It is set to the beginning.

Member Function Documentation

void casacore::RefRowsSliceIter::next ( )

Referenced by operator++().

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

Go the next slice.

Definition at line 224 of file RefRows.h.

References next().

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

Definition at line 226 of file RefRows.h.

References next().

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

Is the iterator past the end?

Definition at line 219 of file RefRows.h.

References itsPastEnd.

void casacore::RefRowsSliceIter::reset ( )

Reset the iterator to the beginning.

uInt casacore::RefRowsSliceIter::sliceEnd ( ) const
inline

Definition at line 235 of file RefRows.h.

References itsEnd.

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

Definition at line 237 of file RefRows.h.

References itsIncr.

uInt casacore::RefRowsSliceIter::sliceStart ( ) const
inline

Get the current slice start, end, or increment.

Definition at line 233 of file RefRows.h.

References itsStart.

Member Data Documentation

uInt casacore::RefRowsSliceIter::itsEnd
private

Definition at line 245 of file RefRows.h.

Referenced by sliceEnd().

uInt casacore::RefRowsSliceIter::itsIncr
private

Definition at line 246 of file RefRows.h.

Referenced by sliceIncr().

Bool casacore::RefRowsSliceIter::itsPastEnd
private

Definition at line 248 of file RefRows.h.

Referenced by pastEnd().

uInt casacore::RefRowsSliceIter::itsPos
private

Definition at line 247 of file RefRows.h.

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

Definition at line 242 of file RefRows.h.

Bool casacore::RefRowsSliceIter::itsSliced
private

Definition at line 243 of file RefRows.h.

uInt casacore::RefRowsSliceIter::itsStart
private

Definition at line 244 of file RefRows.h.

Referenced by sliceStart().


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