NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
bm::deserializer< BV, DEC > Class Template Reference

Search Toolkit Book for bm::deserializer

Deserializer for bit-vector. More...

#include <util/bitset/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) More...
 
void set_range (size_type from, size_type to) noexcept
 set deserialization range [from, to] This is NOT exact, approximate range, content outside range is not guaranteed to be absent More...
 
void unset_range () noexcept
 Disable range deserialization. More...
 
void reset () noexcept
 reset range deserialization and reference vectors More...
 

Protected Types

typedef BV::blocks_manager_type blocks_manager_type
 
typedef bm::heap_vector< bm::gap_word_t, allocator_type, trueblock_arridx_type
 
typedef bm::heap_vector< bm::word_t, allocator_type, truesblock_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 *blk) noexcept
 
void xor_reset () noexcept
 
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. 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, unsigned block_type) noexcept
 Read binary interpolated list into a bit-set. More...
 
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. More...
 
void read_bic_gap (decoder_type &decoder, bm::word_t *blk) noexcept
 Read binary interpolated gap blocks into a bitset. More...
 
void read_bic_arr_inv (decoder_type &decoder, bm::word_t *blk) noexcept
 Read inverted binary interpolated list into a bit-set. More...
 
void read_digest0_block (decoder_type &decoder, bm::word_t *blk) noexcept
 Read digest0-type bit-block. More...
 
block_idx_type try_skip (decoder_type &decoder, block_idx_type nb, block_idx_type expect_nb) noexcept
 Try to skip if skip bookmark is available within reach. More...
 

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 More...
 
bm::word_txor_block_
 xor product More...
 
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 More...
 
unsigned * sb_id_array_
 ptr to super-block idx array (temp) More...
 
block_idx_type bookmark_idx_
 last bookmark block index More...
 
unsigned skip_offset_
 bookmark to skip 256 encoded blocks More...
 
const unsigned char * skip_pos_
 decoder skip position More...
 

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) noexcept
 read bit-block encoded as runs More...
 
static const char * err_msg () noexcept
 

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()

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

◆ ~deserializer()

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

Definition at line 3770 of file bmserial.h.

References BM_ASSERT.

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

Definition at line 4003 of file bmserial.h.

References arr, bm::gap_max_bits, i, len, and bm::set_sub_array_size.

◆ 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, len, and bm::set_bit().

◆ decode_bit_block()

template<class BV , class DEC >
void bm::deserializer< BV, DEC >::decode_bit_block ( unsigned char  btype,
decoder_type dec,
blocks_manager_type bman,
block_idx_type  nb,
bm::word_t blk 
)
protected

◆ 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, and bm::set_block_size.

◆ 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, and bm::set_block_size.

◆ 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 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, buf, cnt, bm::gap_levels, bm::gap_max_bits, bm::get_block_coord(), bm::id_max, 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, and bm::set_total_blocks.

Referenced by bm::deserialize(), bm::operation_deserializer< bvector_type >::deserialize(), CDataFrame< MAX_SIZE >::Deserialize(), bm::deserialize_range(), bm::operation_deserializer< BV >::deserialize_xor_range(), NULL_serial_search_test(), test_chr21(), and TestStrSparseVector().

◆ deserialize_gap()

template<class BV , class DEC >
void bm::deserializer< BV, DEC >::deserialize_gap ( unsigned char  btype,
decoder_type dec,
bvector_type bv,
blocks_manager_type bman,
block_idx_type  nb,
bm::word_t blk 
)
protected

◆ reset()

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

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 
)
inlinenoexcept

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(), and bm::operation_deserializer< BV >::deserialize_xor_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.

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

◆ unset_range()

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

Disable range deserialization.

See also
set_range()

Definition at line 619 of file bmserial.h.

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

◆ xor_decode()

template<class BV , class DEC >
void bm::deserializer< BV, DEC >::xor_decode ( blocks_manager_type bman)
protected

◆ xor_decode_chain()

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

◆ xor_reset()

template<class BV , class DEC >
void bm::deserializer< BV, DEC >::xor_reset
protectednoexcept

Definition at line 4738 of file bmserial.h.

Member Data 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 bm::deserializer< BV, DEC >::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 bm::deserializer< BV, DEC >::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 bm::deserializer< BV, DEC >::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 bm::deserializer< BV, bm::decoder >::set_range().

◆ 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 bm::deserializer< BV, bm::decoder >::set_range().

◆ is_range_set_

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

◆ 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.

◆ 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.

◆ 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 bm::deserializer< BV, DEC >::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 bm::operation_deserializer< bvector_type >::set_ref_vectors().

◆ 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 bm::deserializer< BV, DEC >::deserializer().

◆ temp_block_

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

Definition at line 671 of file bmserial.h.

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

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


The documentation for this class was generated from the following files:
Modified on Thu Jul 18 16:02:02 2024 by modify_doxy.py rev. 669887