Loading...
Searching...
No Matches
casacore::PagedArrIter< T > Class Template Reference
lattices package (libcasa_lattices) » Lattices_module » Lattices_module_internal_classes

More...

`#include <PagedArrIter.h>`

## Protected Member Functions

| PagedArrIter (const PagedArray< T > &data, const LatticeNavigator &method, Bool useRef)
| Construct the Iterator with the supplied data, and iteration strategy.
| PagedArrIter (const PagedArrIter< T > &other)
| The copy constructor uses reference sematics for the PagedArray and copy semantics for the cursor and Navigator.
virtual | ~PagedArrIter ()
| Destructor (cleans up dangling references and releases cursor memory).
PagedArrIter< T > & | operator= (const PagedArrIter< T > &other)
| The assignment operator uses reference sematics for the PagedArray and copy semantics for the cursor and Navigator.
virtual LatticeIterInterface< T > * | clone () const
| Clone the object.
Protected Member Functions inherited from casacore::LatticeIterInterface< T >
| LatticeIterInterface ()
| Default constructor (for derived classes).
| LatticeIterInterface (const LatticeIterInterface< T > &other)
| Copy constructor (copy semantics).
LatticeIterInterface & | operator= (const LatticeIterInterface< T > &other)
| Assignment (copy semantics).
Lattice< T > & | lattice ()
| Return the underlying lattice.
Bool | operator++ ()
| Increment operator - increment the cursor to the next position.
Bool | operator++ (int)
Bool | operator-- ()
| Decrement operator - decrement the cursor to the previous position.
Bool | operator-- (int)
void | reset ()
| Function which resets the cursor to the beginning of the Lattice and resets the number of steps taken to zero.
Bool | atStart () const
| Function which returns a value of "True" if the cursor is at the beginning of the Lattice, otherwise, returns "False".
Bool | atEnd () const
| Function which returns "True" if the cursor has been incremented to the end of the lattice, otherwise, returns "False".
uInt | nsteps () const
| Function to return the number of steps (increments or decrements) taken since construction (or since last reset).
IPosition | position () const
| Function which returns the current position of the beginning of the cursor within the Lattice.
IPosition | endPosition () const
| Function which returns the current position of the end of the cursor.
IPosition | latticeShape () const
| Function which returns the shape of the Lattice being iterated through.
IPosition | cursorShape () const
| Function which returns the shape of the cursor which is iterating through the Lattice.
virtual Vector< T > & | vectorCursor (Bool doRead, Bool autoRewrite)
| Functions which returns a window to the data in the Lattice.
virtual Matrix< T > & | matrixCursor (Bool doRead, Bool autoRewrite)
virtual Cube< T > & | cubeCursor (Bool doRead, Bool autoRewrite)
virtual Array< T > & | cursor (Bool doRead, Bool autoRewrite)
Bool | ok () const
| Function which checks the internals of the class for consistency.
virtual void | readData (Bool doRead)
| Do the actual read of the data.
virtual void | rewriteData ()
| Rewrite the cursor data and clear the rewrite flag.
virtual void | cursorUpdate ()
| Update the cursor for the next chunk of data (resize if needed).
void | allocateBuffer ()
| Allocate the internal buffer.
void | allocateCurPtr ()
| Allocate the nondegenerate array with the correct type.
void | setCurPtr2Cursor ()
| Synchronise the storage of itsCurPtr with itsCursor.
void | copyBase (const LatticeIterInterface< T > &other)
| Copy the base data of the other object.

## Private Member Functions

void | setupTileCache ()
| Setup the cache in the tiled storage manager.

## Private Attributes

PagedArray< T > | itsData
| reference to the PagedArray

## Friends

class | PagedArray< T >

## Additional Inherited Members

Public Member Functions inherited from casacore::LatticeIterInterface< T >
| LatticeIterInterface (const Lattice< T > &lattice, const LatticeNavigator &navigator, Bool useRef)
| Construct with the given navigator.
virtual | ~LatticeIterInterface ()
| A virtual destructor.
Protected Attributes inherited from casacore::LatticeIterInterface< T >
LatticeNavigator * | itsNavPtr
| Pointer to the method of Lattice transversal.
Lattice< T > * | itsLattPtr
| Pointer to the Lattice.
Array< T > | itsBuffer
| A buffer to hold the data.
Array< T > * | itsCurPtr
| Polymorphic pointer to the data in itsCursor.
Array< T > | itsCursor
| An Array which references the same data as the itsCurPtr, but has all the degenerate axes.
Bool | itsUseRef
| Keep a reference to the data (if possible).
Bool | itsIsRef
| Is the cursor a reference to the lattice?
Bool | itsHaveRead
| Have the data been read after a cursor update?
Bool | itsRewrite
| Rewrite the cursor data before moving or destructing?
IPosition | itsCursorAxes
| The axes forming the cursor.

## Detailed Description

template<class T>
class casacore::PagedArrIter< T >

A read/write Lattice iterator for PagedArrays.

### Intended use:

Internal

### Review Status

Reviewed By:
  Peter Barnes
Date Reviewed:
  1999/10/30
Test programs:
  tLatticeIterator
Demo programs:
  dPagedArray

### Prerequisite

- PagedArray
- LatticeIterator
- LatticeIterInterface
- letter/envelope schemes, eg. Coplien, "Advanced C++", ch 5.5

### Etymology

The PagedArrIter class name is a contraction of Paged Array Iterator and reflects its role as the methods for iterating through Lattices which are resident on disk.

### Synopsis

This class is not meant for general use. Instead class LatticeIterator should be used to iterate through a PagedArray or any other Lattice object (like a ArrayLattice).

PagedArrIter is derived from LatticeIterInterface and implements the iterator for a PagedArray object. This iterator is somewhat special because it sets the PagedArray cache size at the start of an iteration.

### Motivation

For for each derivation of Lattice to make as efficient an iterator as possible. The letter/envelope scheme allowed us to hide the special bits in classes like the one you see here.

### Template Type Argument Requirements (T)

- Restricted to the type of the PagedArray argument in the constructors

Definition at line 90 of file PagedArrIter.h.

## Constructor & Destructor Documentation

## PagedArrIter() [1/2]

template<class T>

casacore::PagedArrIter< T >::PagedArrIter | ( | const PagedArray< T > & | data,
|  | const LatticeNavigator & | method,
|  | Bool | useRef )

protected

Construct the Iterator with the supplied data, and iteration strategy.

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

## PagedArrIter() [2/2]

template<class T>

casacore::PagedArrIter< T >::PagedArrIter | ( | const PagedArrIter< T > & | other | ) |

protected

The copy constructor uses reference sematics for the PagedArray and copy semantics for the cursor and Navigator.

This way the newly constructed PagedArrIter can independently iterate through the same data set. (with the same cursor shape etc.)

References PagedArrIter().

## ~PagedArrIter()

template<class T>

virtual casacore::PagedArrIter< T >::~PagedArrIter | ( |  | ) |

protected virtual

Destructor (cleans up dangling references and releases cursor memory).

## Member Function Documentation

## clone()

template<class T>

virtual LatticeIterInterface< T > * casacore::PagedArrIter< T >::clone | ( |  | ) | const

protected virtual

Clone the object.

Reimplemented from casacore::LatticeIterInterface< T >.

References casacore::LatticeIterInterface< T >::LatticeIterInterface().

## operator=()

template<class T>

PagedArrIter< T > & casacore::PagedArrIter< T >::operator= | ( | const PagedArrIter< T > & | other | ) |

protected

The assignment operator uses reference sematics for the PagedArray and copy semantics for the cursor and Navigator.

This way the PagedArrIter objects share the same data set but independently iterate with cursors of the same size.

References PagedArrIter().

## setupTileCache()

template<class T>

void casacore::PagedArrIter< T >::setupTileCache | ( |  | ) |

private

Setup the cache in the tiled storage manager.

## Friends And Related Symbol Documentation

## PagedArray< T >

template<class T>

friend class PagedArray< T >

friend

Definition at line 1 of file PagedArrIter.h.

## Member Data Documentation

## itsData

template<class T>

PagedArray<T> casacore::PagedArrIter< T >::itsData

private

reference to the PagedArray

Definition at line 128 of file PagedArrIter.h.

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

- lattices/Lattices/PagedArrIter.h