BitMagic-C++
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
bm::sparse_vector_deserializer< SV > Class Template Reference

sparse vector de-serializer More...

#include <bmsparsevec_serial.h>

Collaboration diagram for bm::sparse_vector_deserializer< SV >:
Collaboration graph
[legend]

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_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_plains (SV &sv, unsigned plains, const unsigned char *buf, const bvector_type *mask_bv=0)
 deserialize bit-vector plains More...
 
void load_plains_off_table (const unsigned char *buf, bm::decoder &dec, unsigned plains)
 load offset table More...
 
int load_null_plain (SV &sv, int plains, const unsigned char *buf, const bvector_type *mask_bv)
 load NULL bit-plain (returns new plains 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

const unsigned char * remap_buf_ptr_
 
alloc_type alloc_
 
bm::word_ttemp_block_
 
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, true > off_vect_
 
bm::heap_vector< unsigned, alloc_type, true > off32_vect_
 
rlen_vector_type remap_rlen_vect_
 
bv_ref_vector_type bv_ref_
 reference vector More...
 
bv_ref_vector_typebv_ref_ptr_
 external ref More...
 
bool idx_range_set_
 
size_type idx_range_from_
 
size_type idx_range_to_
 

Detailed Description

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

sparse vector de-serializer

Examples:
rscsample02.cpp, rscsample05.cpp, strsvsample05.cpp, svsample02.cpp, and svsample08.cpp.

Definition at line 288 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 378 of file bmsparsevec_serial.h.

◆ allocator_pool_type

Definition at line 296 of file bmsparsevec_serial.h.

◆ bv_ref_vector_type

Definition at line 297 of file bmsparsevec_serial.h.

◆ bvector_type

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

Definition at line 291 of file bmsparsevec_serial.h.

◆ bvector_type_const_ptr

template<typename SV>
typedef const bvector_type* bm::sparse_vector_deserializer< SV >::bvector_type_const_ptr

Definition at line 292 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 293 of file bmsparsevec_serial.h.

◆ size_type

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

Definition at line 295 of file bmsparsevec_serial.h.

◆ value_type

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

Definition at line 294 of file bmsparsevec_serial.h.

Constructor & Destructor Documentation

◆ sparse_vector_deserializer()

◆ ~sparse_vector_deserializer()

template<typename SV >
bm::sparse_vector_deserializer< SV >::~sparse_vector_deserializer ( )

Member Function Documentation

◆ clear_xor_compression()

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

◆ deserialize() [1/3]

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

Deserialize sparse vector

Parameters
sv- [out] target sparse vector to populate
buf- input BLOB source memory pointer
clear_sv- if true clears the target vector
See also
deserialize_range
Examples:
rscsample05.cpp, and svsample02.cpp.

Definition at line 1128 of file bmsparsevec_serial.h.

References bm::sparse_vector_deserializer< SV >::deserialize_sv(), and bm::sparse_vector_deserializer< SV >::idx_range_set_.

Referenced by deserialize_df0(), deserialize_df2(), main(), SDemo2(), and bm::sparse_vector_deserialize().

◆ deserialize() [2/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 342 of file bmsparsevec_serial.h.

References bm::deserialize_range().

◆ deserialize() [3/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 359 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::buf().

◆ deserialize_plains()

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

◆ 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_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
Examples:
rscsample05.cpp.

Definition at line 1139 of file bmsparsevec_serial.h.

References BM_ASSERT, bm::sparse_vector_deserializer< SV >::load_header(), bm::sparse_vector_deserializer< SV >::load_plains_off_table(), and bm::sparse_vector_deserializer< SV >::off_vect_.

Referenced by deserialize_df2().

◆ 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

◆ load_null_plain()

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

◆ load_plains_off_table()

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

◆ load_remap()

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

◆ raise_invalid_64bit()

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

throw error on incorrect deserialization

Definition at line 1666 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::load_header().

◆ raise_invalid_bitdepth()

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

throw error on incorrect deserialization

Definition at line 1678 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::load_header().

◆ raise_invalid_format()

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

throw error on incorrect deserialization

Definition at line 1690 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::load_remap().

◆ raise_invalid_header()

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

throw error on incorrect deserialization

Definition at line 1654 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::load_header().

◆ 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 1702 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_deserializer< SV >::load_remap().

◆ 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
Examples:
rscsample05.cpp.

Definition at line 1081 of file bmsparsevec_serial.h.

References bm::sparse_vector_deserializer< SV >::bv_ref_ptr_, and bm::sparse_vector_deserializer< SV >::clear_xor_compression().

Referenced by deserialize_df2().

◆ setup_xor_compression()

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

Field Documentation

◆ alloc_

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

◆ bv_ref_

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

◆ bv_ref_ptr_

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

◆ deserial_

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

◆ digest_offset_

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

◆ idx_range_from_

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

◆ idx_range_set_

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

◆ idx_range_to_

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

◆ not_null_mask_bv_

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

◆ off32_vect_

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

◆ off_vect_

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

◆ op_deserial_

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

◆ plane_digest_bv_

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

◆ pool_

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

◆ remap_buf_ptr_

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

◆ remap_rlen_vect_

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

◆ rsc_compressor_

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

◆ rsc_mask_bv_

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

◆ sv_size_

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

◆ temp_block_

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

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