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

BitMagic-C++

Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
bm::deserializer< BV, DEC > Class Template Reference
BitMagic Library » bvector<> container » bvector<> serialization

Deserializer for bit-vector. More...

`#include <bmserial.h>`

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

## 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_type > | parent_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) BMNOEXCEPT
| set deserialization range [from, to] This is NOT exact, approximate range, content outside range is not guaranteed to be absent More...
void | unset_range () BMNOEXCEPT
| Disable range deserialization. More...

## 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 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 (size_type x_ref_idx, bm::id64_t x_ref_d64, blocks_manager_type &bman, block_idx_type nb)
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)
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) BMNOEXCEPT
| Read binary interpolated list into a bit-set. More...
void | read_bic_gap (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| Read binary interpolated gap blocks into a bitset. More...
void | read_bic_arr_inv (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| Read inverted binary interpolated list into a bit-set. More...
void | read_digest0_block (decoder_type &decoder, bm::word_t *blk) BMNOEXCEPT
| Read digest0-type bit-block. More...
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. More...

## Protected Attributes
block_arridx_type | bit_idx_arr_
block_arridx_type | gap_temp_block_
bm::word_t * | temp_block_
allocator_pool_type | pool_
allocator_type | alloc_
const bv_ref_vector_type * | ref_vect_
| ref.vector for XOR compression More...
bm::word_t * | xor_block_
| xor product More...
bm::word_t * | or_block_
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_t * | id_array_
| ptr to idx array for temp decode use 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) BMNOEXCEPT
| read bit-block encoded as runs More...
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 489 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 577 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 494 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 576 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 496 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 543 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 499 of file bmserial.h.

## ◆ bvector_type

template<class BV , class DEC >

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

Definition at line 493 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 498 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 497 of file bmserial.h.

## ◆ size_type

template<class BV , class DEC >

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

Definition at line 495 of file bmserial.h.

## Constructor & Destructor Documentation

## ◆ deserializer()

template<class BV , class DEC >

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

Definition at line 3216 of file bmserial.h.

## ◆ ~deserializer()

template<class BV , class DEC >

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

Definition at line 3231 of file bmserial.h.

## Member Function Documentation

## ◆ 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 3495 of file bmserial.h.

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

Definition at line 3384 of file bmserial.h.

## ◆ 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 3448 of file bmserial.h.

## ◆ 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 3468 of file bmserial.h.

## ◆ 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 3531 of file bmserial.h.

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

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

Definition at line 3249 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 531 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 3240 of file bmserial.h.

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

## ◆ 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 540 of file bmserial.h.

## ◆ xor_decode()

template<class BV , class DEC >

void bm::deserializer< BV, DEC >::xor_decode | ( | size_type | x_ref_idx,
|  | bm::id64_t | x_ref_d64,
|  | blocks_manager_type & | bman,
|  | block_idx_type | nb
| ) |  |
| protected

Definition at line 3969 of file bmserial.h.

## Field Documentation

## ◆ alloc_

template<class BV , class DEC >

allocator_type bm::deserializer< BV, DEC >::alloc_
| protected

Definition at line 585 of file bmserial.h.

## ◆ bit_idx_arr_

template<class BV , class DEC >

block_arridx_type bm::deserializer< BV, DEC >::bit_idx_arr_
| protected

Definition at line 580 of file bmserial.h.

## ◆ gap_temp_block_

template<class BV , class DEC >

block_arridx_type bm::deserializer< BV, DEC >::gap_temp_block_
| protected

Definition at line 581 of file bmserial.h.

## ◆ idx_from_

template<class BV , class DEC >

size_type bm::deserializer< BV, DEC >::idx_from_
| protected

Definition at line 596 of file bmserial.h.

Referenced by bm::deserializer< bvector_type, bm::decoder >::set_range().

## ◆ idx_to_

template<class BV , class DEC >

size_type bm::deserializer< BV, DEC >::idx_to_
| protected

Definition at line 597 of file bmserial.h.

Referenced by bm::deserializer< bvector_type, bm::decoder >::set_range().

## ◆ is_range_set_

template<class BV , class DEC >

unsigned bm::deserializer< BV, DEC >::is_range_set_
| protected

Definition at line 595 of file bmserial.h.

Referenced by bm::deserializer< bvector_type, bm::decoder >::set_range(), and bm::deserializer< bvector_type, bm::decoder >::unset_range().

## ◆ or_block_

template<class BV , class DEC >

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

Definition at line 591 of file bmserial.h.

## ◆ pool_

template<class BV , class DEC >

allocator_pool_type bm::deserializer< BV, DEC >::pool_
| protected

Definition at line 584 of file bmserial.h.

## ◆ 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 589 of file bmserial.h.

## ◆ temp_block_

template<class BV , class DEC >

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

Definition at line 582 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 590 of file bmserial.h.

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

- bmserial.h