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

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

#include <ConcatRows.h>

Public Member Functions

 ConcatRowsIter (const ConcatRows &)
 Construct the iterator on a ConcatRows object. More...
 
 ConcatRowsIter (const ConcatRows &, rownr_t start, rownr_t end, rownr_t incr=1)
 Construct the iterator on a ConcatRows object for the given row range. More...
 
Bool pastEnd () const
 Is the iterator past the end? More...
 
void operator++ ()
 Go the next chunk. More...
 
void operator++ (int)
 
void next ()
 
RefRows getChunk () const
 Get the current chunk. More...
 
uInt tableNr () const
 Get the nr of the table the current chunk is in. More...
 

Private Attributes

const ConcatRowsitsRows
 
Vector< rownr_titsChunk
 
rownr_t itsStart
 
rownr_t itsEnd
 
rownr_t itsIncr
 
uInt itsTabNr
 
Bool itsPastEnd
 

Detailed Description

Class to iterate through a ConcatRows object.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Test programs:
tConcatRows

Prerequisite

Synopsis

ConcatRowsSliceIter is useful to iterate through a ConcatRows object. It is possible to define for which row especially if the ConcatRows object contains slices. Each step in the iteration returns a Slice object containing the next slice in the ConcatRows object.
It is used in Table and data manager classes (e.g. StManColumn).

Example

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

void somefunc (const ConcatRows& rownrs)
// Iterate through all slices.
ConcatRowsSliceIter 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++;
}
}

Definition at line 194 of file ConcatRows.h.

Constructor & Destructor Documentation

casacore::ConcatRowsIter::ConcatRowsIter ( const ConcatRows )
explicit

Construct the iterator on a ConcatRows object.

It is set to the full range.

casacore::ConcatRowsIter::ConcatRowsIter ( const ConcatRows ,
rownr_t  start,
rownr_t  end,
rownr_t  incr = 1 
)

Construct the iterator on a ConcatRows object for the given row range.

Member Function Documentation

RefRows casacore::ConcatRowsIter::getChunk ( ) const
inline

Get the current chunk.

Definition at line 218 of file ConcatRows.h.

References itsChunk, and casacore::True.

void casacore::ConcatRowsIter::next ( )

Referenced by operator++().

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

Go the next chunk.

Definition at line 210 of file ConcatRows.h.

References next().

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

Definition at line 212 of file ConcatRows.h.

References next().

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

Is the iterator past the end?

Definition at line 205 of file ConcatRows.h.

References itsPastEnd.

uInt casacore::ConcatRowsIter::tableNr ( ) const
inline

Get the nr of the table the current chunk is in.

Definition at line 222 of file ConcatRows.h.

References itsTabNr.

Member Data Documentation

Vector<rownr_t> casacore::ConcatRowsIter::itsChunk
private

Definition at line 227 of file ConcatRows.h.

Referenced by getChunk().

rownr_t casacore::ConcatRowsIter::itsEnd
private

Definition at line 229 of file ConcatRows.h.

rownr_t casacore::ConcatRowsIter::itsIncr
private

Definition at line 230 of file ConcatRows.h.

Bool casacore::ConcatRowsIter::itsPastEnd
private

Definition at line 232 of file ConcatRows.h.

Referenced by pastEnd().

const ConcatRows* casacore::ConcatRowsIter::itsRows
private

Definition at line 226 of file ConcatRows.h.

rownr_t casacore::ConcatRowsIter::itsStart
private

Definition at line 228 of file ConcatRows.h.

uInt casacore::ConcatRowsIter::itsTabNr
private

Definition at line 231 of file ConcatRows.h.

Referenced by tableNr().


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