include/util/bitset/bmserial.h File Reference

#include "bm.h"
#include "encoding.h"
#include "bmdef.h"
#include "bmfunc.h"
#include "bmalgo_impl.h"
#include "bmundef.h"

Include dependency graph for bmserial.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  bm

Classes

class  bm::serial_stream_iterator< DEC >
 Serialization stream iterator. More...
class  bm::operation_deserializer< BV >
 Class deserializer, can perform logical operation on bit-vector and serialized bit-vector. More...
class  bm::iterator_deserializer< BV, SerialIterator >
 Iterator to walk forward the serialized stream. More...
class  bm::deserializer< BV, DEC >
 Class deserializer. More...

Defines

#define SER_NEXT_GRP(enc, nb, B_1ZERO, B_8ZERO, B_16ZERO, B_32ZERO)
#define BM_SET_ONE_BLOCKS(x)

Enumerations

enum  bm::serialization_header_mask {
  bm::BM_HM_DEFAULT = 1, bm::BM_HM_RESIZE = (1 << 1), bm::BM_HM_ID_LIST = (1 << 2), bm::BM_HM_NO_BO = (1 << 3),
  bm::BM_HM_NO_GAPL = (1 << 4)
}
enum  bm::serialization_flags { bm::BM_NO_BYTE_ORDER = 1, bm::BM_NO_GAP_LENGTH = (1 << 1) }
 Bit mask flags for serialization algorithm. More...

Functions

template<class BV>
unsigned bm::serialize (const BV &bv, unsigned char *buf, bm::word_t *temp_block, unsigned serialization_flags=0)
 Saves bitvector into memory.
template<class BV>
unsigned bm::serialize (BV &bv, unsigned char *buf, unsigned serialization_flags=0)
 Saves bitvector into memory. Allocates temporary memory block for bvector.
template<class BV>
unsigned bm::deserialize (BV &bv, const unsigned char *buf, bm::word_t *temp_block=0)
 Bitvector deserialization from memory.

Variables

const unsigned char set_block_end = 0
 End of serialization.
const unsigned char set_block_1zero = 1
 One all-zero block.
const unsigned char set_block_1one = 2
 One block all-set (1111...).
const unsigned char set_block_8zero = 3
 Up to 256 zero blocks.
const unsigned char set_block_8one = 4
 Up to 256 all-set blocks.
const unsigned char set_block_16zero = 5
 Up to 65536 zero blocks.
const unsigned char set_block_16one = 6
 UP to 65536 all-set blocks.
const unsigned char set_block_32zero = 7
 Up to 4G zero blocks.
const unsigned char set_block_32one = 8
 UP to 4G all-set blocks.
const unsigned char set_block_azero = 9
 All other blocks zero.
const unsigned char set_block_aone = 10
 All other blocks one.
const unsigned char set_block_bit = 11
 Plain bit block.
const unsigned char set_block_sgapbit = 12
 SGAP compressed bitblock.
const unsigned char set_block_sgapgap = 13
 SGAP compressed GAP block.
const unsigned char set_block_gap = 14
 Plain GAP block.
const unsigned char set_block_gapbit = 15
 GAP compressed bitblock.
const unsigned char set_block_arrbit = 16
 List of bits ON.
const unsigned char set_block_bit_interval = 17
 Interval block.
const unsigned char set_block_arrgap = 18
 List of bits ON (GAP block).


Define Documentation

#define BM_SET_ONE_BLOCKS  ) 
 

Value:

{\
         unsigned end_block = i + x; \
         for (;i < end_block; ++i) \
            bman.set_block_all_set(i); \
    } \
    --i

Definition at line 104 of file bmserial.h.

#define SER_NEXT_GRP enc,
nb,
B_1ZERO,
B_8ZERO,
B_16ZERO,
B_32ZERO   ) 
 

Value:

if (nb == 1) \
      enc.put_8(B_1ZERO); \
   else if (nb < 256) \
   { \
      enc.put_8(B_8ZERO); \
      enc.put_8((unsigned char)nb); \
   } \
   else if (nb < 65536) \
   { \
      enc.put_8(B_16ZERO); \
      enc.put_16((unsigned short)nb); \
   } \
   else \
   {\
      enc.put_8(B_32ZERO); \
      enc.put_32(nb); \
   }

Definition at line 84 of file bmserial.h.


Variable Documentation

const unsigned char set_block_16one = 6
 

UP to 65536 all-set blocks.

Definition at line 64 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_16zero = 5
 

Up to 65536 zero blocks.

Definition at line 63 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_1one = 2
 

One block all-set (1111...).

Definition at line 60 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_1zero = 1
 

One all-zero block.

Definition at line 59 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_32one = 8
 

UP to 4G all-set blocks.

Definition at line 66 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_32zero = 7
 

Up to 4G zero blocks.

Definition at line 65 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_8one = 4
 

Up to 256 all-set blocks.

Definition at line 62 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_8zero = 3
 

Up to 256 zero blocks.

Definition at line 61 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_aone = 10
 

All other blocks one.

Definition at line 68 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_arrbit = 16
 

List of bits ON.

Definition at line 75 of file bmserial.h.

const unsigned char set_block_arrgap = 18
 

List of bits ON (GAP block).

Definition at line 77 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::get_gap_block(), and bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_azero = 9
 

All other blocks zero.

Definition at line 67 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next(), and bm::serialize().

const unsigned char set_block_bit = 11
 

Plain bit block.

Definition at line 70 of file bmserial.h.

Referenced by bm::blocks_manager< Alloc, MS >::convert_gap2bitset(), bm::serial_stream_iterator< DEC >::get_bit_block_AND(), bm::serial_stream_iterator< DEC >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC >::get_bit_block_OR(), bm::serial_stream_iterator< DEC >::get_bit_block_SUB(), bm::serial_stream_iterator< DEC >::get_bit_block_XOR(), bm::serial_stream_iterator< DEC >::next(), and bm::blocks_manager< Alloc, MS >::set_block_all_set().

const unsigned char set_block_bit_interval = 17
 

Interval block.

Definition at line 76 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::get_bit_block_AND(), bm::serial_stream_iterator< DEC >::get_bit_block_ASSIGN(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_A(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_AND(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_OR(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_AB(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_SUB_BA(), bm::serial_stream_iterator< DEC >::get_bit_block_COUNT_XOR(), bm::serial_stream_iterator< DEC >::get_bit_block_OR(), bm::serial_stream_iterator< DEC >::get_bit_block_SUB(), bm::serial_stream_iterator< DEC >::get_bit_block_XOR(), and bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_end = 0
 

End of serialization.

Definition at line 58 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_gap = 14
 

Plain GAP block.

Definition at line 73 of file bmserial.h.

Referenced by bm::serial_stream_iterator< DEC >::get_gap_block(), and bm::serial_stream_iterator< DEC >::next().

const unsigned char set_block_gapbit = 15
 

GAP compressed bitblock.

Definition at line 74 of file bmserial.h.

const unsigned char set_block_sgapbit = 12
 

SGAP compressed bitblock.

Definition at line 71 of file bmserial.h.

const unsigned char set_block_sgapgap = 13
 

SGAP compressed GAP block.

Definition at line 72 of file bmserial.h.


Generated on Mon Nov 9 06:27:09 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Nov 09 15:46:12 2009 by modify_doxy.py rev. 173732