NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
bm::sparse_vector_deserializer< SV > Class Template Reference

Search Toolkit Book for bm::sparse_vector_deserializer

sparse vector de-serializer More...

#include <util/bitset/bmsparsevec_serial.h>

+ Inheritance diagram for bm::sparse_vector_deserializer< SV >:
+ Collaboration diagram for bm::sparse_vector_deserializer< SV >:

Public Types

typedef SV::bvector_type bvector_type
 
typedef const bvector_typebvector_type_const_ptr
 
typedef bvector_typebvector_type_ptr
 
typedef SV::value_type value_type
 
typedef SV::size_type size_type
 
typedef bvector_type::allocator_type::allocator_pool_type allocator_pool_type
 
typedef bm::serializer< bvector_type >::bv_ref_vector_type bv_ref_vector_type
 

Public Member Functions

 sparse_vector_deserializer ()
 
 ~sparse_vector_deserializer ()
 
void set_finalization (bm::finalization is_final)
 Set deserialization finalization to force deserialized vectors into READONLY (or READWRITE) mode. More...
 
void set_xor_ref (bv_ref_vector_type *bv_ref_ptr)
 Set external XOR reference vectors (data frame referenece vectors) More...
 
void deserialize (SV &sv, const unsigned char *buf, bool clear_sv=true)
 
void deserialize_range (SV &sv, const unsigned char *buf, size_type from, size_type to, bool clear_sv=true)
 
void deserialize (SV &sv, const unsigned char *buf, size_type from, size_type to)
 
void deserialize (SV &sv, const unsigned char *buf, const bvector_type &mask_bv)
 
void deserialize_structure (SV &sv, const unsigned char *buf)
 

Protected Types

typedef bvector_type::allocator_type alloc_type
 

Protected Member Functions

unsigned load_header (bm::decoder &dec, SV &sv, unsigned char &matr_s_ser)
 Deserialize header/version and other common info. More...
 
void deserialize_sv (SV &sv, const unsigned char *buf, const bvector_type *mask_bv, bool clear_sv)
 
void deserialize_planes (SV &sv, unsigned planes, const unsigned char *buf, const bvector_type *mask_bv=0)
 deserialize bit-vector planes More...
 
void load_planes_off_table (const unsigned char *buf, bm::decoder &dec, unsigned planes)
 load offset table More...
 
int load_null_plane (SV &sv, int planes, const unsigned char *buf, const bvector_type *mask_bv)
 load NULL bit-plane (returns new planes count) More...
 
void load_remap (SV &sv, const unsigned char *remap_buf_ptr)
 load string remap dict More...
 
void setup_xor_compression ()
 setup deserializers More...
 
void clear_xor_compression ()
 unset XOR compression vectors More...
 

Static Protected Member Functions

static void raise_invalid_header ()
 throw error on incorrect deserialization More...
 
static void raise_invalid_64bit ()
 throw error on incorrect deserialization More...
 
static void raise_invalid_bitdepth ()
 throw error on incorrect deserialization More...
 
static void raise_invalid_format ()
 throw error on incorrect deserialization More...
 
static void raise_missing_remap_matrix ()
 throw error on incorrect deserialization More...
 

Protected Attributes

bm::finalization is_final_ = bm::finalization::UNDEFINED
 
const unsigned char * remap_buf_ptr_ = 0
 
alloc_type alloc_
 
bm::word_ttemp_block_ = 0
 
allocator_pool_type pool_
 
bvector_type plane_digest_bv_
 
bm::id64_t sv_size_
 
bm::id64_t digest_offset_
 
bm::deserializer< bvector_type, bm::decoderdeserial_
 
bm::operation_deserializer< bvector_typeop_deserial_
 
bm::rank_compressor< bvector_typersc_compressor_
 
bvector_type not_null_mask_bv_
 
bvector_type rsc_mask_bv_
 
bm::heap_vector< size_t, alloc_type, trueoff_vect_
 
bm::heap_vector< unsigned, alloc_type, trueoff32_vect_
 
rlen_vector_type remap_rlen_vect_
 
bv_ref_vector_type bv_ref_
 reference vector More...
 
bv_ref_vector_typebv_ref_ptr_ = 0
 external ref bit-vect More...
 
bool idx_range_set_ = false
 
size_type idx_range_from_
 
size_type idx_range_to_
 

Private Types

typedef bm::heap_vector< unsigned, alloc_type, truerlen_vector_type
 

Private Member Functions

 sparse_vector_deserializer (const sparse_vector_deserializer &)=delete
 
sparse_vector_deserializeroperator= (const sparse_vector_deserializer &)=delete
 

Detailed Description

template<typename SV>
class bm::sparse_vector_deserializer< SV >

sparse vector de-serializer

Definition at line 326 of file bmsparsevec_serial.h.

Member Typedef Documentation

◆ alloc_type

template<typename SV >
typedef bvector_type::allocator_type bm::sparse_vector_deserializer< SV >::alloc_type
protected

Definition at line 427 of file bmsparsevec_serial.h.

◆ allocator_pool_type

template<typename SV >
typedef bvector_type::allocator_type::allocator_pool_type bm::sparse_vector_deserializer< SV >::allocator_pool_type

Definition at line 334 of file bmsparsevec_serial.h.

◆ bv_ref_vector_type

Definition at line 335 of file bmsparsevec_serial.h.

◆ bvector_type

template<typename SV >
typedef SV::bvector_type bm::sparse_vector_deserializer< SV >::bvector_type

Definition at line 329 of file bmsparsevec_serial.h.

◆ bvector_type_const_ptr

Definition at line 330 of file bmsparsevec_serial.h.

◆ bvector_type_ptr

template<typename SV >
typedef bvector_type* bm::sparse_vector_deserializer< SV >::bvector_type_ptr

Definition at line 331 of file bmsparsevec_serial.h.

◆ rlen_vector_type

template<typename SV >
typedef bm::heap_vector<unsigned, alloc_type, true> bm::sparse_vector_deserializer< SV >::rlen_vector_type
private

Definition at line 478 of file bmsparsevec_serial.h.

◆ size_type

template<typename SV >
typedef SV::size_type bm::sparse_vector_deserializer< SV >::size_type

Definition at line 333 of file bmsparsevec_serial.h.

◆ value_type

template<typename SV >
typedef SV::value_type bm::sparse_vector_deserializer< SV >::value_type

Definition at line 332 of file bmsparsevec_serial.h.

Constructor & Destructor Documentation

◆ sparse_vector_deserializer() [1/2]

Definition at line 1156 of file bmsparsevec_serial.h.

◆ ~sparse_vector_deserializer()

Definition at line 1166 of file bmsparsevec_serial.h.

◆ sparse_vector_deserializer() [2/2]

template<typename SV >
bm::sparse_vector_deserializer< SV >::sparse_vector_deserializer ( const sparse_vector_deserializer< SV > &  )
privatedelete

Member Function Documentation

◆ clear_xor_compression()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::clear_xor_compression
protected

unset XOR compression vectors

Definition at line 1195 of file bmsparsevec_serial.h.

◆ deserialize() [1/3]

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize ( SV &  sv,
const unsigned char *  buf,
bool  clear_sv = true 
)

◆ deserialize() [2/3]

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize ( SV &  sv,
const unsigned char *  buf,
const bvector_type mask_bv 
)
inline

Deserialize sparse vector using address mask vector Address mask defines (by set bits) which vector elements to be extracted from the compressed BLOB

Parameters
sv- [out] target sparse vector to populate
buf- source memory pointer
mask_bv- AND mask bit-vector (address gather vector)

Definition at line 409 of file bmsparsevec_serial.h.

◆ deserialize() [3/3]

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize ( SV &  sv,
const unsigned char *  buf,
size_type  from,
size_type  to 
)
inline

Better use deserialize_range()

See also
deserialize_range

Definition at line 392 of file bmsparsevec_serial.h.

◆ deserialize_planes()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize_planes ( SV &  sv,
unsigned  planes,
const unsigned char *  buf,
const bvector_type mask_bv = 0 
)
protected

deserialize bit-vector planes

Definition at line 1472 of file bmsparsevec_serial.h.

References BM_ASSERT, buf, i, offset, and bm::READONLY.

◆ deserialize_range()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize_range ( SV &  sv,
const unsigned char *  buf,
size_type  from,
size_type  to,
bool  clear_sv = true 
)

Deserialize sparse vector for the range [from, to]

Parameters
sv- [out] target sparse vector to populate
buf- input BLOB source memory pointer
from- start vector index for deserialization range
to- end vector index for deserialization range
clear_sv- if true clears the target vector

Definition at line 1261 of file bmsparsevec_serial.h.

References buf.

Referenced by bm::sparse_vector_deserializer< bm::str_sparse_vector >::deserialize(), TestCompressSparseVectorSerial(), TestSparseVectorSerialization2(), TestStrSparseVectorSerial(), and CVCFVariantsBase::x_DeserializeDescr_Range().

◆ deserialize_structure()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize_structure ( SV &  sv,
const unsigned char *  buf 
)

Load serialization descriptor, create vectors but DO NOT perform full deserialization

Parameters
sv- [out] target sparse vector to populate
buf- source memory pointer

Definition at line 1235 of file bmsparsevec_serial.h.

References BM_ASSERT, buf, and i.

Referenced by test_chr21(), test_str_sv_des_fnc(), TestSparseVectorSerialization2(), TestStrSparseVectorSerial(), VCF_des_test(), CVCFVariantsBase::x_DeserializeDescr_All(), and CVCFVariantsBase::x_DeserializeDescr_Range().

◆ deserialize_sv()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::deserialize_sv ( SV &  sv,
const unsigned char *  buf,
const bvector_type mask_bv,
bool  clear_sv 
)
protected

◆ load_header()

template<typename SV >
unsigned bm::sparse_vector_deserializer< SV >::load_header ( bm::decoder dec,
SV &  sv,
unsigned char &  matr_s_ser 
)
protected

Deserialize header/version and other common info.

Returns
number of bit-planes

Definition at line 1417 of file bmsparsevec_serial.h.

References BM_ASSERT, bm::decoder::get_64(), bm::decoder_base::get_8(), and rapidjson::value.

◆ load_null_plane()

template<typename SV >
int bm::sparse_vector_deserializer< SV >::load_null_plane ( SV &  sv,
int  planes,
const unsigned char *  buf,
const bvector_type mask_bv 
)
protected

load NULL bit-plane (returns new planes count)

Definition at line 1559 of file bmsparsevec_serial.h.

References BM_ASSERT, buf, i, offset, and bm::READONLY.

◆ load_planes_off_table()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::load_planes_off_table ( const unsigned char *  buf,
bm::decoder dec,
unsigned  planes 
)
protected

◆ load_remap()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::load_remap ( SV &  sv,
const unsigned char *  remap_buf_ptr 
)
protected

◆ operator=()

template<typename SV >
sparse_vector_deserializer& bm::sparse_vector_deserializer< SV >::operator= ( const sparse_vector_deserializer< SV > &  )
privatedelete

◆ raise_invalid_64bit()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::raise_invalid_64bit
staticprotected

throw error on incorrect deserialization

Definition at line 1808 of file bmsparsevec_serial.h.

◆ raise_invalid_bitdepth()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::raise_invalid_bitdepth
staticprotected

throw error on incorrect deserialization

Definition at line 1820 of file bmsparsevec_serial.h.

◆ raise_invalid_format()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::raise_invalid_format
staticprotected

throw error on incorrect deserialization

Definition at line 1832 of file bmsparsevec_serial.h.

◆ raise_invalid_header()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::raise_invalid_header
staticprotected

throw error on incorrect deserialization

Definition at line 1796 of file bmsparsevec_serial.h.

◆ raise_missing_remap_matrix()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::raise_missing_remap_matrix
staticprotected

throw error on incorrect deserialization

Definition at line 1844 of file bmsparsevec_serial.h.

◆ set_finalization()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::set_finalization ( bm::finalization  is_final)

Set deserialization finalization to force deserialized vectors into READONLY (or READWRITE) mode.

Performance impact: Turning ON finalization will make deserialization a lit slower, because each bit-vector will be re-converted into new mode (READONLY). Following (search) operations may perform a bit faster.

Parameters
is_final- finalization code (use bm::finalization::READONLY to produce an immutable vector)

Definition at line 1176 of file bmsparsevec_serial.h.

Referenced by TestCompressSparseVectorSerial(), TestSparseVectorSerial(), and TestStrSparseVectorSerial().

◆ set_xor_ref()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::set_xor_ref ( bv_ref_vector_type bv_ref_ptr)

Set external XOR reference vectors (data frame referenece vectors)

Parameters
bv_ref_ptr- external reference vector if NULL - resets the use of reference

Definition at line 1185 of file bmsparsevec_serial.h.

Referenced by test_chr21(), TestSparseVectorSerialization2(), TestStrSparseVectorSerial(), CVCFVariantsBase::x_DeserializeDescr_All(), and CVCFVariantsBase::x_DeserializeDescr_Range().

◆ setup_xor_compression()

template<typename SV >
void bm::sparse_vector_deserializer< SV >::setup_xor_compression
protected

setup deserializers

Definition at line 1205 of file bmsparsevec_serial.h.

Member Data Documentation

◆ alloc_

template<typename SV >
alloc_type bm::sparse_vector_deserializer< SV >::alloc_
protected

Definition at line 483 of file bmsparsevec_serial.h.

◆ bv_ref_

template<typename SV >
bv_ref_vector_type bm::sparse_vector_deserializer< SV >::bv_ref_
protected

reference vector

Definition at line 501 of file bmsparsevec_serial.h.

◆ bv_ref_ptr_

template<typename SV >
bv_ref_vector_type* bm::sparse_vector_deserializer< SV >::bv_ref_ptr_ = 0
protected

external ref bit-vect

Definition at line 502 of file bmsparsevec_serial.h.

◆ deserial_

template<typename SV >
bm::deserializer<bvector_type, bm::decoder> bm::sparse_vector_deserializer< SV >::deserial_
protected

Definition at line 491 of file bmsparsevec_serial.h.

◆ digest_offset_

template<typename SV >
bm::id64_t bm::sparse_vector_deserializer< SV >::digest_offset_
protected

Definition at line 489 of file bmsparsevec_serial.h.

◆ idx_range_from_

template<typename SV >
size_type bm::sparse_vector_deserializer< SV >::idx_range_from_
protected

Definition at line 506 of file bmsparsevec_serial.h.

◆ idx_range_set_

template<typename SV >
bool bm::sparse_vector_deserializer< SV >::idx_range_set_ = false
protected

◆ idx_range_to_

template<typename SV >
size_type bm::sparse_vector_deserializer< SV >::idx_range_to_
protected

Definition at line 507 of file bmsparsevec_serial.h.

◆ is_final_

template<typename SV >
bm::finalization bm::sparse_vector_deserializer< SV >::is_final_ = bm::finalization::UNDEFINED
protected

Definition at line 481 of file bmsparsevec_serial.h.

◆ not_null_mask_bv_

template<typename SV >
bvector_type bm::sparse_vector_deserializer< SV >::not_null_mask_bv_
protected

Definition at line 494 of file bmsparsevec_serial.h.

◆ off32_vect_

template<typename SV >
bm::heap_vector<unsigned, alloc_type, true> bm::sparse_vector_deserializer< SV >::off32_vect_
protected

Definition at line 497 of file bmsparsevec_serial.h.

◆ off_vect_

template<typename SV >
bm::heap_vector<size_t, alloc_type, true> bm::sparse_vector_deserializer< SV >::off_vect_
protected

Definition at line 496 of file bmsparsevec_serial.h.

◆ op_deserial_

template<typename SV >
bm::operation_deserializer<bvector_type> bm::sparse_vector_deserializer< SV >::op_deserial_
protected

Definition at line 492 of file bmsparsevec_serial.h.

◆ plane_digest_bv_

template<typename SV >
bvector_type bm::sparse_vector_deserializer< SV >::plane_digest_bv_
protected

Definition at line 487 of file bmsparsevec_serial.h.

◆ pool_

template<typename SV >
allocator_pool_type bm::sparse_vector_deserializer< SV >::pool_
protected

Definition at line 485 of file bmsparsevec_serial.h.

◆ remap_buf_ptr_

template<typename SV >
const unsigned char* bm::sparse_vector_deserializer< SV >::remap_buf_ptr_ = 0
protected

Definition at line 482 of file bmsparsevec_serial.h.

◆ remap_rlen_vect_

template<typename SV >
rlen_vector_type bm::sparse_vector_deserializer< SV >::remap_rlen_vect_
protected

Definition at line 498 of file bmsparsevec_serial.h.

◆ rsc_compressor_

template<typename SV >
bm::rank_compressor<bvector_type> bm::sparse_vector_deserializer< SV >::rsc_compressor_
protected

Definition at line 493 of file bmsparsevec_serial.h.

◆ rsc_mask_bv_

template<typename SV >
bvector_type bm::sparse_vector_deserializer< SV >::rsc_mask_bv_
protected

Definition at line 495 of file bmsparsevec_serial.h.

◆ sv_size_

template<typename SV >
bm::id64_t bm::sparse_vector_deserializer< SV >::sv_size_
protected

Definition at line 488 of file bmsparsevec_serial.h.

◆ temp_block_

template<typename SV >
bm::word_t* bm::sparse_vector_deserializer< SV >::temp_block_ = 0
protected

Definition at line 484 of file bmsparsevec_serial.h.


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:39 2024 by modify_doxy.py rev. 669887