28 #ifndef LATTICES_LATTICEITERINTERFACE_H
29 #define LATTICES_LATTICEITERINTERFACE_H
41 template <
class T>
class Lattice;
42 template <
class T>
class LatticeIterator;
43 template <
class T>
class RO_LatticeIterator;
113 template <
class T>
class LatticeIterInterface
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>
333 #endif //# CASACORE_NO_AUTO_TEMPLATES
virtual Vector< T > & vectorCursor(Bool doRead, Bool autoRewrite)
Functions which returns a window to the data in the Lattice.
A Vector of integers, for indexing into Array<T> objects.
Array< T > * itsCurPtr
Polymorphic pointer to the data in itsCursor.
Bool atStart() const
Function which returns a value of "True" if the cursor is at the beginning of the Lattice...
A read/write lattice iterator.
LatticeNavigator * itsNavPtr
Pointer to the method of Lattice transversal.
virtual Cube< T > & cubeCursor(Bool doRead, Bool autoRewrite)
void setCurPtr2Cursor()
Synchronise the storage of itsCurPtr with itsCursor.
virtual LatticeIterInterface< T > * clone() const
Clone the object.
Array< T > itsBuffer
A buffer to hold the data.
Bool itsHaveRead
Have the data been read after a cursor update? (False=not read)
Array< T > itsCursor
An Array which references the same data as the itsCurPtr, but has all the degenerate axes...
A 3-D Specialization of the Array class.
void reset()
Function which resets the cursor to the beginning of the Lattice and resets the number of steps taken...
uInt nsteps() const
Function to return the number of steps (increments or decrements) taken since construction (or since ...
Bool itsRewrite
Rewrite the cursor data before moving or destructing?
Bool itsIsRef
Is the cursor a reference to the lattice?
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.
Bool operator--()
Decrement operator - decrement the cursor to the previous position.
IPosition position() const
Function which returns the current position of the beginning of the cursor within the Lattice...
A readonly iterator for Lattices.
Bool ok() const
Function which checks the internals of the class for consistency.
A base class for Lattice iterators.
A templated, abstract base class for array-like objects.
Lattice< T > * itsLattPtr
Pointer to the Lattice.
IPosition itsCursorAxes
The axes forming the cursor.
IPosition endPosition() const
Function which returns the current position of the end of the cursor.
Bool atEnd() const
Function which returns "True" if the cursor has been incremented to the end of the lattice...
void allocateCurPtr()
Allocate the nondegenerate array with the correct type.
bool Bool
Define the standard types used by Casacore.
virtual ~LatticeIterInterface()
A virtual destructor.
Lattice< T > & lattice()
Return the underlying lattice.
virtual Array< T > & cursor(Bool doRead, Bool autoRewrite)
LatticeIterInterface & operator=(const LatticeIterInterface< T > &other)
Assignment (copy semantics).
LatticeIterInterface()
Default constructor (for derived classes).
virtual void cursorUpdate()
Update the cursor for the next chunk of data (resize if needed).
virtual void rewriteData()
Rewrite the cursor data and clear the rewrite flag.
virtual Matrix< T > & matrixCursor(Bool doRead, Bool autoRewrite)
void allocateBuffer()
Allocate the internal buffer.
virtual void readData(Bool doRead)
Do the actual read of the data.
Bool itsUseRef
Keep a reference to the data (if possible).
IPosition latticeShape() const
Function which returns the shape of the Lattice being iterated through.
Abstract base class to steer lattice iterators.
Bool operator++()
Increment operator - increment the cursor to the next position.