BitMagic-C++
bm::deserializer< BV, DEC > Class Template Reference

Deserializer for bit-vector. More...

#include <bmserial.h>

Inheritance diagram for bm::deserializer< BV, DEC >:
Collaboration diagram for bm::deserializer< BV, DEC >:

Public Types

typedef BV bvector_type
typedef bvector_type::allocator_type allocator_type
typedef BV::size_type size_type
typedef bvector_type::block_idx_type block_idx_type
typedef deseriaizer_base< DEC, block_idx_typeparent_type
typedef parent_type::decoder_type decoder_type
typedef bm::bv_ref_vector< BV > bv_ref_vector_type

Public Member Functions

 deserializer ()
 ~deserializer ()
size_t deserialize (bvector_type &bv, const unsigned char *buf, bm::word_t *temp_block=0)
void set_ref_vectors (const bv_ref_vector_type *ref_vect)
 Attach collection of reference vectors for XOR de-serialization (no transfer of ownership for the pointer).
void set_range (size_type from, size_type to) BMNOEXCEPT
 set deserialization range [from, to] This is NOT exact, approximate range, content outside range is not guaranteed to be absent
void unset_range () BMNOEXCEPT
 Disable range deserialization.
void reset () BMNOEXCEPT
 reset range deserialization and reference vectors

Protected Types

typedef BV::blocks_manager_type blocks_manager_type
typedef bm::heap_vector< bm::gap_word_t, allocator_type, true > block_arridx_type
typedef bm::heap_vector< bm::word_t, allocator_type, true > sblock_arridx_type
typedef allocator_type::allocator_pool_type allocator_pool_type
Protected Types inherited from bm::deseriaizer_base< DEC, BV::block_idx_type >
typedef DEC decoder_type
typedef BV::block_idx_type block_idx_type
typedef bm::bit_in< DEC > bit_in_type

Protected Member Functions

void xor_decode (blocks_manager_type &bman)
void xor_decode_chain (bm::word_t *BMRESTRICT blk) BMNOEXCEPT
void xor_reset () BMNOEXCEPT
void deserialize_gap (unsigned char btype, decoder_type &dec, bvector_type &bv, blocks_manager_type &bman, block_idx_type nb, bm::word_t *blk)
void decode_bit_block (unsigned char btype, decoder_type &dec, blocks_manager_type &bman, block_idx_type nb, bm::word_t *blk)
void decode_block_bit (decoder_type &dec, bvector_type &bv, block_idx_type nb, bm::word_t *blk)
void decode_block_bit_interval (decoder_type &dec, bvector_type &bv, block_idx_type nb, bm::word_t *blk)
void decode_arrbit (decoder_type &dec, bvector_type &bv, block_idx_type nb, bm::word_t *blk)
void decode_arr_sblock (unsigned char btype, decoder_type &dec, bvector_type &bv)
Protected Member Functions inherited from bm::deseriaizer_base< DEC, BV::block_idx_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.
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.

Protected Attributes

block_arridx_type bit_idx_arr_
sblock_arridx_type sb_bit_idx_arr_
block_arridx_type gap_temp_block_
bm::word_ttemp_block_
allocator_pool_type pool_
allocator_type alloc_
const bv_ref_vector_typeref_vect_
 ref.vector for XOR compression
bm::word_txor_block_
 xor product
bm::word_tor_block_
size_type or_block_idx_
size_type x_ref_idx_
bm::id64_t x_ref_d64_
block_idx_type x_nb_
unsigned xor_chain_size_
bm::match_pair xor_chain_ [64]
unsigned is_range_set_
size_type idx_from_
size_type idx_to_
Protected Attributes inherited from bm::deseriaizer_base< DEC, BV::block_idx_type >
bm::gap_word_tid_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

Additional Inherited Members

Static Protected Member Functions inherited from bm::deseriaizer_base< DEC, BV::block_idx_type >
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

Detailed Description

template<class BV, class DEC>
class bm::deserializer< BV, DEC >

Deserializer for bit-vector.

Definition at line 568 of file bmserial.h.

Member Typedef Documentation

◆ allocator_pool_type

template<class BV, class DEC>
typedef allocator_type::allocator_pool_type bm::deserializer< BV, DEC >::allocator_pool_type
protected

Definition at line 665 of file bmserial.h.

◆ allocator_type

template<class BV, class DEC>
typedef bvector_type::allocator_type bm::deserializer< BV, DEC >::allocator_type

Definition at line 573 of file bmserial.h.

◆ block_arridx_type

template<class BV, class DEC>
typedef bm::heap_vector<bm::gap_word_t, allocator_type, true> bm::deserializer< BV, DEC >::block_arridx_type
protected

Definition at line 663 of file bmserial.h.

◆ block_idx_type

template<class BV, class DEC>
typedef bvector_type::block_idx_type bm::deserializer< BV, DEC >::block_idx_type

Definition at line 575 of file bmserial.h.

◆ blocks_manager_type

template<class BV, class DEC>
typedef BV::blocks_manager_type bm::deserializer< BV, DEC >::blocks_manager_type
protected

Definition at line 627 of file bmserial.h.

◆ bv_ref_vector_type

template<class BV, class DEC>
typedef bm::bv_ref_vector<BV> bm::deserializer< BV, DEC >::bv_ref_vector_type

Definition at line 578 of file bmserial.h.

◆ bvector_type

template<class BV, class DEC>
typedef BV bm::deserializer< BV, DEC >::bvector_type

Definition at line 572 of file bmserial.h.

◆ decoder_type

template<class BV, class DEC>
typedef parent_type::decoder_type bm::deserializer< BV, DEC >::decoder_type

Definition at line 577 of file bmserial.h.

◆ parent_type

template<class BV, class DEC>
typedef deseriaizer_base<DEC, block_idx_type> bm::deserializer< BV, DEC >::parent_type

Definition at line 576 of file bmserial.h.

◆ sblock_arridx_type

template<class BV, class DEC>
typedef bm::heap_vector<bm::word_t, allocator_type, true> bm::deserializer< BV, DEC >::sblock_arridx_type
protected

Definition at line 664 of file bmserial.h.

◆ size_type

template<class BV, class DEC>
typedef BV::size_type bm::deserializer< BV, DEC >::size_type

Definition at line 574 of file bmserial.h.

Constructor & Destructor Documentation

◆ deserializer()

◆ ~deserializer()

template<class BV, class DEC>
bm::deserializer< BV, DEC >::~deserializer ( )

Definition at line 3770 of file bmserial.h.

References alloc_, BM_ASSERT, or_block_, temp_block_, and xor_block_.

Member Function Documentation

◆ decode_arr_sblock()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::decode_arr_sblock ( unsigned char btype,
decoder_type & dec,
bvector_type & bv )
protected

◆ decode_arrbit()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::decode_arrbit ( decoder_type & dec,
bvector_type & bv,
block_idx_type nb,
bm::word_t * blk )
protected

Definition at line 4084 of file bmserial.h.

References bm::bit_block_set(), BM_IS_GAP, IS_FULL_BLOCK, and bm::set_bit().

Referenced by deserialize().

◆ decode_bit_block()

◆ decode_block_bit()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::decode_block_bit ( decoder_type & dec,
bvector_type & bv,
block_idx_type nb,
bm::word_t * blk )
protected

Definition at line 4037 of file bmserial.h.

References bm::BM_OR, bm::set_block_size, and temp_block_.

Referenced by deserialize().

◆ decode_block_bit_interval()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::decode_block_bit_interval ( decoder_type & dec,
bvector_type & bv,
block_idx_type nb,
bm::word_t * blk )
protected

Definition at line 4057 of file bmserial.h.

References bm::bit_block_set(), bm::BM_OR, bm::set_block_size, and temp_block_.

Referenced by deserialize().

◆ deserialize()

template<class BV, class DEC>
size_t bm::deserializer< BV, DEC >::deserialize ( bvector_type & bv,
const unsigned char * buf,
bm::word_t * temp_block = 0 )

Deserialize bit-vector (equivalent to logical OR)

Parameters
bv- target bit-vector
buf- BLOB memory pointer
temp_block- temporary buffer [block size] (not used)
Returns
number of consumed bytes

Definition at line 4122 of file bmserial.h.

References alloc_, bm::bits_in_block, BM_ASSERT, bm::BM_GAP, bm::BM_HM_64_BIT, bm::BM_HM_HXOR, bm::BM_HM_ID_LIST, bm::BM_HM_NO_BO, bm::BM_HM_NO_GAPL, bm::BM_HM_RESIZE, BM_IS_GAP, bm::BM_OR, bm::deseriaizer_base< DEC, BV::block_idx_type >::bookmark_idx_, decode_arr_sblock(), decode_arrbit(), decode_bit_block(), decode_block_bit(), decode_block_bit_interval(), deserialize_gap(), bm::deseriaizer_base< DEC, BV::block_idx_type >::err_msg(), bm::gap_levels, bm::gap_max_bits, bm::get_block_coord(), bm::id_max, idx_from_, idx_to_, is_range_set_, or_block_, or_block_idx_, pool_, bm::deseriaizer_base< DEC, BV::block_idx_type >::read_0runs_block(), ref_vect_, 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_64one, bm::set_block_64zero, bm::set_block_8one, bm::set_block_8zero, bm::set_block_aone, bm::set_block_arr_bienc, bm::set_block_arr_bienc_8bh, 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_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_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_bienc_v2, bm::set_block_gap_egamma, bm::set_block_gapbit, bm::set_block_ref_eq, bm::set_block_shift, bm::set_block_xor_chain, bm::set_block_xor_gap_ref16, bm::set_block_xor_gap_ref32, bm::set_block_xor_gap_ref8, bm::set_block_xor_ref16, bm::set_block_xor_ref16_um, bm::set_block_xor_ref32, bm::set_block_xor_ref32_um, bm::set_block_xor_ref8, bm::set_block_xor_ref8_um, bm::set_nb_bookmark16, bm::set_nb_bookmark24, bm::set_nb_bookmark32, 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::set_sblock_bienc, bm::set_sub_array_size, bm::set_total_blocks, bm::deseriaizer_base< DEC, BV::block_idx_type >::skip_offset_, bm::deseriaizer_base< DEC, BV::block_idx_type >::skip_pos_, temp_block_, bm::deseriaizer_base< DEC, BV::block_idx_type >::try_skip(), x_nb_, x_ref_d64_, x_ref_idx_, xor_block_, xor_chain_, xor_chain_size_, xor_decode(), and xor_reset().

Referenced by bm::deserialize(), and bm::deserialize_range().

◆ deserialize_gap()

◆ reset()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::reset ( )
inline

reset range deserialization and reference vectors

See also
set_range()

Definition at line 624 of file bmserial.h.

◆ set_range()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::set_range ( size_type from,
size_type to )
inline

set deserialization range [from, to] This is NOT exact, approximate range, content outside range is not guaranteed to be absent

See also
unset_range()

Definition at line 610 of file bmserial.h.

Referenced by bm::deserialize_range().

◆ set_ref_vectors()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::set_ref_vectors ( const bv_ref_vector_type * ref_vect)

Attach collection of reference vectors for XOR de-serialization (no transfer of ownership for the pointer).

Definition at line 3779 of file bmserial.h.

References alloc_, ref_vect_, and xor_block_.

Referenced by bm::deserialize(), bm::deserialize_range(), and bm::deserializer< BV, bm::decoder_little_endian >::reset().

◆ unset_range()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::unset_range ( )
inline

Disable range deserialization.

See also
set_range()

Definition at line 619 of file bmserial.h.

Referenced by bm::deserializer< BV, bm::decoder_little_endian >::reset().

◆ xor_decode()

◆ xor_decode_chain()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::xor_decode_chain ( bm::word_t *BMRESTRICT blk)
protected

◆ xor_reset()

template<class BV, class DEC>
void bm::deserializer< BV, DEC >::xor_reset ( )
protected

Definition at line 4738 of file bmserial.h.

References BMNOEXCEPT, x_nb_, x_ref_d64_, x_ref_idx_, and xor_chain_size_.

Referenced by deserialize(), and xor_decode().

Field Documentation

◆ alloc_

template<class BV, class DEC>
allocator_type bm::deserializer< BV, DEC >::alloc_
protected

Definition at line 674 of file bmserial.h.

Referenced by deserialize(), deserializer(), set_ref_vectors(), xor_decode(), and ~deserializer().

◆ bit_idx_arr_

template<class BV, class DEC>
block_arridx_type bm::deserializer< BV, DEC >::bit_idx_arr_
protected

Definition at line 668 of file bmserial.h.

Referenced by deserializer().

◆ gap_temp_block_

template<class BV, class DEC>
block_arridx_type bm::deserializer< BV, DEC >::gap_temp_block_
protected

Definition at line 670 of file bmserial.h.

Referenced by deserialize_gap(), and deserializer().

◆ idx_from_

template<class BV, class DEC>
size_type bm::deserializer< BV, DEC >::idx_from_
protected

Definition at line 694 of file bmserial.h.

Referenced by decode_arr_sblock(), deserialize(), and xor_decode().

◆ idx_to_

template<class BV, class DEC>
size_type bm::deserializer< BV, DEC >::idx_to_
protected

Definition at line 695 of file bmserial.h.

Referenced by decode_arr_sblock(), deserialize(), and xor_decode().

◆ is_range_set_

template<class BV, class DEC>
unsigned bm::deserializer< BV, DEC >::is_range_set_
protected

Definition at line 693 of file bmserial.h.

Referenced by decode_arr_sblock(), deserialize(), deserializer(), and xor_decode().

◆ or_block_

template<class BV, class DEC>
bm::word_t* bm::deserializer< BV, DEC >::or_block_
protected

Definition at line 680 of file bmserial.h.

Referenced by deserialize(), deserializer(), xor_decode(), and ~deserializer().

◆ or_block_idx_

template<class BV, class DEC>
size_type bm::deserializer< BV, DEC >::or_block_idx_
protected

Definition at line 681 of file bmserial.h.

Referenced by deserialize(), deserializer(), and xor_decode().

◆ pool_

template<class BV, class DEC>
allocator_pool_type bm::deserializer< BV, DEC >::pool_
protected

Definition at line 673 of file bmserial.h.

Referenced by deserialize(), and deserializer().

◆ ref_vect_

template<class BV, class DEC>
const bv_ref_vector_type* bm::deserializer< BV, DEC >::ref_vect_
protected

ref.vector for XOR compression

Definition at line 678 of file bmserial.h.

Referenced by deserialize(), deserializer(), set_ref_vectors(), xor_decode(), and xor_decode_chain().

◆ sb_bit_idx_arr_

template<class BV, class DEC>
sblock_arridx_type bm::deserializer< BV, DEC >::sb_bit_idx_arr_
protected

Definition at line 669 of file bmserial.h.

Referenced by deserializer().

◆ temp_block_

template<class BV, class DEC>
bm::word_t* bm::deserializer< BV, DEC >::temp_block_
protected

◆ x_nb_

template<class BV, class DEC>
block_idx_type bm::deserializer< BV, DEC >::x_nb_
protected

Definition at line 687 of file bmserial.h.

Referenced by deserialize(), xor_decode(), xor_decode_chain(), and xor_reset().

◆ x_ref_d64_

template<class BV, class DEC>
bm::id64_t bm::deserializer< BV, DEC >::x_ref_d64_
protected

Definition at line 686 of file bmserial.h.

Referenced by deserialize(), deserialize_gap(), xor_decode(), and xor_reset().

◆ x_ref_idx_

template<class BV, class DEC>
size_type bm::deserializer< BV, DEC >::x_ref_idx_
protected

Definition at line 685 of file bmserial.h.

Referenced by deserialize(), xor_decode(), and xor_reset().

◆ xor_block_

template<class BV, class DEC>
bm::word_t* bm::deserializer< BV, DEC >::xor_block_
protected

xor product

Definition at line 679 of file bmserial.h.

Referenced by deserialize(), deserializer(), set_ref_vectors(), xor_decode(), xor_decode_chain(), and ~deserializer().

◆ xor_chain_

template<class BV, class DEC>
bm::match_pair bm::deserializer< BV, DEC >::xor_chain_[64]
protected

Definition at line 689 of file bmserial.h.

Referenced by deserialize(), and xor_decode_chain().

◆ xor_chain_size_

template<class BV, class DEC>
unsigned bm::deserializer< BV, DEC >::xor_chain_size_
protected

Definition at line 688 of file bmserial.h.

Referenced by deserialize(), xor_decode(), xor_decode_chain(), and xor_reset().


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