28 #ifndef LATTICES_LATTICEITERINTERFACE_H
29 #define LATTICES_LATTICEITERINTERFACE_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 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.
A 1-D Specialization of the Array class.
std::vector< double > Vector
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 ...
A 2-D Specialization of the Array class.
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.
template <class T, class U> class vector;
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.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.