cartobase 6.0.6
carto::NDIterator_base Class Reference

Base class for N-dimensional array iterators. More...

#include <cartobase/containers/nditerator.h>

Inheritance diagram for carto::NDIterator_base:
Collaboration diagram for carto::NDIterator_base:

Public Member Functions

 NDIterator_base (const std::vector< int > &dims)
 
 NDIterator_base (const std::vector< int > &dims, const std::vector< int > &strides)
 
 NDIterator_base (const std::vector< int > &dims, const std::vector< std::size_t > &strides)
 
 NDIterator_base (const std::vector< int > &dims, const std::vector< std::ptrdiff_t > &strides)
 
const std::vector< int > & position () const
 
std::ptrdiff_t offset () const
 
NDIterator_baseoperator++ ()
 
bool ended () const
 
void reset ()
 

Static Protected Member Functions

template<typename T>
static std::vector< std::ptrdiff_t > to_ptrdiff_v (const std::vector< T > &v)
 

Protected Attributes

std::vector< int > _dims
 
std::vector< std::ptrdiff_t > _strides
 
std::vector< int > _position
 
std::ptrdiff_t _offset
 
bool _ended
 

Detailed Description

Base class for N-dimensional array iterators.

See NDIterator, const_NDIterator, line_NDIterator, and const_line_NDIterator.

Definition at line 51 of file nditerator.h.

Constructor & Destructor Documentation

◆ NDIterator_base() [1/4]

◆ NDIterator_base() [2/4]

carto::NDIterator_base::NDIterator_base ( const std::vector< int > & dims,
const std::vector< int > & strides )
inline

Definition at line 279 of file nditerator.h.

References _dims, _ended, _offset, _position, _strides, NDIterator_base(), and to_ptrdiff_v().

◆ NDIterator_base() [3/4]

carto::NDIterator_base::NDIterator_base ( const std::vector< int > & dims,
const std::vector< std::size_t > & strides )
inline

Definition at line 290 of file nditerator.h.

References _dims, _ended, _offset, _position, _strides, NDIterator_base(), and to_ptrdiff_v().

◆ NDIterator_base() [4/4]

carto::NDIterator_base::NDIterator_base ( const std::vector< int > & dims,
const std::vector< std::ptrdiff_t > & strides )
inline

Definition at line 300 of file nditerator.h.

References _dims, _ended, _offset, _position, _strides, NDIterator_base(), and to_ptrdiff_v().

Member Function Documentation

◆ ended()

bool carto::NDIterator_base::ended ( ) const
inline

Definition at line 323 of file nditerator.h.

References _ended.

◆ offset()

std::ptrdiff_t carto::NDIterator_base::offset ( ) const
inline

Definition at line 317 of file nditerator.h.

References _offset.

◆ operator++()

NDIterator_base & carto::NDIterator_base::operator++ ( )
inline

Definition at line 345 of file nditerator.h.

References _dims, _ended, _offset, _position, _strides, and NDIterator_base().

◆ position()

const std::vector< int > & carto::NDIterator_base::position ( ) const
inline

Definition at line 311 of file nditerator.h.

References _position.

◆ reset()

void carto::NDIterator_base::reset ( )
inline

Definition at line 329 of file nditerator.h.

References _dims, _offset, and _position.

◆ to_ptrdiff_v()

template<typename T>
std::vector< std::ptrdiff_t > carto::NDIterator_base::to_ptrdiff_v ( const std::vector< T > & v)
inlinestaticprotected

Definition at line 337 of file nditerator.h.

Referenced by NDIterator_base(), NDIterator_base(), and NDIterator_base().

Member Data Documentation

◆ _dims

std::vector<int> carto::NDIterator_base::_dims
protected

◆ _ended

◆ _offset

◆ _position

std::vector<int> carto::NDIterator_base::_position
protected

◆ _strides


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