BitMagic-C++
|
Serialization stream iterator. More...
#include <bmserial.h>
Public Types | |
enum | iterator_state { e_unknown = 0, e_list_ids, e_blocks, e_zero_blocks, e_one_blocks, e_bit_block, e_gap_block } |
iterator is a state machine, this enum encodes its key value More... | |
typedef deseriaizer_base< DEC >::decoder_type | decoder_type |
typedef bm::id_t | block_idx_type |
typedef unsigned(serial_stream_iterator< DEC >::* | get_bit_func_type) (bm::word_t *, bm::word_t *) |
member function pointer for bitset-bitset get operations More... | |
Public Member Functions | |
serial_stream_iterator (const unsigned char *buf) | |
~serial_stream_iterator () | |
block_idx_type | bv_size () const |
serialized bitvector size More... | |
bool | is_eof () const |
Returns true if end of bit-stream reached. More... | |
void | next () |
get next block More... | |
block_idx_type | skip_mono_blocks () |
skip all zero or all-one blocks More... | |
unsigned | get_bit_block (bm::word_t *dst_block, bm::word_t *tmp_block, set_operation op) |
read bit block, using logical operation More... | |
void | get_gap_block (bm::gap_word_t *dst_block) |
Read gap block data (with head) More... | |
unsigned | dec_size () const |
Return current decoder size. More... | |
decoder_type & | decoder () |
Get low level access to the decoder (use carefully) More... | |
iterator_state | state () const |
Returns iterator internal state. More... | |
iterator_state | get_state () const |
unsigned | get_id_count () const |
Number of ids in the inverted list (valid for e_list_ids) More... | |
bm::id_t | get_id () const |
Get last id from the id list. More... | |
block_idx_type | block_idx () const |
Get current block index. More... | |
unsigned | get_bit_block_ASSIGN (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_OR (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_AND (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_SUB (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_XOR (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_AND (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_OR (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_XOR (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_SUB_AB (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_SUB_BA (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_A (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_bit_block_COUNT_B (bm::word_t *dst_block, bm::word_t *tmp_block) |
unsigned | get_arr_bit (bm::word_t *dst_block, bool clear_target=true) |
Get array of bits out of the decoder into bit block (Converts inverted list into bits) Returns number of words (bits) being read. More... | |
unsigned | get_block_type () const |
Get current block type. More... | |
unsigned | get_bit () |
void | get_inv_arr (bm::word_t *block) |
Protected Attributes | |
get_bit_func_type | bit_func_table_ [bm::set_END] |
decoder_type | decoder_ |
bool | end_of_stream_ |
block_idx_type | bv_size_ |
iterator_state | state_ |
unsigned | id_cnt_ |
Id counter for id list. More... | |
bm::id_t | last_id_ |
Last id from the id list. More... | |
gap_word_t | glevels_ [bm::gap_levels] |
GAP levels. More... | |
unsigned | block_type_ |
current block type More... | |
block_idx_type | block_idx_ |
current block index More... | |
block_idx_type | mono_block_cnt_ |
number of 0 or 1 blocks More... | |
gap_word_t | gap_head_ |
gap_word_t * | block_idx_arr_ |
![]() | |
bm::gap_word_t * | id_array_ |
ptr to idx array for temp decode use More... | |
Additional Inherited Members | |
![]() | |
typedef DEC | decoder_type |
![]() | |
deseriaizer_base () | |
void | read_gap_block (decoder_type &decoder, unsigned block_type, bm::gap_word_t *dst_block, bm::gap_word_t &gap_head) |
Read GAP block from the stream. More... | |
unsigned | read_id_list (decoder_type &decoder, unsigned block_type, bm::gap_word_t *dst_arr) |
Read list of bit ids. More... | |
void | read_bic_arr (decoder_type &decoder, bm::word_t *blk) |
Read binary interpolated list into a bit-set. More... | |
void | read_bic_gap (decoder_type &decoder, bm::word_t *blk) |
Read binary interpolated gap blocks into a bitset. More... | |
void | read_bic_arr_inv (decoder_type &decoder, bm::word_t *blk) |
Read inverted binary interpolated list into a bit-set. More... | |
void | read_digest0_block (decoder_type &decoder, bm::word_t *blk) |
Read digest0-type bit-block. More... | |
![]() | |
static void | read_0runs_block (decoder_type &decoder, bm::word_t *blk) |
read bit-block encoded as runs More... | |
static const char * | err_msg () |
Serialization stream iterator.
Iterates blocks and control tokens of serialized bit-stream
Definition at line 475 of file bmserial.h.
typedef bm::id_t bm::serial_stream_iterator< DEC >::block_idx_type |
Definition at line 482 of file bmserial.h.
typedef deseriaizer_base<DEC>::decoder_type bm::serial_stream_iterator< DEC >::decoder_type |
Definition at line 478 of file bmserial.h.
typedef unsigned(serial_stream_iterator<DEC>::* bm::serial_stream_iterator< DEC >::get_bit_func_type) (bm::word_t *, bm::word_t *) |
member function pointer for bitset-bitset get operations
Definition at line 549 of file bmserial.h.
enum bm::serial_stream_iterator::iterator_state |
iterator is a state machine, this enum encodes its key value
Definition at line 519 of file bmserial.h.
bm::serial_stream_iterator< DEC >::serial_stream_iterator | ( | const unsigned char * | buf | ) |
Definition at line 2743 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::bit_func_table_, bm::serial_stream_iterator< DEC >::block_idx_arr_, BM_ASSERT, bm::BM_HM_64_BIT, bm::BM_HM_ID_LIST, bm::BM_HM_NO_BO, bm::BM_HM_NO_GAPL, bm::BM_HM_RESIZE, bm::serial_stream_iterator< DEC >::bv_size_, bm::serial_stream_iterator< DEC >::decoder_, bm::serial_stream_iterator< DEC >::e_blocks, bm::serial_stream_iterator< DEC >::e_list_ids, bm::gap_levels, bm::gap_max_bits, bm::serial_stream_iterator< DEC >::glevels_, bm::deseriaizer_base< DEC >::id_array_, bm::serial_stream_iterator< DEC >::id_cnt_, bm::serial_stream_iterator< DEC >::next(), bm::set_AND, bm::set_ASSIGN, bm::set_COUNT, bm::set_COUNT_A, bm::set_COUNT_AND, bm::set_COUNT_B, bm::set_COUNT_OR, bm::set_COUNT_SUB_AB, bm::set_COUNT_SUB_BA, bm::set_COUNT_XOR, bm::set_OR, bm::set_SUB, bm::set_XOR, and bm::serial_stream_iterator< DEC >::state_.
bm::serial_stream_iterator< DEC >::~serial_stream_iterator |
Definition at line 2835 of file bmserial.h.
|
inline |
Get current block index.
Definition at line 542 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::block_idx_.
|
inline |
serialized bitvector size
Definition at line 490 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::bv_size_.
|
inline |
Return current decoder size.
Definition at line 511 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::decoder_.
|
inline |
Get low level access to the decoder (use carefully)
Definition at line 514 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::decoder_.
unsigned bm::serial_stream_iterator< DEC >::get_arr_bit | ( | bm::word_t * | dst_block, |
bool | clear_target = true |
||
) |
Get array of bits out of the decoder into bit block (Converts inverted list into bits) Returns number of words (bits) being read.
Definition at line 4163 of file bmserial.h.
References bm::bit_block_set(), BM_ASSERT, bm::set_bit(), bm::set_block_arrbit, and bm::set_block_bit_1bit.
unsigned bm::serial_stream_iterator< DEC >::get_bit |
Definition at line 4201 of file bmserial.h.
References BM_ASSERT, and bm::set_block_bit_1bit.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block, | ||
set_operation | op | ||
) |
read bit block, using logical operation
Definition at line 4230 of file bmserial.h.
References BM_ASSERT.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_AND | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3200 of file bmserial.h.
References bm::bit_block_and(), bm::bit_block_set(), BM_ASSERT, IS_VALID_ADDR, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, and bm::set_block_size.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_ASSIGN | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3027 of file bmserial.h.
References bm::bit_block_copy(), bm::bit_block_set(), BM_ASSERT, IS_VALID_ADDR, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_gapbit, and bm::set_block_size.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3518 of file bmserial.h.
References bm::bit_block_count(), bm::bit_block_set(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_size, and bm::word_bitcount().
Referenced by bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_B().
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_A | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3601 of file bmserial.h.
References bm::bit_block_count(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, and bm::set_block_size.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_AND | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3683 of file bmserial.h.
References bm::bit_block_set(), bm::bit_operation_and_count(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_size, and bm::word_bitcount().
|
inline |
Definition at line 576 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::get_bit_block_COUNT().
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_OR | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3767 of file bmserial.h.
References bm::bit_block_set(), bm::bit_operation_or_count(), bm::bit_recomb(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_size, bm::bitblock_sum_adapter::sum(), and bm::word_bitcount().
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_AB | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3968 of file bmserial.h.
References bm::bit_block_set(), bm::bit_operation_sub_count(), bm::bit_recomb(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_size, bm::bitblock_sum_adapter::sum(), and bm::word_bitcount().
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_BA | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 4069 of file bmserial.h.
References bm::bit_block_set(), bm::bit_operation_sub_count(), bm::bit_recomb(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_size, bm::bitblock_sum_adapter::sum(), and bm::word_bitcount().
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_XOR | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3867 of file bmserial.h.
References bm::bit_block_set(), bm::bit_operation_xor_count(), bm::bit_recomb(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_size, bm::bitblock_sum_adapter::sum(), and bm::word_bitcount().
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_OR | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3126 of file bmserial.h.
References bm::bit_block_or(), BM_ASSERT, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, and bm::set_block_size.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_SUB | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3416 of file bmserial.h.
References bm::bit_block_set(), bm::bit_block_sub(), BM_ASSERT, IS_VALID_ADDR, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, and bm::set_block_size.
unsigned bm::serial_stream_iterator< DEC >::get_bit_block_XOR | ( | bm::word_t * | dst_block, |
bm::word_t * | tmp_block | ||
) |
Definition at line 3312 of file bmserial.h.
References bm::bit_block_set(), bm::bit_block_xor(), BM_ASSERT, IS_VALID_ADDR, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, and bm::set_block_size.
|
inline |
Get current block type.
Definition at line 588 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::block_type_.
void bm::serial_stream_iterator< DEC >::get_gap_block | ( | bm::gap_word_t * | dst_block | ) |
Read gap block data (with head)
Definition at line 4212 of file bmserial.h.
References BM_ASSERT, and bm::set_block_bit_1bit.
|
inline |
Get last id from the id list.
Definition at line 539 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::last_id_.
|
inline |
Number of ids in the inverted list (valid for e_list_ids)
Definition at line 536 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::id_cnt_.
void bm::serial_stream_iterator< DEC >::get_inv_arr | ( | bm::word_t * | block | ) |
Definition at line 3005 of file bmserial.h.
References bm::bit_block_set(), and bm::clear_bit().
|
inline |
Definition at line 534 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::state_.
|
inline |
Returns true if end of bit-stream reached.
Definition at line 493 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::end_of_stream_.
void bm::serial_stream_iterator< DEC >::next |
get next block
Definition at line 2843 of file bmserial.h.
References BM_ASSERT, bm::set_block_16one, bm::set_block_16zero, bm::set_block_1one, bm::set_block_1zero, bm::set_block_32one, bm::set_block_32zero, bm::set_block_8one, bm::set_block_8zero, bm::set_block_aone, bm::set_block_arr_bienc, bm::set_block_arr_bienc_inv, bm::set_block_arrbit, bm::set_block_arrbit_inv, bm::set_block_arrgap, bm::set_block_arrgap_bienc, bm::set_block_arrgap_bienc_inv, bm::set_block_arrgap_egamma, bm::set_block_arrgap_egamma_inv, bm::set_block_arrgap_inv, bm::set_block_azero, bm::set_block_bit, bm::set_block_bit_0runs, bm::set_block_bit_1bit, bm::set_block_bit_digest0, bm::set_block_bit_interval, bm::set_block_bitgap_bienc, bm::set_block_end, bm::set_block_gap, bm::set_block_gap_bienc, bm::set_block_gap_egamma, bm::set_block_gapbit, and bm::set_total_blocks.
Referenced by bm::serial_stream_iterator< DEC >::serial_stream_iterator().
serial_stream_iterator< DEC >::block_idx_type bm::serial_stream_iterator< DEC >::skip_mono_blocks |
|
inline |
Returns iterator internal state.
Definition at line 532 of file bmserial.h.
References bm::serial_stream_iterator< DEC >::state_.
|
protected |
Definition at line 595 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::serial_stream_iterator().
|
protected |
current block index
Definition at line 606 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::block_idx().
|
protected |
Definition at line 610 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::serial_stream_iterator().
|
protected |
current block type
Definition at line 605 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::get_block_type().
|
protected |
Definition at line 599 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::bv_size(), and bm::serial_stream_iterator< DEC >::serial_stream_iterator().
|
protected |
Definition at line 597 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::dec_size(), bm::serial_stream_iterator< DEC >::decoder(), and bm::serial_stream_iterator< DEC >::serial_stream_iterator().
|
protected |
Definition at line 598 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::is_eof().
|
protected |
Definition at line 609 of file bmserial.h.
|
protected |
GAP levels.
Definition at line 603 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::serial_stream_iterator().
|
protected |
Id counter for id list.
Definition at line 601 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::get_id_count(), and bm::serial_stream_iterator< DEC >::serial_stream_iterator().
|
protected |
Last id from the id list.
Definition at line 602 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::get_id().
|
protected |
number of 0 or 1 blocks
Definition at line 607 of file bmserial.h.
|
protected |
Definition at line 600 of file bmserial.h.
Referenced by bm::serial_stream_iterator< DEC >::get_state(), bm::serial_stream_iterator< DEC >::serial_stream_iterator(), and bm::serial_stream_iterator< DEC >::state().