#include <ArrayIter.h>
This class behaves exactly like an ArrayIterator, only it iterates through const Arrays.
void CopyArray(Array<Float> &to, const Array<Float> &from) { //.\.. check that they are conformant ArrayIterator toiter(to,1); ReadOnlyArrayIterator fromiter(from,1); while (! toiter.pastEnd() ) { toiter.array() = fromiter.array(); // copy vector by vector toiter.next(); fromiter.next(); } }
<linkfrom anchor="ReadOnlyArrayIterator" classes="Array Vector Matrix Cube"> <here>ReadOnlyArrayIterator</here> -- Iterate a const Array cursor through a const Array. </linkfrom>
Definition at line 161 of file ArrayIter.h.
| ReadOnlyArrayIterator (const ReadOnlyArrayIterator< T > &) | |
| Not implemented. | |
| ReadOnlyArrayIterator< T > & | operator= (const ReadOnlyArrayIterator< T > &) |
Public Member Functions | |
| ReadOnlyArrayIterator (const Array< T > &arr, uInt byDim=1) | |
| Step through array "arr" using a cursor of dimensionality "byDim". | |
| ReadOnlyArrayIterator (const Array< T > &arr, const IPosition &axes, Bool axesAreCursor=True) | |
| Step through an array for the given iteration axes. | |
| void | next () |
| Move the cursor to the next position. | |
| const Array< T > & | array () |
| Return the cursor. | |
| void | reset () |
| Reset the cursor to the beginning. | |
| void | origin () |
| Bool | atStart () const |
| The same as the functions in ArrayPositionIterator. | |
| Bool | pastEnd () const |
| const IPosition & | pos () const |
| IPosition | endPos () const |
| uInt | ndim () const |
Private Attributes | |
| ArrayIterator< T > | ai |
| casa::ReadOnlyArrayIterator< T >::ReadOnlyArrayIterator | ( | const Array< T > & | arr, | |
| uInt | byDim = 1 | |||
| ) | [inline, explicit] |
Step through array "arr" using a cursor of dimensionality "byDim".
Definition at line 165 of file ArrayIter.h.
| casa::ReadOnlyArrayIterator< T >::ReadOnlyArrayIterator | ( | const Array< T > & | arr, | |
| const IPosition & | axes, | |||
| Bool | axesAreCursor = True | |||
| ) | [inline] |
| casa::ReadOnlyArrayIterator< T >::ReadOnlyArrayIterator | ( | const ReadOnlyArrayIterator< T > & | ) | [private] |
Not implemented.
| void casa::ReadOnlyArrayIterator< T >::next | ( | ) | [inline] |
Move the cursor to the next position.
Definition at line 174 of file ArrayIter.h.
References casa::ReadOnlyArrayIterator< T >::ai.
| void casa::ReadOnlyArrayIterator< T >::reset | ( | ) | [inline] |
Reset the cursor to the beginning.
Definition at line 178 of file ArrayIter.h.
References casa::ReadOnlyArrayIterator< T >::ai.
| void casa::ReadOnlyArrayIterator< T >::origin | ( | ) | [inline] |
| const Array<T>& casa::ReadOnlyArrayIterator< T >::array | ( | ) | [inline] |
Return the cursor.
(Perhaps we should have a fn() that returns a reference to the original array as well?)
Definition at line 184 of file ArrayIter.h.
References casa::ReadOnlyArrayIterator< T >::ai.
| Bool casa::ReadOnlyArrayIterator< T >::atStart | ( | ) | const [inline] |
The same as the functions in ArrayPositionIterator.
Definition at line 188 of file ArrayIter.h.
References casa::ReadOnlyArrayIterator< T >::ai.
| Bool casa::ReadOnlyArrayIterator< T >::pastEnd | ( | ) | const [inline] |
| const IPosition& casa::ReadOnlyArrayIterator< T >::pos | ( | ) | const [inline] |
| IPosition casa::ReadOnlyArrayIterator< T >::endPos | ( | ) | const [inline] |
| uInt casa::ReadOnlyArrayIterator< T >::ndim | ( | ) | const [inline] |
| ReadOnlyArrayIterator<T>& casa::ReadOnlyArrayIterator< T >::operator= | ( | const ReadOnlyArrayIterator< T > & | ) | [private] |
ArrayIterator<T> casa::ReadOnlyArrayIterator< T >::ai [private] |
Definition at line 201 of file ArrayIter.h.
Referenced by casa::ReadOnlyArrayIterator< T >::array(), casa::ReadOnlyArrayIterator< T >::atStart(), casa::ReadOnlyArrayIterator< T >::endPos(), casa::ReadOnlyArrayIterator< T >::ndim(), casa::ReadOnlyArrayIterator< T >::next(), casa::ReadOnlyArrayIterator< T >::origin(), casa::ReadOnlyArrayIterator< T >::pastEnd(), casa::ReadOnlyArrayIterator< T >::pos(), and casa::ReadOnlyArrayIterator< T >::reset().
1.5.1