|
BitMagic-C++
|
Back insert iterator implements buffered insert, faster than generic access assignment. More...
#include <bmstrsparsevec.h>

Public Types | |
| typedef std::output_iterator_tag | iterator_category |
| 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 void | difference_type |
| typedef void | pointer |
| typedef void | reference |
Public Member Functions | |
| back_insert_iterator () BMNOEXCEPT | |
| back_insert_iterator (str_sparse_vector_type *sv) BMNOEXCEPT | |
| back_insert_iterator (const back_insert_iterator &bi) BMNOEXCEPT | |
| back_insert_iterator & | operator= (const back_insert_iterator &bi) |
| ~back_insert_iterator () | |
| void | set_optimize (typename bvector_type::optmode opt_mode) BMNOEXCEPT |
| Set optimization on load option (deafult: false). | |
| void | set_remap (bool flag) BMNOEXCEPT |
| Method to configure back inserter to collect statistics on optimal character codes. | |
| unsigned | get_remap () const BMNOEXCEPT |
| Get curent remap state flags. | |
| back_insert_iterator & | operator= (const value_type *v) |
| push value to the vector | |
| template<typename StrType> | |
| back_insert_iterator & | operator= (const StrType &v) |
| push value to the vector | |
| back_insert_iterator & | operator* () |
| noop | |
| back_insert_iterator & | operator++ () |
| noop | |
| back_insert_iterator & | operator++ (int) |
| noop | |
| void | add (const value_type *v) |
| add value to the container | |
| void | add_null () |
| add NULL (no-value) to the container | |
| void | add_null (size_type count) |
| add a series of consequitve NULLs (no-value) to the container | |
| void | flush () |
| flush the accumulated buffer. | |
| const octet_freq_matrix_type & | get_octet_matrix () const noexcept |
| Get octet frequence matrix. | |
Protected Types | |
| typedef bvector_type::block_idx_type | block_idx_type |
Protected Member Functions | |
| bool | empty () const BMNOEXCEPT |
| return true if insertion buffer is empty | |
| void | add_value (const value_type *v) |
| add value to the buffer without changing the NULL vector | |
| void | add_remap_stat (const value_type *v) |
| account new value as remap statistics | |
| void | flush_impl () |
Protected Attributes | |
| str_sparse_vector_type * | sv_ |
| bvector_type * | bv_null_ |
| !< pointer on the parent vector | |
| buffer_matrix_type | buf_matrix_ |
| !< not NULL vector pointer | |
| size_type | pos_in_buf_ |
| !< value buffer | |
| block_idx_type | prev_nb_ = 0 |
| !< buffer position | |
| bvector_type::optmode | opt_mode_ = bvector_type::opt_compress |
| !< previous block added | |
| unsigned | remap_flags_ = 0 |
| target remapping | |
| octet_freq_matrix_type | omatrix_ |
| octet frequency matrix | |
Friends | |
| class | str_sparse_vector |
Back insert iterator implements buffered insert, faster than generic access assignment.
Limitations for buffered inserter:
Definition at line 339 of file bmstrsparsevec.h.
| typedef allocator_type::allocator_pool_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::allocator_pool_type |
Definition at line 351 of file bmstrsparsevec.h.
| typedef bvector_type::allocator_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::allocator_type |
Definition at line 350 of file bmstrsparsevec.h.
|
protected |
Definition at line 440 of file bmstrsparsevec.h.
| typedef str_sparse_vector_type::bvector_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::bvector_type |
Definition at line 349 of file bmstrsparsevec.h.
| typedef void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::difference_type |
Definition at line 353 of file bmstrsparsevec.h.
| typedef std::output_iterator_tag bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::iterator_category |
Definition at line 343 of file bmstrsparsevec.h.
| typedef void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::pointer |
Definition at line 354 of file bmstrsparsevec.h.
| typedef void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::reference |
Definition at line 355 of file bmstrsparsevec.h.
| typedef str_sparse_vector_type::size_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::size_type |
Definition at line 348 of file bmstrsparsevec.h.
| typedef str_sparse_vector<CharType, BV, STR_SIZE> bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::str_sparse_vector_type |
Definition at line 345 of file bmstrsparsevec.h.
| typedef str_sparse_vector_type* bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::str_sparse_vector_type_ptr |
Definition at line 346 of file bmstrsparsevec.h.
| typedef str_sparse_vector_type::value_type bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::value_type |
Definition at line 347 of file bmstrsparsevec.h.
| bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::back_insert_iterator | ( | ) |
Definition at line 2806 of file bmstrsparsevec.h.
References BMNOEXCEPT, bv_null_, pos_in_buf_, and sv_.
Referenced by back_insert_iterator(), operator*(), operator++(), operator++(), operator=(), operator=(), and operator=().
| bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::back_insert_iterator | ( | str_sparse_vector_type * | sv | ) |
Definition at line 2813 of file bmstrsparsevec.h.
References BMNOEXCEPT, buf_matrix_, bv_null_, pos_in_buf_, prev_nb_, bm::set_block_shift, str_sparse_vector, and sv_.
| bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::back_insert_iterator | ( | const back_insert_iterator & | bi | ) |
References back_insert_iterator(), and BMNOEXCEPT.
| bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::~back_insert_iterator | ( | ) |
Definition at line 2847 of file bmstrsparsevec.h.
References flush().
| void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::add | ( | const value_type * | v | ) |
add value to the container
Definition at line 2899 of file bmstrsparsevec.h.
References add_null(), add_value(), bv_null_, pos_in_buf_, and sv_.
Referenced by operator=(), and operator=().
| void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::add_null | ( | ) |
add NULL (no-value) to the container
Definition at line 2918 of file bmstrsparsevec.h.
References add_value().
Referenced by add().
| void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::add_null | ( | size_type | count | ) |
add a series of consequitve NULLs (no-value) to the container
|
protected |
account new value as remap statistics
Definition at line 2938 of file bmstrsparsevec.h.
References BM_ASSERT, omatrix_, and remap_flags_.
Referenced by add_value().
|
protected |
add value to the buffer without changing the NULL vector
| v | - value to push back |
Definition at line 2978 of file bmstrsparsevec.h.
References add_remap_stat(), BM_ASSERT, buf_matrix_, flush_impl(), pos_in_buf_, remap_flags_, and sv_.
Referenced by add(), and add_null().
|
protected |
return true if insertion buffer is empty
Definition at line 2856 of file bmstrsparsevec.h.
References BMNOEXCEPT, pos_in_buf_, and sv_.
| void bm::str_sparse_vector< CharType, BV, STR_SIZE >::back_insert_iterator::flush | ( | ) |
flush the accumulated buffer.
It is important to call flush at the end, before destruction of the inserter. Flush may throw exceptions, which will be possible to intercept. Otherwise inserter is flushed in the destructor.
Definition at line 2865 of file bmstrsparsevec.h.
References buf_matrix_, flush_impl(), remap_flags_, and sv_.
Referenced by ~back_insert_iterator().
|
protected |
Definition at line 2879 of file bmstrsparsevec.h.
References buf_matrix_, bm::str_sparse_vector< CharType, BV, STR_SIZE >::empty(), opt_mode_, pos_in_buf_, prev_nb_, bm::set_block_shift, and sv_.
Referenced by add_value(), flush(), and operator=().
|
inlinenoexcept |
|
inline |
Get curent remap state flags.
Definition at line 392 of file bmstrsparsevec.h.
References BMNOEXCEPT, and remap_flags_.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 362 of file bmstrsparsevec.h.
References back_insert_iterator(), BM_ASSERT, buf_matrix_, flush_impl(), and sv_.
|
inline |
push value to the vector
Definition at line 401 of file bmstrsparsevec.h.
References add(), and back_insert_iterator().
|
inline |
push value to the vector
Definition at line 395 of file bmstrsparsevec.h.
References add(), and back_insert_iterator().
|
inline |
Set optimization on load option (deafult: false).
Definition at line 376 of file bmstrsparsevec.h.
References BMNOEXCEPT, and opt_mode_.
|
inline |
Method to configure back inserter to collect statistics on optimal character codes.
This methos makes back inserter slower, but can be used to accelerate later remap() of the sparse vector. Use flush at the end to apply the remapping. By default inserter does not collect additional statistics.
Important! You should NOT use intermediate flush if you set remapping!
Definition at line 389 of file bmstrsparsevec.h.
References BMNOEXCEPT, and remap_flags_.
|
friend |
Definition at line 461 of file bmstrsparsevec.h.
References str_sparse_vector.
Referenced by back_insert_iterator(), and str_sparse_vector.
|
protected |
!< not NULL vector pointer
Definition at line 466 of file bmstrsparsevec.h.
Referenced by add_value(), back_insert_iterator(), flush(), flush_impl(), and operator=().
|
protected |
!< pointer on the parent vector
Definition at line 465 of file bmstrsparsevec.h.
Referenced by add(), back_insert_iterator(), and back_insert_iterator().
|
protected |
octet frequency matrix
Definition at line 473 of file bmstrsparsevec.h.
Referenced by add_remap_stat(), get_octet_matrix(), and bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap().
|
protected |
!< previous block added
Definition at line 470 of file bmstrsparsevec.h.
Referenced by flush_impl(), and set_optimize().
|
protected |
!< value buffer
Definition at line 467 of file bmstrsparsevec.h.
Referenced by add(), add_value(), back_insert_iterator(), back_insert_iterator(), empty(), and flush_impl().
|
protected |
!< buffer position
Definition at line 468 of file bmstrsparsevec.h.
Referenced by back_insert_iterator(), and flush_impl().
|
protected |
target remapping
Definition at line 472 of file bmstrsparsevec.h.
Referenced by add_remap_stat(), add_value(), flush(), get_remap(), bm::str_sparse_vector< CharType, BV, STR_SIZE >::remap(), and set_remap().
|
protected |
Definition at line 464 of file bmstrsparsevec.h.
Referenced by add(), add_value(), back_insert_iterator(), back_insert_iterator(), empty(), flush(), flush_impl(), and operator=().