ArrayImpl::IteratorImpl
IteratorImpl
Section titled “IteratorImpl”#include <ncarray/array_impl.hh>template<class VT>class IteratorImplDefined in src/lib/ncarray/array_impl.hh:1752
An value-based iterator for traversing an array along the first dimension.
This iterator is in some respects atypical by standard C++ standards. However, it provides a simplified API for a common operation on multi-dimensional arrays, namely, iterating along an axis – in particular, it iterates the FIRST axis.
This iterator implementation generates sub-views by value on the fly. The ArrayImpl class is rather light-weight and the views are non-owning, so this strategy is appropriate. The complexity of managing a true pointer/reference based iterator for array’s with varying layouts of suboffsets (pointer axes) outweighs the benefits in reducing the subview construction by value cost.
Template Parameters
Section titled “Template Parameters”VTThe ArrayImpl view type.
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
operator== |
friend |
Declared here |
operator!= |
friend |
Declared here |
IteratorImpl |
function |
Declared here |
operator* |
function |
Declared here |
operator++ |
function |
Declared here |
operator++ |
function |
Declared here |
iterator_category |
typedef |
Declared here |
difference_type |
typedef |
Declared here |
value_type |
typedef |
Declared here |
pointer |
typedef |
Declared here |
reference |
typedef |
Declared here |
m_view |
variable |
Declared here |
m_idx |
variable |
Declared here |
Friends
Section titled “Friends”| Name | Description |
|---|---|
operator== inline |
|
operator!= inline |
operator==
Section titled “operator==”inline
friend inline bool operator==(const IteratorImpl & a, const IteratorImpl & b)Defined in src/lib/ncarray/array_impl.hh:1780
operator!=
Section titled “operator!=”inline
friend inline bool operator!=(const IteratorImpl & a, const IteratorImpl & b)Defined in src/lib/ncarray/array_impl.hh:1784
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
IteratorImpl inline |
||
reference |
operator* const inline |
|
IteratorImpl & |
operator++ inline |
|
IteratorImpl |
operator++ inline |
IteratorImpl
Section titled “IteratorImpl”inline
inline IteratorImpl(VT view, ssize_t idx)Defined in src/lib/ncarray/array_impl.hh:1762
operator*
Section titled “operator*”const inline
inline reference operator*() constDefined in src/lib/ncarray/array_impl.hh:1767
operator++
Section titled “operator++”inline
inline IteratorImpl & operator++()Defined in src/lib/ncarray/array_impl.hh:1770
operator++
Section titled “operator++”inline
inline IteratorImpl operator++(int)Defined in src/lib/ncarray/array_impl.hh:1774
Public Types
Section titled “Public Types”| Name | Description |
|---|---|
iterator_category |
|
difference_type |
|
value_type |
|
pointer |
|
reference |
iterator_category
Section titled “iterator_category”using iterator_category = std::input_iterator_tagDefined in src/lib/ncarray/array_impl.hh:1755
difference_type
Section titled “difference_type”using difference_type = std::ptrdiff_tDefined in src/lib/ncarray/array_impl.hh:1756
value_type
Section titled “value_type”using value_type = ViewTypeDefined in src/lib/ncarray/array_impl.hh:1757
pointer
Section titled “pointer”using pointer = voidDefined in src/lib/ncarray/array_impl.hh:1759
reference
Section titled “reference”using reference = value_typeDefined in src/lib/ncarray/array_impl.hh:1760
Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
VT |
m_view |
|
ssize_t |
m_idx |
m_view
Section titled “m_view”VT m_viewDefined in src/lib/ncarray/array_impl.hh:1790
ssize_t m_idxDefined in src/lib/ncarray/array_impl.hh:1791