casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
casacore::HDF5LattIter< T > Class Template Reference

A read/write Lattice iterator for PagedArrays. More...

#include <HDF5LattIter.h>

Inheritance diagram for casacore::HDF5LattIter< T >:
casacore::LatticeIterInterface< T >

Protected Member Functions

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

Private Member Functions

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

Private Attributes

HDF5Lattice< T > itsData
 reference to the PagedArray More...
 

Friends

class HDF5Lattice< 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. More...
 
virtual ~LatticeIterInterface ()
 A virtual destructor. More...
 
- Protected Attributes inherited from casacore::LatticeIterInterface< T >
LatticeNavigatoritsNavPtr
 Pointer to the method of Lattice transversal. More...
 
Lattice< T > * itsLattPtr
 Pointer to the Lattice. More...
 
Array< T > itsBuffer
 A buffer to hold the data. More...
 
Array< T > * itsCurPtr
 Polymorphic pointer to the data in itsCursor. More...
 
Array< T > itsCursor
 An Array which references the same data as the itsCurPtr, but has all the degenerate axes. More...
 
Bool itsUseRef
 Keep a reference to the data (if possible). More...
 
Bool itsIsRef
 Is the cursor a reference to the lattice? More...
 
Bool itsHaveRead
 Have the data been read after a cursor update? (False=not read) More...
 
Bool itsRewrite
 Rewrite the cursor data before moving or destructing? More...
 
IPosition itsCursorAxes
 The axes forming the cursor. More...
 

Detailed Description

template<class T>
class casacore::HDF5LattIter< 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

Etymology

The HDF5LattIter 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).

HDF5LattIter 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)

Definition at line 92 of file HDF5LattIter.h.

Constructor & Destructor Documentation

template<class T>
casacore::HDF5LattIter< T >::HDF5LattIter ( const HDF5Lattice< T > &  data,
const LatticeNavigator method,
Bool  useRef 
)
protected

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

template<class T>
casacore::HDF5LattIter< T >::HDF5LattIter ( const HDF5LattIter< 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 HDF5LattIter can independently iterate through the same data set. (with the same cursor shape etc.)

template<class T>
virtual casacore::HDF5LattIter< T >::~HDF5LattIter ( )
protectedvirtual

Destructor (cleans up dangling references and releases cursor memory)

Member Function Documentation

template<class T>
virtual LatticeIterInterface<T>* casacore::HDF5LattIter< T >::clone ( ) const
protectedvirtual

Clone the object.

Reimplemented from casacore::LatticeIterInterface< T >.

template<class T>
HDF5LattIter<T>& casacore::HDF5LattIter< T >::operator= ( const HDF5LattIter< T > &  other)
protected

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

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

template<class T>
void casacore::HDF5LattIter< T >::setupTileCache ( )
private

Setup the cache in the tiled storage manager.

Friends And Related Function Documentation

template<class T>
friend class HDF5Lattice< T >
friend

Definition at line 94 of file HDF5LattIter.h.

Member Data Documentation

template<class T>
HDF5Lattice<T> casacore::HDF5LattIter< T >::itsData
private

reference to the PagedArray

Definition at line 130 of file HDF5LattIter.h.


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