bm::serializer< BV > Class Template Reference
[bvector serialization]

Bit-vector serialization class. More...

#include <bmserial.h>

Public Types

typedef BV::allocator_type allocator_type
typedef BV::blocks_manager_type blocks_manager_type

Public Member Functions

 serializer (const allocator_type &alloc=allocator_type())
 ~serializer ()
void set_compression_level (unsigned clevel)
 Set compression level.
unsigned get_compression_level () const
 Get compression level.
unsigned serialize (const BV &bv, unsigned char *buf, unsigned buf_size)
 Bitvector serilization into memory block.
void gap_length_serialization (bool value)
 Set GAP length serialization (serializes GAP levels of the original vector).
void byte_order_serialization (bool value)
 Set byte-order serialization (for cross platform compatibility).

Protected Member Functions

void encode_header (const BV &bv, bm::encoder &enc)
 Encode serialization header information.
void encode_gap_block (bm::gap_word_t *gap_block, bm::encoder &enc)
 Encode GAP block.
void gamma_gap_block (bm::gap_word_t *gap_block, bm::encoder &enc)
 Encode GAP block with Elias Gamma coder.
void gamma_gap_array (const bm::gap_word_t *gap_block, unsigned arr_len, bm::encoder &enc, bool inverted=false)
 Encode GAP block as delta-array with Elias Gamma coder.
void encode_bit_interval (const bm::word_t *blk, bm::encoder &enc, unsigned size_control)
 Encode BIT block with repeatable runs of zeroes.

Detailed Description

template<class BV>
class bm::serializer< BV >

Bit-vector serialization class.

Class designed to convert sparse bit-vector into a block of memory ready for file or database storage or network transfer.

Examples:

sample4.cpp.

Definition at line 146 of file bmserial.h.


Member Typedef Documentation

template<class BV>
typedef BV::allocator_type bm::serializer< BV >::allocator_type

Definition at line 149 of file bmserial.h.

template<class BV>
typedef BV::blocks_manager_type bm::serializer< BV >::blocks_manager_type

Definition at line 150 of file bmserial.h.


Constructor & Destructor Documentation

template<class BV >
bm::serializer< BV >::serializer ( const allocator_type alloc = allocator_type()  )  [inline]

Definition at line 544 of file bmserial.h.

template<class BV >
bm::serializer< BV >::~serializer (  )  [inline]

Definition at line 567 of file bmserial.h.


Member Function Documentation

template<class BV >
void bm::serializer< BV >::byte_order_serialization ( bool  value  )  [inline]

Set byte-order serialization (for cross platform compatibility).

Parameters:
value - TRUE serialization format includes byte-order marker

Definition at line 580 of file bmserial.h.

Referenced by main(), and bm::serialize().

template<class BV >
void bm::serializer< BV >::encode_bit_interval ( const bm::word_t blk,
bm::encoder enc,
unsigned  size_control 
) [inline, protected]

Encode BIT block with repeatable runs of zeroes.

Definition at line 762 of file bmserial.h.

References BM_ASSERT, bm::encoder::put_16(), bm::encoder::put_32(), bm::encoder::put_8(), bm::set_block_bit_0runs, and bm::set_block_size.

Referenced by bm::serializer< BV >::serialize().

template<class BV >
void bm::serializer< BV >::encode_gap_block ( bm::gap_word_t gap_block,
bm::encoder enc 
) [inline, protected]
template<class BV >
void bm::serializer< BV >::encode_header ( const BV &  bv,
bm::encoder enc 
) [inline, protected]
template<class BV >
void bm::serializer< BV >::gamma_gap_array ( const bm::gap_word_t gap_block,
unsigned  arr_len,
bm::encoder enc,
bool  inverted = false 
) [inline, protected]
template<class BV >
void bm::serializer< BV >::gamma_gap_block ( bm::gap_word_t gap_block,
bm::encoder enc 
) [inline, protected]
template<class BV >
void bm::serializer< BV >::gap_length_serialization ( bool  value  )  [inline]

Set GAP length serialization (serializes GAP levels of the original vector).

Parameters:
value - when TRUE serialized vector includes GAP levels parameters

Definition at line 574 of file bmserial.h.

Referenced by main(), and bm::serialize().

template<class BV >
unsigned bm::serializer< BV >::get_compression_level (  )  const [inline]

Get compression level.

Definition at line 561 of file bmserial.h.

template<class BV >
unsigned bm::serializer< BV >::serialize ( const BV &  bv,
unsigned char *  buf,
unsigned  buf_size 
) [inline]
template<class BV >
void bm::serializer< BV >::set_compression_level ( unsigned  clevel  )  [inline]

Set compression level.

Higher compression takes more time to process.

Parameters:
clevel - compression level (0-4)

Definition at line 555 of file bmserial.h.

Referenced by main(), and bm::serialize().


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

Generated on Sun Apr 25 09:37:46 2010 for BitMagic by  doxygen 1.6.1