BitMagic-C++: bm::decoder Class Reference

BitMagic-C++

Public Member Functions
bm::decoder Class Reference
Elias Gamma Code (internal)

Class for decoding data from memory buffer. More...

`#include <encoding.h>`

Inheritance diagram for bm::decoder:
[legend]
Collaboration diagram for bm::decoder:
[legend]

## Public Member Functions
| decoder (const unsigned char *buf) BMNOEXCEPT
| Construction. More...
bm::short_t | get_16 () BMNOEXCEPT
| Reads 16-bit word from the decoding buffer. More...
bm::word_t | get_24 () BMNOEXCEPT
| Reads 32-bit word from the decoding buffer. More...
bm::word_t | get_32 () BMNOEXCEPT
| Reads 32-bit word from the decoding buffer. More...
bm::id64_t | get_48 () BMNOEXCEPT
| Reads 64-bit word from the decoding buffer. More...
bm::id64_t | get_64 () BMNOEXCEPT
| Reads 64-bit word from the decoding buffer. More...
void | get_32 (bm::word_t *w, unsigned count) BMNOEXCEPT
| Reads block of 32-bit words from the decoding buffer. More...
bool | get_32_OR (bm::word_t *w, unsigned count) BMNOEXCEPT
| Reads block of 32-bit words from the decoding buffer and ORs to the destination. More...
void | get_32_AND (bm::word_t *w, unsigned count) BMNOEXCEPT
| Reads block of 32-bit words from the decoding buffer and ANDs to the destination. More...
void | get_16 (bm::short_t *s, unsigned count) BMNOEXCEPT
| Reads block of 32-bit words from the decoding buffer. More...
Public Member Functions inherited from bm::decoder_base
| decoder_base (const unsigned char *buf) BMNOEXCEPT
unsigned char | get_8 () BMNOEXCEPT
| Reads character from the decoding buffer. More...
size_t | size () const BMNOEXCEPT
| Returns size of the current decoding stream. More...
void | seek (int delta) BMNOEXCEPT
| change current position More...
void | memcpy (unsigned char *dst, size_t count) BMNOEXCEPT
| read bytes from the decode buffer More...
const unsigned char * | get_pos () const BMNOEXCEPT
| Return current buffer pointer. More...
void | set_pos (const unsigned char *pos) BMNOEXCEPT
| Set current buffer pointer. More...

## Additional Inherited Members
Protected Attributes inherited from bm::decoder_base
const unsigned char * | buf_
const unsigned char * | start_

## Detailed Description

Class for decoding data from memory buffer.

Properly handles aligment issues with integer data types.

Definition at line 117 of file encoding.h.

## Constructor & Destructor Documentation

## ◆ decoder()

bm::decoder::decoder | ( | const unsigned char * | buf | ) |
| inline

Construction.

Parameters

  buf | - pointer to the decoding memory.

Definition at line 630 of file encoding.h.

## Member Function Documentation

## ◆ get_16() [1/2]

BMFORCEINLINE bm::short_t bm::decoder::get_16 | ( |  | ) |

Reads 16-bit word from the decoding buffer.

Definition at line 639 of file encoding.h.

References bm::encoder::memcpy().

Referenced by bm::deserializer< bvector_type, bm::decoder >::decode_arrbit(), bm::deserializer< bvector_type, bm::decoder >::decode_bit_block(), bm::deserializer< bvector_type, bm::decoder >::decode_block_bit_interval(), bm::deserializer< bvector_type, bm::decoder >::deserialize(), bm::deserializer< bvector_type, bm::decoder >::deserialize_gap(), bm::deseriaizer_base< DEC, BV::block_idx_type >::read_gap_block(), bm::deseriaizer_base< DEC, BV::block_idx_type >::read_id_list(), and bm::deseriaizer_base< DEC, BV::block_idx_type >::try_skip().

## ◆ get_16() [2/2]

void bm::decoder::get_16 | ( | bm::short_t * | s,
|  | unsigned | count
| ) |  |
| inline

Reads block of 32-bit words from the decoding buffer.

Parameters

  s | - pointer on memory block to read into.
  count | - size of memory block in words.

Definition at line 840 of file encoding.h.

References bm::encoder::memcpy().

## ◆ get_24()

bm::word_t bm::decoder::get_24 | ( |  | ) |
| inline

Reads 32-bit word from the decoding buffer.

Definition at line 655 of file encoding.h.

Referenced by bm::deserializer< bvector_type, bm::decoder >::deserialize(), and bm::deseriaizer_base< DEC, BV::block_idx_type >::try_skip().

## ◆ get_32() [1/2]

BMFORCEINLINE bm::word_t bm::decoder::get_32 | ( |  | ) |

Reads 32-bit word from the decoding buffer.

Definition at line 668 of file encoding.h.

References bm::encoder::memcpy().

Referenced by bm::deserializer< bvector_type, bm::decoder >::decode_block_bit(), bm::deserializer< bvector_type, bm::decoder >::decode_block_bit_interval(), bm::deserializer< bvector_type, bm::decoder >::deserialize(), bm::deserializer< bvector_type, bm::decoder >::deserialize_gap(), and bm::deseriaizer_base< DEC, BV::block_idx_type >::try_skip().

## ◆ get_32() [2/2]

void bm::decoder::get_32 | ( | bm::word_t * | w,
|  | unsigned | count
| ) |  |
| inline

Reads block of 32-bit words from the decoding buffer.

Parameters

  w | - pointer on memory block to read into.
  count | - size of memory block in words.

Definition at line 729 of file encoding.h.

References bm::encoder::memcpy().

## ◆ get_32_AND()

void bm::decoder::get_32_AND | ( | bm::word_t * | w,
|  | unsigned | count
| ) |  |
| inline

Reads block of 32-bit words from the decoding buffer and ANDs to the destination.

Parameters

  w | - pointer on memory block to read into
  count | - should match bm::set_block_size

Definition at line 802 of file encoding.h.

References bm::sse2_and_arr_unal().

## ◆ get_32_OR()

bool bm::decoder::get_32_OR | ( | bm::word_t * | w,
|  | unsigned | count
| ) |  |
| inline

Reads block of 32-bit words from the decoding buffer and ORs to the destination.

Parameters

  w | - pointer on memory block to read into
  count | - should match bm::set_block_size

Definition at line 761 of file encoding.h.

References bm::sse2_or_arr_unal().

## ◆ get_48()

bm::id64_t bm::decoder::get_48 | ( |  | ) |
| inline

Reads 64-bit word from the decoding buffer.

Definition at line 686 of file encoding.h.

Referenced by bm::deserializer< bvector_type, bm::decoder >::deserialize(), and bm::deseriaizer_base< DEC, BV::block_idx_type >::try_skip().

## ◆ get_64()

bm::id64_t bm::decoder::get_64 | ( |  | ) |
| inline

Reads 64-bit word from the decoding buffer.

Definition at line 703 of file encoding.h.

References bm::encoder::memcpy().

Referenced by bm::compressed_collection_deserializer< CBC >::deserialize(), bm::deserializer< bvector_type, bm::decoder >::deserialize(), bm::sparse_vector_deserializer< SV >::deserialize_range(), bm::sparse_vector_deserializer< SV >::deserialize_sv(), bm::sparse_vector_deserializer< SV >::load_header(), bm::sparse_vector_deserializer< SV >::load_plains_off_table(), bm::sparse_vector_deserializer< SV >::load_remap(), and bm::deseriaizer_base< DEC, BV::block_idx_type >::try_skip().

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

- encoding.h