28 #ifndef LATTICES_LATTICEITERINTERFACE_H
29 #define LATTICES_LATTICEITERINTERFACE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/IPosition.h>
35 #include <casacore/casa/Arrays/Array.h>
36 #include <casacore/lattices/Lattices/LatticeNavigator.h>
41 template <
class T>
class Lattice;
42 template <
class T>
class LatticeIterator;
43 template <
class T>
class RO_LatticeIterator;
275 return operator++ (0);
280 return operator-- (0);
286 return itsNavPtr->atStart();
292 return itsNavPtr->atEnd();
298 return itsNavPtr->nsteps();
304 return itsNavPtr->position();
310 return itsNavPtr->endPosition();
316 return itsNavPtr->latticeShape();
322 return itsNavPtr->cursorShape();
331 #ifndef CASACORE_NO_AUTO_TEMPLATES
332 #include <casacore/lattices/Lattices/LatticeIterInterface.tcc>
Bool atEnd() const
Function which returns "True" if the cursor has been incremented to the end of the lattice,...
virtual Matrix< T > & matrixCursor(Bool doRead, Bool autoRewrite)
LatticeIterInterface()
Default constructor (for derived classes).
virtual Vector< T > & vectorCursor(Bool doRead, Bool autoRewrite)
Functions which returns a window to the data in the Lattice.
Bool itsRewrite
Rewrite the cursor data before moving or destructing?
void setCurPtr2Cursor()
Synchronise the storage of itsCurPtr with itsCursor.
uInt nsteps() const
Function to return the number of steps (increments or decrements) taken since construction (or since ...
IPosition endPosition() const
Function which returns the current position of the end of the cursor.
virtual LatticeIterInterface< T > * clone() const
Clone the object.
LatticeNavigator * itsNavPtr
Pointer to the method of Lattice transversal.
virtual void cursorUpdate()
Update the cursor for the next chunk of data (resize if needed).
Bool itsIsRef
Is the cursor a reference to the lattice?
Array< T > itsCursor
An Array which references the same data as the itsCurPtr, but has all the degenerate axes.
void allocateCurPtr()
Allocate the nondegenerate array with the correct type.
void allocateBuffer()
Allocate the internal buffer.
IPosition latticeShape() const
Function which returns the shape of the Lattice being iterated through.
virtual Array< T > & cursor(Bool doRead, Bool autoRewrite)
virtual void rewriteData()
Rewrite the cursor data and clear the rewrite flag.
Bool operator--()
Decrement operator - decrement the cursor to the previous position.
Bool atStart() const
Function which returns a value of "True" if the cursor is at the beginning of the Lattice,...
Bool itsUseRef
Keep a reference to the data (if possible).
Bool itsHaveRead
Have the data been read after a cursor update? (False=not read)
Bool operator++()
Increment operator - increment the cursor to the next position.
LatticeIterInterface(const LatticeIterInterface< T > &other)
Copy constructor (copy semantics).
virtual Cube< T > & cubeCursor(Bool doRead, Bool autoRewrite)
void reset()
Function which resets the cursor to the beginning of the Lattice and resets the number of steps taken...
Array< T > itsBuffer
A buffer to hold the data.
Bool ok() const
Function which checks the internals of the class for consistency.
Lattice< T > * itsLattPtr
Pointer to the Lattice.
Array< T > * itsCurPtr
Polymorphic pointer to the data in itsCursor.
LatticeIterInterface(const Lattice< T > &lattice, const LatticeNavigator &navigator, Bool useRef)
Construct with the given navigator.
LatticeIterInterface & operator=(const LatticeIterInterface< T > &other)
Assignment (copy semantics).
IPosition cursorShape() const
Function which returns the shape of the cursor which is iterating through the Lattice.
void copyBase(const LatticeIterInterface< T > &other)
Copy the base data of the other object.
IPosition itsCursorAxes
The axes forming the cursor.
IPosition position() const
Function which returns the current position of the beginning of the cursor within the Lattice.
virtual ~LatticeIterInterface()
A virtual destructor.
virtual void readData(Bool doRead)
Do the actual read of the data.
Lattice< T > & lattice()
Return the underlying lattice.
A read/write lattice iterator.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.