matio-cpp  v0.2.5
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
matioCpp::vector_iterator< Vector, IsConst > Class Template Reference

#include <matioCpp/VectorIterator.h>

Public Types

using iterator_category = std::random_access_iterator_tag
 
using value_type = std::remove_cv_t< element_type_ >
 
using difference_type = typename Vector::index_type
 
using reference = std::conditional_t< IsConst, const element_type_, element_type_ > &
 
using pointer = std::add_pointer_t< reference >
 

Public Member Functions

 vector_iterator ()=default
 
MATIOCPP_CONSTEXPR vector_iterator (input_vector_type *vector, typename Vector::index_type idx) noexcept
 
template<bool B, std::enable_if_t<!B &&IsConst > * = nullptr>
MATIOCPP_CONSTEXPR vector_iterator (const vector_iterator< Vector, B > &other) noexcept
 
MATIOCPP_CONSTEXPR reference operator* () const
 
MATIOCPP_CONSTEXPR pointer operator-> () const
 
MATIOCPP_CONSTEXPR vector_iteratoroperator++ ()
 
MATIOCPP_CONSTEXPR vector_iterator operator++ (int)
 
MATIOCPP_CONSTEXPR vector_iteratoroperator-- ()
 
MATIOCPP_CONSTEXPR vector_iterator operator-- (int)
 
MATIOCPP_CONSTEXPR vector_iterator operator+ (difference_type n) const
 
MATIOCPP_CONSTEXPR vector_iteratoroperator+= (difference_type n)
 
MATIOCPP_CONSTEXPR vector_iterator operator- (difference_type n) const
 
MATIOCPP_CONSTEXPR vector_iteratoroperator-= (difference_type n)
 
MATIOCPP_CONSTEXPR difference_type operator- (vector_iterator rhs) const
 
MATIOCPP_CONSTEXPR reference operator[] (difference_type n) const
 

Data Fields

friend vector_iterator< Vector, true >
 

Protected Attributes

input_vector_type * vector_ = nullptr
 
std::ptrdiff_t index_ = 0
 

Friends

MATIOCPP_CONSTEXPR friend bool operator== (vector_iterator lhs, vector_iterator rhs) noexcept
 
MATIOCPP_CONSTEXPR friend bool operator!= (vector_iterator lhs, vector_iterator rhs) noexcept
 
MATIOCPP_CONSTEXPR friend bool operator< (vector_iterator lhs, vector_iterator rhs) noexcept
 
MATIOCPP_CONSTEXPR friend bool operator<= (vector_iterator lhs, vector_iterator rhs) noexcept
 
MATIOCPP_CONSTEXPR friend bool operator> (vector_iterator lhs, vector_iterator rhs) noexcept
 
MATIOCPP_CONSTEXPR friend bool operator>= (vector_iterator lhs, vector_iterator rhs) noexcept
 

Detailed Description

template<class Vector, bool IsConst>
class matioCpp::vector_iterator< Vector, IsConst >

Definition at line 36 of file VectorIterator.h.

Member Typedef Documentation

◆ difference_type

template<class Vector , bool IsConst>
using matioCpp::vector_iterator< Vector, IsConst >::difference_type = typename Vector::index_type

Definition at line 45 of file VectorIterator.h.

◆ iterator_category

template<class Vector , bool IsConst>
using matioCpp::vector_iterator< Vector, IsConst >::iterator_category = std::random_access_iterator_tag

Definition at line 43 of file VectorIterator.h.

◆ pointer

template<class Vector , bool IsConst>
using matioCpp::vector_iterator< Vector, IsConst >::pointer = std::add_pointer_t<reference>

Definition at line 48 of file VectorIterator.h.

◆ reference

template<class Vector , bool IsConst>
using matioCpp::vector_iterator< Vector, IsConst >::reference = std::conditional_t<IsConst, const element_type_, element_type_>&

Definition at line 47 of file VectorIterator.h.

◆ value_type

template<class Vector , bool IsConst>
using matioCpp::vector_iterator< Vector, IsConst >::value_type = std::remove_cv_t<element_type_>

Definition at line 44 of file VectorIterator.h.

Constructor & Destructor Documentation

◆ vector_iterator() [1/3]

template<class Vector , bool IsConst>
matioCpp::vector_iterator< Vector, IsConst >::vector_iterator ( )
default

◆ vector_iterator() [2/3]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR matioCpp::vector_iterator< Vector, IsConst >::vector_iterator ( input_vector_type *  vector,
typename Vector::index_type  idx 
)
inlinenoexcept

Definition at line 52 of file VectorIterator.h.

◆ vector_iterator() [3/3]

template<class Vector , bool IsConst>
template<bool B, std::enable_if_t<!B &&IsConst > * = nullptr>
MATIOCPP_CONSTEXPR matioCpp::vector_iterator< Vector, IsConst >::vector_iterator ( const vector_iterator< Vector, B > &  other)
inlinenoexcept

Definition at line 58 of file VectorIterator.h.

Member Function Documentation

◆ operator*()

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR reference matioCpp::vector_iterator< Vector, IsConst >::operator* ( ) const
inline

◆ operator+()

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator matioCpp::vector_iterator< Vector, IsConst >::operator+ ( difference_type  n) const
inline

Definition at line 103 of file VectorIterator.h.

◆ operator++() [1/2]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator& matioCpp::vector_iterator< Vector, IsConst >::operator++ ( )
inline

◆ operator++() [2/2]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator matioCpp::vector_iterator< Vector, IsConst >::operator++ ( int  )
inline

Definition at line 82 of file VectorIterator.h.

◆ operator+=()

◆ operator-() [1/2]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator matioCpp::vector_iterator< Vector, IsConst >::operator- ( difference_type  n) const
inline

Definition at line 116 of file VectorIterator.h.

◆ operator-() [2/2]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR difference_type matioCpp::vector_iterator< Vector, IsConst >::operator- ( vector_iterator< Vector, IsConst >  rhs) const
inline

◆ operator--() [1/2]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator& matioCpp::vector_iterator< Vector, IsConst >::operator-- ( )
inline

◆ operator--() [2/2]

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator matioCpp::vector_iterator< Vector, IsConst >::operator-- ( int  )
inline

Definition at line 96 of file VectorIterator.h.

◆ operator-=()

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR vector_iterator& matioCpp::vector_iterator< Vector, IsConst >::operator-= ( difference_type  n)
inline

Definition at line 122 of file VectorIterator.h.

◆ operator->()

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR pointer matioCpp::vector_iterator< Vector, IsConst >::operator-> ( ) const
inline

◆ operator[]()

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR reference matioCpp::vector_iterator< Vector, IsConst >::operator[] ( difference_type  n) const
inline

Definition at line 130 of file VectorIterator.h.

Friends And Related Function Documentation

◆ operator!=

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR friend bool operator!= ( vector_iterator< Vector, IsConst >  lhs,
vector_iterator< Vector, IsConst >  rhs 
)
friend

Definition at line 141 of file VectorIterator.h.

◆ operator<

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR friend bool operator< ( vector_iterator< Vector, IsConst >  lhs,
vector_iterator< Vector, IsConst >  rhs 
)
friend

Definition at line 147 of file VectorIterator.h.

◆ operator<=

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR friend bool operator<= ( vector_iterator< Vector, IsConst >  lhs,
vector_iterator< Vector, IsConst >  rhs 
)
friend

Definition at line 153 of file VectorIterator.h.

◆ operator==

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR friend bool operator== ( vector_iterator< Vector, IsConst >  lhs,
vector_iterator< Vector, IsConst >  rhs 
)
friend

Definition at line 135 of file VectorIterator.h.

◆ operator>

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR friend bool operator> ( vector_iterator< Vector, IsConst >  lhs,
vector_iterator< Vector, IsConst >  rhs 
)
friend

Definition at line 159 of file VectorIterator.h.

◆ operator>=

template<class Vector , bool IsConst>
MATIOCPP_CONSTEXPR friend bool operator>= ( vector_iterator< Vector, IsConst >  lhs,
vector_iterator< Vector, IsConst >  rhs 
)
friend

Definition at line 165 of file VectorIterator.h.

Field Documentation

◆ index_

◆ vector_

◆ vector_iterator< Vector, true >

template<class Vector , bool IsConst>
friend matioCpp::vector_iterator< Vector, IsConst >::vector_iterator< Vector, true >

Definition at line 56 of file VectorIterator.h.


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