An iterator which allows to access each component element type of an array of vectors, or a vector of arrays.
More...
#include <Iterator.hpp>
List of all members.
Public Types
-
typedef Eagle::MetaInfo< T > info_t
-
typedef info_t::element_t element_info_t
Public Member Functions
-
ElementIterator (index_t Length, T *Data, index_t Stride, index_t Offset)
- Construct an element iterator.
-
ElementIterator (const ElementIterator &It)
- Copy Constructor.
-
ElementIterator (const HyperslabParameters &It, T *newData)
- Constructor compatible iterator with new data.
-
ElementIterator (index_t i, const ElementIterator &It, const Add &)
- Addition Constructor.
-
void SetNewData (T *newData, index_t newLength) throw ()
- Change the stored data chunk to a new location and length.
-
T * ptr (int c=0) const
- Return pointer to data, which is good for C interface, but otherwise, avoid that.
- T & operator() (index_t i, int c) const
- Element access (no range check!).
-
operator bool () const
- Implicit conversion to boolean: Check whether this is a valid pointer.
Protected Member Functions
-
void incPtr (index_t what)
Detailed Description
template<class T>
class ElementIterator< T >
An iterator which allows to access each component element type of an array of vectors, or a vector of arrays.
The provided indexing scheme is two-dimensional, for the array index first and then the component.
The iterator works both for arrays of vectors as well as for vectors of arrays. However, manual setup of the right parameters is tedious. The derived Iterator classes provide a more convenient interface to do so.
- Note:
- No range check is performed here! The caller must ensure that the numerical values of the array and component index are valid.
Member Function Documentation
Element access (no range check!).
Each element of the data array is accessed according to
data[ (shift + i)*stride + c*offset]
This indexing scheme works both for arrays of vectors and vectors of arrays.
- Parameters:
-
| i | the array index |
| c | the component index |