BitMagic-C++
|
Const iterator to do quick traverse of the sparse vector. More...
#include <bmstrsparsevec.h>
Public Types | |
typedef std::input_iterator_tag | iterator_category |
typedef std::basic_string_view< CharType > | string_view_type |
typedef str_sparse_vector< CharType, BV, STR_SIZE > | str_sparse_vector_type |
typedef str_sparse_vector_type * | str_sparse_vector_type_ptr |
typedef str_sparse_vector_type::value_type | value_type |
typedef str_sparse_vector_type::size_type | size_type |
typedef str_sparse_vector_type::bvector_type | bvector_type |
typedef bvector_type::allocator_type | allocator_type |
typedef allocator_type::allocator_pool_type | allocator_pool_type |
typedef long long | difference_type |
typedef CharType * | pointer |
typedef CharType *& | reference |
Public Member Functions | |
const_iterator () BMNOEXCEPT | |
Construct iterator (not attached to any particular vector) More... | |
const_iterator (const str_sparse_vector_type *sv) BMNOEXCEPT | |
Construct iterator (attached to sparse vector) More... | |
const_iterator (const str_sparse_vector_type *sv, size_type pos) BMNOEXCEPT | |
Construct iterator (attached to sparse vector) and positioned. More... | |
const_iterator (const const_iterator &it) BMNOEXCEPT | |
void | set_substr (unsigned from, unsigned len=0) BMNOEXCEPT |
setup iterator to retrieve a sub-string of a string More... | |
bool | operator== (const const_iterator &it) const BMNOEXCEPT |
More... | |
bool | operator!= (const const_iterator &it) const BMNOEXCEPT |
More... | |
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 |
const value_type * | operator* () const |
Get current position (value) More... | |
const_iterator & | operator++ () BMNOEXCEPT |
Advance to the next available value. More... | |
const_iterator & | operator++ (int) BMNOEXCEPT |
Advance to the next available value. More... | |
const value_type * | value () const |
Get zero terminated string value at the current position. More... | |
string_view_type | get_string_view () const |
Get current string as string_view. 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... | |
void | advance () BMNOEXCEPT |
advance iterator forward by one More... | |
Protected Types | |
enum | buf_size_e { n_rows = 1024 } |
typedef dynamic_heap_matrix< CharType, allocator_type > | buffer_matrix_type |
Friends | |
class | str_sparse_vector |
Const iterator to do quick traverse of the 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 of decoded elements, so memory footprint is NOT negligable.
Definition at line 213 of file bmstrsparsevec.h.
|
protected |
Enumerator | |
---|---|
n_rows |
Definition at line 310 of file bmstrsparsevec.h.
bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::const_iterator |
Construct iterator (not attached to any particular vector)
Definition at line 2446 of file bmstrsparsevec.h.
bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::const_iterator | ( | const str_sparse_vector_type * | sv | ) |
Construct iterator (attached to sparse vector)
sv | - pointer to sparse vector |
Definition at line 2466 of file bmstrsparsevec.h.
bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::const_iterator | ( | const str_sparse_vector_type * | sv, |
size_type | pos | ||
) |
Construct iterator (attached to sparse vector) and positioned.
sv | - reference to sparse vector |
pos | - position in the vector to start |
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::advance |
advance iterator forward by one
Definition at line 2582 of file bmstrsparsevec.h.
References bm::id_max.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::operator++().
str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::string_view_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::get_string_view |
Get current string as string_view.
Definition at line 2542 of file bmstrsparsevec.h.
References BM_ASSERT, bm::id_max, and bm::base_sparse_vector< CharType, BV, STR_SIZE >::is_null().
Referenced by main().
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::go_to | ( | size_type | pos | ) |
re-position to a specified position
Definition at line 2570 of file bmstrsparsevec.h.
References bm::id_max.
Referenced by main().
|
inline |
Invalidate current iterator.
Definition at line 298 of file bmstrsparsevec.h.
References bm::id_max.
|
inline |
Get NULL status.
Definition at line 292 of file bmstrsparsevec.h.
References bm::base_sparse_vector< Val, BV, MAX_SIZE >::is_null().
Referenced by main().
|
inline |
Definition at line 261 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::operator==().
|
inline |
Get current position (value)
Definition at line 273 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::value().
|
inline |
Advance to the next available value.
Definition at line 277 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::advance().
|
inline |
Advance to the next available value.
Definition at line 281 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::advance().
|
inline |
Definition at line 259 of file bmstrsparsevec.h.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::operator!=().
|
inline |
Current position (index) in the vector.
Definition at line 301 of file bmstrsparsevec.h.
void bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::set_substr | ( | unsigned | from, |
unsigned | len = 0 |
||
) |
setup iterator to retrieve a sub-string of a string
from | - Position of the first character to be copied |
len | - length of a substring (defult: 0 read to the available end) |
Definition at line 2491 of file bmstrsparsevec.h.
References bm::str_sparse_vector< CharType, BV, STR_SIZE >::max_str().
Referenced by main().
|
inline |
Returns true if iterator is at a valid position.
Definition at line 295 of file bmstrsparsevec.h.
References bm::id_max.
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::calc_octet_stat(), and main().
const str_sparse_vector< CharType, BV, STR_SIZE >::value_type * bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::value |
Get zero terminated string value at the current position.
Definition at line 2515 of file bmstrsparsevec.h.
References BM_ASSERT, bm::id_max, and bm::base_sparse_vector< CharType, BV, STR_SIZE >::is_null().
Referenced by bm::str_sparse_vector< CharType, BV, STR_SIZE >::const_iterator::operator*().