Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
serialbox::ConstStorageViewIterator Class Reference

Non-mutable forward iterator to access the data of a StorageView. More...

#include <StorageViewIterator.h>

Inheritance diagram for serialbox::ConstStorageViewIterator:
serialbox::StorageViewIteratorBase< const Byte >

Public Types

using Base = StorageViewIteratorBase< const Byte >
 
- Public Types inherited from serialbox::StorageViewIteratorBase< const Byte >
using value_type = const Byte
 
using diffrence_type = std::ptrdiff_t
 
using pointer = value_type *
 
using refrence = value_type &
 
using iterator = StorageViewIteratorBase< const Byte >
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 ConstStorageViewIterator (const ConstStorageViewIterator &)=default
 Copy constructor.
 
 ConstStorageViewIterator (ConstStorageViewIterator &&)=default
 Move constructor.
 
 ConstStorageViewIterator (Base::value_type *originPtr, int bytesPerElement, const std::vector< int > &dims, const std::vector< int > &strides, const Slice &slice, bool beginning)
 Construct iterator at specific location in the data. More...
 
- Public Member Functions inherited from serialbox::StorageViewIteratorBase< const Byte >
int bytesPerElement () noexcept
 Get bytes per element.
 
value_type * ptr () noexcept
 Get current data pointer.
 
match_cv_qualifier< value_type, T >::type & as () noexcept
 Interpret current data pointer as type ´T´
 
match_cv_qualifier< value_type, T >::type & as () const noexcept
 
const std::vector< int > & index () const noexcept
 Get current index position in the data.
 
 StorageViewIteratorBase (const iterator &)=default
 Copy constructor.
 
 StorageViewIteratorBase (iterator &&)=default
 Move constructor.
 
 StorageViewIteratorBase (value_type *originPtr, int bytesPerElement, const std::vector< int > &dims, const std::vector< int > &strides, const Slice &slice, bool beginning)
 Construct iterator at specific location in the data. More...
 
iteratoroperator= (const iterator &)=default
 Copy assignment.
 
iteratoroperator= (iterator &&)=default
 Move assignment.
 
bool operator== (const iterator &right) const noexcept
 Test for equality.
 
bool operator!= (const iterator &right) const noexcept
 Test for inequality.
 
iteratoroperator++ () noexcept
 Pre-increment.
 
refrence operator* () noexcept
 Derefrence.
 
void swap (iterator &other) noexcept
 Swap with other.
 

Additional Inherited Members

- Protected Member Functions inherited from serialbox::StorageViewIteratorBase< const Byte >
int computeCurrentIndex () const noexcept
 Compute the current linear index in the data according to the index vector.
 
- Protected Attributes inherited from serialbox::StorageViewIteratorBase< const Byte >
value_type * curPtr_
 
std::vector< int > index_
 
bool end_
 
value_type * originPtr_
 
std::vector< int > dims_
 
std::vector< int > strides_
 
int bytesPerElement_
 
Slice slice_
 

Detailed Description

Non-mutable forward iterator to access the data of a StorageView.

The data is accessed in column-major order using operator++ (pre-increment).

Definition at line 256 of file StorageViewIterator.h.

Constructor & Destructor Documentation

◆ ConstStorageViewIterator()

serialbox::ConstStorageViewIterator::ConstStorageViewIterator ( Base::value_type *  originPtr,
int  bytesPerElement,
const std::vector< int > &  dims,
const std::vector< int > &  strides,
const Slice slice,
bool  beginning 
)
inline

Construct iterator at specific location in the data.

Parameters
originPtrOrigin pointer of the associated StorageView
bytesPerElementNumber of bytes of the underlying data-type
dimsVector of dimensions
stridesVector of strides
sliceSlice of the data
beginningIndicate whether the iterator has reached the end

Definition at line 274 of file StorageViewIterator.h.


The documentation for this class was generated from the following file: