BitMagic-C++
Public Types | Public Member Functions | Friends
bm::rsc_sparse_vector< Val, SV >::const_iterator Class Reference

Const iterator to traverse the rsc sparse vector. More...

#include <bmsparsevec_compr.h>

Public Types

typedef std::input_iterator_tag iterator_category
 
typedef rsc_sparse_vector< Val, SV > rsc_sparse_vector_type
 
typedef rsc_sparse_vector_typersc_sparse_vector_type_ptr
 
typedef rsc_sparse_vector_type::value_type value_type
 
typedef rsc_sparse_vector_type::size_type size_type
 
typedef rsc_sparse_vector_type::bvector_type bvector_type
 
typedef bvector_type::allocator_type allocator_type
 
typedef bvector_type::allocator_type::allocator_pool_type allocator_pool_type
 
typedef bm::byte_buffer< allocator_typebuffer_type
 
typedef unsigned difference_type
 
typedef unsigned * pointer
 
typedef value_typereference
 

Public Member Functions

 const_iterator () BMNOEXCEPT
 
 const_iterator (const rsc_sparse_vector_type *csv) BMNOEXCEPT
 
 const_iterator (const rsc_sparse_vector_type *csv, size_type pos) BMNOEXCEPT
 
 const_iterator (const const_iterator &it) BMNOEXCEPT
 
bool operator== (const const_iterator &it) const BMNOEXCEPT
 
bool operator!= (const const_iterator &it) const BMNOEXCEPT
 
bool operator< (const const_iterator &it) const BMNOEXCEPT
 
bool operator<= (const const_iterator &it) const BMNOEXCEPT
 
bool operator> (const const_iterator &it) const BMNOEXCEPT
 
bool operator>= (const const_iterator &it) const BMNOEXCEPT
 
value_type operator* () const
 Get current position (value) More...
 
const_iteratoroperator++ () BMNOEXCEPT
 Advance to the next available value. More...
 
const_iteratoroperator++ (int)
 Advance to the next available value. More...
 
value_type value () const
 Get current position (value) More...
 
bool is_null () const BMNOEXCEPT
 Get NULL status. More...
 
bool valid () const BMNOEXCEPT
 Returns true if iterator is at a valid position. More...
 
void invalidate () BMNOEXCEPT
 Invalidate current iterator. More...
 
size_type pos () const BMNOEXCEPT
 Current position (index) in the vector. More...
 
void go_to (size_type pos) BMNOEXCEPT
 re-position to a specified position More...
 
bool advance () BMNOEXCEPT
 advance iterator forward by one More...
 
void skip_zero_values () BMNOEXCEPT
 

Friends

class rsc_sparse_vector
 

Detailed Description

template<class Val, class SV>
class bm::rsc_sparse_vector< Val, SV >::const_iterator

Const iterator to traverse the rsc sparse vector.

Implementation uses buffer for decoding so, competing changes to the original vector may not match the iterator returned values.

This iterator keeps an operational buffer, memory footprint is not negligable

Definition at line 124 of file bmsparsevec_compr.h.

Member Typedef Documentation

◆ allocator_pool_type

Definition at line 139 of file bmsparsevec_compr.h.

◆ allocator_type

template<class Val, class SV>
typedef bvector_type::allocator_type bm::rsc_sparse_vector< Val, SV >::const_iterator::allocator_type

Definition at line 137 of file bmsparsevec_compr.h.

◆ buffer_type

template<class Val, class SV>
typedef bm::byte_buffer<allocator_type> bm::rsc_sparse_vector< Val, SV >::const_iterator::buffer_type

Definition at line 140 of file bmsparsevec_compr.h.

◆ bvector_type

Definition at line 136 of file bmsparsevec_compr.h.

◆ difference_type

template<class Val, class SV>
typedef unsigned bm::rsc_sparse_vector< Val, SV >::const_iterator::difference_type

Definition at line 142 of file bmsparsevec_compr.h.

◆ iterator_category

template<class Val, class SV>
typedef std::input_iterator_tag bm::rsc_sparse_vector< Val, SV >::const_iterator::iterator_category

Definition at line 130 of file bmsparsevec_compr.h.

◆ pointer

template<class Val, class SV>
typedef unsigned* bm::rsc_sparse_vector< Val, SV >::const_iterator::pointer

Definition at line 143 of file bmsparsevec_compr.h.

◆ reference

template<class Val, class SV>
typedef value_type& bm::rsc_sparse_vector< Val, SV >::const_iterator::reference

Definition at line 144 of file bmsparsevec_compr.h.

◆ rsc_sparse_vector_type

template<class Val, class SV>
typedef rsc_sparse_vector<Val, SV> bm::rsc_sparse_vector< Val, SV >::const_iterator::rsc_sparse_vector_type

Definition at line 132 of file bmsparsevec_compr.h.

◆ rsc_sparse_vector_type_ptr

Definition at line 133 of file bmsparsevec_compr.h.

◆ size_type

template<class Val, class SV>
typedef rsc_sparse_vector_type::size_type bm::rsc_sparse_vector< Val, SV >::const_iterator::size_type

Definition at line 135 of file bmsparsevec_compr.h.

◆ value_type

template<class Val, class SV>
typedef rsc_sparse_vector_type::value_type bm::rsc_sparse_vector< Val, SV >::const_iterator::value_type

Definition at line 134 of file bmsparsevec_compr.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/4]

template<class Val , class BV >
bm::rsc_sparse_vector< Val, BV >::const_iterator::const_iterator ( )

Definition at line 1605 of file bmsparsevec_compr.h.

References BM_ASSERT, BMNOEXCEPT, and bm::id_max.

◆ const_iterator() [2/4]

template<class Val, class SV>
bm::rsc_sparse_vector< Val, SV >::const_iterator::const_iterator ( const rsc_sparse_vector_type csv)

◆ const_iterator() [3/4]

template<class Val, class SV>
bm::rsc_sparse_vector< Val, SV >::const_iterator::const_iterator ( const rsc_sparse_vector_type csv,
size_type  pos 
)

◆ const_iterator() [4/4]

template<class Val, class SV>
bm::rsc_sparse_vector< Val, SV >::const_iterator::const_iterator ( const const_iterator it)

Member Function Documentation

◆ advance()

template<class Val , class SV >
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::advance ( )

advance iterator forward by one

Returns
true if it is still valid

Definition at line 1653 of file bmsparsevec_compr.h.

References bm::id_max.

◆ go_to()

template<class Val , class SV >
void bm::rsc_sparse_vector< Val, SV >::const_iterator::go_to ( size_type  pos)

re-position to a specified position

Definition at line 1644 of file bmsparsevec_compr.h.

References bm::id_max, and bm::rsc_sparse_vector< Val, SV >::size().

◆ invalidate()

template<class Val, class SV>
void bm::rsc_sparse_vector< Val, SV >::const_iterator::invalidate ( )
inline

Invalidate current iterator.

Definition at line 187 of file bmsparsevec_compr.h.

References bm::id_max.

◆ is_null()

template<class Val , class SV >
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::is_null ( ) const

Get NULL status.

Definition at line 1725 of file bmsparsevec_compr.h.

◆ operator!=()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::operator!= ( const const_iterator it) const
inline

Definition at line 154 of file bmsparsevec_compr.h.

◆ operator*()

template<class Val, class SV>
value_type bm::rsc_sparse_vector< Val, SV >::const_iterator::operator* ( ) const
inline

Get current position (value)

Definition at line 166 of file bmsparsevec_compr.h.

References bm::rsc_sparse_vector< Val, SV >::is_remap_support::value.

◆ operator++() [1/2]

template<class Val, class SV>
const_iterator& bm::rsc_sparse_vector< Val, SV >::const_iterator::operator++ ( )
inline

Advance to the next available value.

Definition at line 170 of file bmsparsevec_compr.h.

◆ operator++() [2/2]

template<class Val, class SV>
const_iterator& bm::rsc_sparse_vector< Val, SV >::const_iterator::operator++ ( int  )
inline

Advance to the next available value.

Definition at line 173 of file bmsparsevec_compr.h.

References BMNOEXCEPT, bm::rsc_sparse_vector< Val, SV >::is_null(), and bm::rsc_sparse_vector< Val, SV >::is_remap_support::value.

◆ operator<()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::operator< ( const const_iterator it) const
inline

Definition at line 156 of file bmsparsevec_compr.h.

◆ operator<=()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::operator<= ( const const_iterator it) const
inline

Definition at line 158 of file bmsparsevec_compr.h.

◆ operator==()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::operator== ( const const_iterator it) const
inline

Definition at line 152 of file bmsparsevec_compr.h.

◆ operator>()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::operator> ( const const_iterator it) const
inline

Definition at line 160 of file bmsparsevec_compr.h.

◆ operator>=()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::operator>= ( const const_iterator it) const
inline

Definition at line 162 of file bmsparsevec_compr.h.

◆ pos()

template<class Val, class SV>
size_type bm::rsc_sparse_vector< Val, SV >::const_iterator::pos ( ) const
inline

Current position (index) in the vector.

Definition at line 190 of file bmsparsevec_compr.h.

References BMNOEXCEPT.

◆ skip_zero_values()

template<class Val , class SV >
void bm::rsc_sparse_vector< Val, SV >::const_iterator::skip_zero_values ( )

Definition at line 1697 of file bmsparsevec_compr.h.

References bm::id_max.

◆ valid()

template<class Val, class SV>
bool bm::rsc_sparse_vector< Val, SV >::const_iterator::valid ( ) const
inline

Returns true if iterator is at a valid position.

Definition at line 184 of file bmsparsevec_compr.h.

References bm::id_max.

◆ value()

template<class Val , class SV >
rsc_sparse_vector< Val, SV >::const_iterator::value_type bm::rsc_sparse_vector< Val, SV >::const_iterator::value ( ) const

Get current position (value)

Definition at line 1676 of file bmsparsevec_compr.h.

References BM_ASSERT.

Friends And Related Function Documentation

◆ rsc_sparse_vector

template<class Val, class SV>
friend class rsc_sparse_vector
friend

Definition at line 127 of file bmsparsevec_compr.h.


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