bm::deseriaizer_base< DEC, BLOCK_IDX > Class Template Reference
BitMagic Library » bvector<> container » bvector<> serialization

Base deserialization class. More...

`#include <bmserial.h>`

Inheritance diagram for bm::deseriaizer_base< DEC, BLOCK_IDX >:
[legend]

## Protected Types

typedef DEC | decoder_type
typedef BLOCK_IDX | block_idx_type
typedef bm::bit_in< DEC > | bit_in_type

## Protected Member Functions

| 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.
unsigned | read_id_list (decoder_type &decoder, unsigned block_type, bm::gap_word_t *dst_arr)
| Read list of bit ids.
void | read_bic_arr (decoder_type &decoder, bm::word_t *blk, unsigned block_type) BMNOEXCEPT
| Read binary interpolated list into a bit-set.
unsigned | read_bic_sb_arr (decoder_type &decoder, unsigned block_type, unsigned *dst_arr, unsigned *sb_idx)
| Read list of bit ids for super-blocks.
void | read_bic_gap (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| Read binary interpolated gap blocks into a bitset.
void | read_bic_arr_inv (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| Read inverted binary interpolated list into a bit-set.
void | read_digest0_block (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| Read digest0-type bit-block.
block_idx_type | try_skip (decoder_type &decoder, block_idx_type nb, block_idx_type expect_nb) BMNOEXCEPT
| Try to skip if skip bookmark is available within reach.

## Static Protected Member Functions

static void | read_0runs_block (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| read bit-block encoded as runs
static const char * | err_msg () BMNOEXCEPT

## Protected Attributes

bm::gap_word_t * | id_array_
| ptr to idx array for temp decode use
unsigned * | sb_id_array_
| ptr to super-block idx array (temp)
block_idx_type | bookmark_idx_
| last bookmark block index
unsigned | skip_offset_
| bookmark to skip 256 encoded blocks
const unsigned char * | skip_pos_
| decoder skip position

## Detailed Description

template<typename DEC, typename BLOCK_IDX>
class bm::deseriaizer_base< DEC, BLOCK_IDX >

Base deserialization class.

Definition at line 493 of file bmserial.h.

## Member Typedef Documentation

## bit_in_type

template<typename DEC, typename BLOCK_IDX>

typedef bm::bit_in<DEC> bm::deseriaizer_base< DEC, BLOCK_IDX >::bit_in_type

protected

Definition at line 498 of file bmserial.h.

## block_idx_type

template<typename DEC, typename BLOCK_IDX>

typedef BLOCK_IDX bm::deseriaizer_base< DEC, BLOCK_IDX >::block_idx_type

protected

Definition at line 497 of file bmserial.h.

## decoder_type

template<typename DEC, typename BLOCK_IDX>

typedef DEC bm::deseriaizer_base< DEC, BLOCK_IDX >::decoder_type

protected

Definition at line 496 of file bmserial.h.

## Constructor & Destructor Documentation

## deseriaizer_base()

template<typename DEC, typename BLOCK_IDX>

bm::deseriaizer_base< DEC, BLOCK_IDX >::deseriaizer_base | ( |  | ) |

inline protected

Definition at line 501 of file bmserial.h.

## Member Function Documentation

## err_msg()

template<typename DEC, typename BLOCK_IDX>

const char * bm::deseriaizer_base< DEC, BLOCK_IDX >::err_msg | ( |  | ) |

inline static protected

Definition at line 545 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_SUB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_XOR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::next(), read_bic_sb_arr(), read_gap_block(), and read_id_list().

## read_0runs_block()

template<typename DEC, typename BLOCK_IDX>

void bm::deseriaizer_base< DEC, BLOCK_IDX >::read_0runs_block | ( | decoder_type & | decoder,
|  | bm::word_t * | blk )

static protected

read bit-block encoded as runs

Definition at line 3518 of file bmserial.h.

References bm::bit_block_set(), BM_ASSERT, BMNOEXCEPT, and bm::set_block_size.

## read_bic_arr()

template<typename DEC, typename BLOCK_IDX>

void bm::deseriaizer_base< DEC, BLOCK_IDX >::read_bic_arr | ( | decoder_type & | decoder,
|  | bm::word_t * | blk,
|  | unsigned | block_type )

protected

Read binary interpolated list into a bit-set.

Definition at line 3337 of file bmserial.h.

References bm::bit_in< TDecoder >::bic_decode_u16_bitset(), bm::bit_in< TDecoder >::bic_decode_u16_dry(), BM_ASSERT, BM_IS_GAP, BMNOEXCEPT, IS_VALID_ADDR, bm::set_bit(), bm::set_block_arr_bienc, and bm::set_block_arr_bienc_8bh.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_SUB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_XOR(), and read_bic_arr_inv().

## read_bic_arr_inv()

template<typename DEC, typename BLOCK_IDX>

void bm::deseriaizer_base< DEC, BLOCK_IDX >::read_bic_arr_inv | ( | decoder_type & | decoder,
|  | bm::word_t * | blk )

protected

Read inverted binary interpolated list into a bit-set.

Definition at line 3445 of file bmserial.h.

References bm::bit_block_set(), bm::bit_invert(), BMNOEXCEPT, read_bic_arr(), and bm::set_block_arr_bienc.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_SUB(), and bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_XOR().

## read_bic_gap()

template<typename DEC, typename BLOCK_IDX>

void bm::deseriaizer_base< DEC, BLOCK_IDX >::read_bic_gap | ( | decoder_type & | decoder,
|  | bm::word_t * | blk )

protected

Read binary interpolated gap blocks into a bitset.

Definition at line 3455 of file bmserial.h.

References bm::bit_in< TDecoder >::bic_decode_u16(), BM_ASSERT, BM_IS_GAP, BMNOEXCEPT, bm::gap_add_to_bitset(), id_array_, and IS_VALID_ADDR.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_SUB(), and bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_XOR().

## read_bic_sb_arr()

template<typename DEC, typename BLOCK_IDX>

unsigned bm::deseriaizer_base< DEC, BLOCK_IDX >::read_bic_sb_arr | ( | decoder_type & | decoder,
|  | unsigned | block_type,
|  | unsigned * | dst_arr,
|  | unsigned * | sb_idx )

protected

Read list of bit ids for super-blocks.

Returns
  number of ids

Definition at line 3375 of file bmserial.h.

References bm::bit_in< TDecoder >::bic_decode_u32_cm(), BM_ASSERT, err_msg(), bm::sblock_flag_len16, bm::sblock_flag_max16, bm::sblock_flag_max24, bm::sblock_flag_min16, bm::sblock_flag_min24, bm::sblock_flag_sb16, bm::sblock_flag_sb32, bm::set_sblock_bienc, and bm::set_sub_total_bits.

## read_digest0_block()

template<typename DEC, typename BLOCK_IDX>

void bm::deseriaizer_base< DEC, BLOCK_IDX >::read_digest0_block | ( | decoder_type & | decoder,
|  | bm::word_t * | blk )

protected

Read digest0-type bit-block.

Definition at line 3478 of file bmserial.h.

References bm::bmi_blsi_u64(), bm::bmi_bslr_u64(), BMNOEXCEPT, IS_VALID_ADDR, bm::set_block_digest_wave_size, and bm::word_bitcount64().

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_OR(), bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_SUB(), and bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_bit_block_XOR().

## read_gap_block()

template<typename DEC, typename BLOCK_IDX>

void bm::deseriaizer_base< DEC, BLOCK_IDX >::read_gap_block | ( | decoder_type & | decoder,
|  | unsigned | block_type,
|  | bm::gap_word_t * | dst_block,
|  | bm::gap_word_t & | gap_head )

protected

Read GAP block from the stream.

Definition at line 3549 of file bmserial.h.

References bm::bit_in< TDecoder >::bic_decode_u16(), BM_ASSERT, err_msg(), bm::bit_in< TDecoder >::gamma(), bm::gap_add_value(), bm::gap_invert(), bm::gap_length(), bm::gap_max_bits, bm::gap_set_all(), bm::gap_set_array(), bm::decoder::get_16(), bm::decoder_base::get_8(), id_array_, read_id_list(), bm::set_block_arrgap, bm::set_block_arrgap_bienc, bm::set_block_arrgap_bienc_inv, bm::set_block_arrgap_bienc_inv_v2, bm::set_block_arrgap_bienc_v2, bm::set_block_arrgap_egamma, bm::set_block_arrgap_egamma_inv, bm::set_block_arrgap_inv, bm::set_block_bit_1bit, bm::set_block_gap, bm::set_block_gap_bienc, bm::set_block_gap_bienc_v2, and bm::set_block_gap_egamma.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::get_gap_block().

## read_id_list()

template<typename DEC, typename BLOCK_IDX>

unsigned bm::deseriaizer_base< DEC, BLOCK_IDX >::read_id_list | ( | decoder_type & | decoder,
|  | unsigned | block_type,
|  | bm::gap_word_t * | dst_arr )

protected

Read list of bit ids.

Returns
  number of ids

Definition at line 3252 of file bmserial.h.

References bm::bit_in< TDecoder >::bic_decode_u16(), BM_ASSERT, err_msg(), bm::bit_in< TDecoder >::gamma(), bm::decoder::get_16(), bm::decoder_base::get_8(), bm::set_block_arrgap, bm::set_block_arrgap_bienc, bm::set_block_arrgap_bienc_inv, bm::set_block_arrgap_bienc_inv_v2, bm::set_block_arrgap_bienc_v2, bm::set_block_arrgap_egamma, bm::set_block_arrgap_egamma_inv, bm::set_block_arrgap_inv, and bm::set_block_bit_1bit.

Referenced by read_gap_block().

## try_skip()

template<typename DEC, typename BLOCK_IDX>

deseriaizer_base< DEC, BLOCK_IDX >::block_idx_type bm::deseriaizer_base< DEC, BLOCK_IDX >::try_skip | ( | decoder_type & | decoder,
|  | block_idx_type | nb,
|  | block_idx_type | expect_nb )

protected

Try to skip if skip bookmark is available within reach.

Returns
  new block idx if skip went well

Definition at line 3676 of file bmserial.h.

References BM_ASSERT, BMNOEXCEPT, bm::decoder::get_16(), bm::decoder::get_24(), bm::decoder::get_32(), bm::decoder::get_48(), bm::decoder::get_64(), bm::decoder_base::get_8(), bm::decoder_base::get_pos(), bm::set_nb_sync_mark16, bm::set_nb_sync_mark24, bm::set_nb_sync_mark32, bm::set_nb_sync_mark48, bm::set_nb_sync_mark64, bm::set_nb_sync_mark8, bm::decoder_base::set_pos(), skip_offset_, and skip_pos_.

Referenced by bm::serial_stream_iterator< bm::decoder, block_idx_type >::try_skip().

## Field Documentation

## bookmark_idx_

template<typename DEC, typename BLOCK_IDX>

block_idx_type bm::deseriaizer_base< DEC, BLOCK_IDX >::bookmark_idx_

protected

last bookmark block index

Definition at line 558 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::next().

## id_array_

template<typename DEC, typename BLOCK_IDX>

bm::gap_word_t* bm::deseriaizer_base< DEC, BLOCK_IDX >::id_array_

protected

ptr to idx array for temp decode use

Definition at line 555 of file bmserial.h.

Referenced by read_bic_gap(), read_gap_block(), and bm::serial_stream_iterator< DEC, BLOCK_IDX >::serial_stream_iterator().

## sb_id_array_

template<typename DEC, typename BLOCK_IDX>

unsigned* bm::deseriaizer_base< DEC, BLOCK_IDX >::sb_id_array_

protected

ptr to super-block idx array (temp)

Definition at line 556 of file bmserial.h.

## skip_offset_

template<typename DEC, typename BLOCK_IDX>

unsigned bm::deseriaizer_base< DEC, BLOCK_IDX >::skip_offset_

protected

bookmark to skip 256 encoded blocks

Definition at line 559 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::next(), and try_skip().

## skip_pos_

template<typename DEC, typename BLOCK_IDX>

const unsigned char* bm::deseriaizer_base< DEC, BLOCK_IDX >::skip_pos_

protected

decoder skip position

Definition at line 560 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC, BLOCK_IDX >::next(), and try_skip().

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

- bmserial.h