Go to the documentation of this file.
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 Vector;
42 template <
class T>
class Matrix;
43 template <
class T>
class Cube;
44 template <
class T>
class Lattice;
45 template <
class T>
class LatticeIterator;
46 template <
class T>
class RO_LatticeIterator;
116 template <
class T>
class LatticeIterInterface
278 return operator++ (0);
283 return operator-- (0);
289 return itsNavPtr->atStart();
295 return itsNavPtr->atEnd();
301 return itsNavPtr->nsteps();
307 return itsNavPtr->position();
313 return itsNavPtr->endPosition();
319 return itsNavPtr->latticeShape();
325 return itsNavPtr->cursorShape();
334 #ifndef CASACORE_NO_AUTO_TEMPLATES
335 #include <casacore/lattices/Lattices/LatticeIterInterface.tcc>
336 #endif //# CASACORE_NO_AUTO_TEMPLATES
virtual void rewriteData()
Rewrite the cursor data and clear the rewrite flag.
virtual Matrix< T > & matrixCursor(Bool doRead, Bool autoRewrite)
LatticeIterInterface()
Default constructor (for derived classes).
A 2-D Specialization of the Array class.
IPosition position() const
Function which returns the current position of the beginning of the cursor within the Lattice.
virtual void cursorUpdate()
Update the cursor for the next chunk of data (resize if needed).
Array< T > itsCursor
An Array which references the same data as the itsCurPtr, but has all the degenerate axes.
A Vector of integers, for indexing into Array<T> objects.
Array< T > * itsCurPtr
Polymorphic pointer to the data in itsCursor.
Bool itsHaveRead
Have the data been read after a cursor update? (False=not read)
void copyBase(const LatticeIterInterface< T > &other)
Copy the base data of the other object.
IPosition cursorShape() const
Function which returns the shape of the cursor which is iterating through the Lattice.
virtual void readData(Bool doRead)
Do the actual read of the data.
A read/write lattice iterator.
IPosition itsCursorAxes
The axes forming the cursor.
void setCurPtr2Cursor()
Synchronise the storage of itsCurPtr with itsCursor.
Array< T > itsBuffer
A buffer to hold the data.
A 3-D Specialization of the Array class.
Abstract base class to steer lattice iterators.
Bool itsRewrite
Rewrite the cursor data before moving or destructing?
A readonly iterator for Lattices.
virtual LatticeIterInterface< T > * clone() const
Clone the object.
LatticeIterInterface & operator=(const LatticeIterInterface< T > &other)
Assignment (copy semantics).
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 ...
this file contains all the compiler specific defines
Bool itsIsRef
Is the cursor a reference to the lattice?
Bool operator++()
Increment operator - increment the cursor to the next position.
virtual Vector< T > & vectorCursor(Bool doRead, Bool autoRewrite)
Functions which returns a window to the data in the Lattice.
Bool operator--()
Decrement operator - decrement the cursor to the previous position.
Bool ok() const
Function which checks the internals of the class for consistency.
virtual ~LatticeIterInterface()
A virtual destructor.
void allocateCurPtr()
Allocate the nondegenerate array with the correct type.
A templated, abstract base class for array-like objects.
template <class T, class U> class vector;
Lattice< T > * itsLattPtr
Pointer to the Lattice.
Bool atEnd() const
Function which returns "True" if the cursor has been incremented to the end of the lattice,...
IPosition endPosition() const
Function which returns the current position of the end of the cursor.
bool Bool
Define the standard types used by Casacore.
Lattice< T > & lattice()
Return the underlying lattice.
A 1-D Specialization of the Array class.
Bool itsUseRef
Keep a reference to the data (if possible).
LatticeNavigator * itsNavPtr
Pointer to the method of Lattice transversal.
virtual Array< T > & cursor(Bool doRead, Bool autoRewrite)
IPosition latticeShape() const
Function which returns the shape of the Lattice being iterated through.
void allocateBuffer()
Allocate the internal buffer.
virtual Cube< T > & cubeCursor(Bool doRead, Bool autoRewrite)
Bool atStart() const
Function which returns a value of "True" if the cursor is at the beginning of the Lattice,...
A base class for Lattice iterators.