BitMagic-C++: bm::bit_out< TEncoder > Class Template Reference

BitMagic-C++

Public Member Functions
bm::bit_out< TEncoder > Class Template Reference
Elias Gamma Code (internal)

Byte based writer for un-aligned bit streaming. More...

`#include <encoding.h>`

## Public Member Functions
| bit_out (TEncoder &dest)
| ~bit_out ()
void | put_bit (unsigned value) BMNOEXCEPT
| issue single bit into encode bit-stream More...
void | put_bits (unsigned value, unsigned count) BMNOEXCEPT
| issue count bits out of value More...
void | put_zero_bit () BMNOEXCEPT
| issue 0 into output stream More...
void | put_zero_bits (unsigned count) BMNOEXCEPT
| issue specified number of 0s More...
void | gamma (unsigned value) BMNOEXCEPT
| Elias Gamma encode the specified value. More...
void | bic_encode_u16 (const bm::gap_word_t *arr, unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) BMNOEXCEPT
| Binary Interpolative array decode. More...
void | bic_encode_u16_rg (const bm::gap_word_t *arr, unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) BMNOEXCEPT
| Binary Interpolative encoding (array of 16-bit ints) More...
void | bic_encode_u16_cm (const bm::gap_word_t *arr, unsigned sz, bm::gap_word_t lo, bm::gap_word_t hi) BMNOEXCEPT
| Binary Interpolative encoding (array of 16-bit ints) cm - "center-minimal". More...
void | bic_encode_u32_cm (const bm::word_t *arr, unsigned sz, bm::word_t lo, bm::word_t hi) BMNOEXCEPT
| Binary Interpolative encoding (array of 32-bit ints) cm - "center-minimal". More...
void | flush () BMNOEXCEPT
| Flush the incomplete 32-bit accumulator word. More...

## Detailed Description

### template<class TEncoder>
class bm::bit_out< TEncoder >

Byte based writer for un-aligned bit streaming.

See also
  encoder

Definition at line 174 of file encoding.h.

## Constructor & Destructor Documentation

## ◆ bit_out()

template<class TEncoder >

bm::bit_out< TEncoder >::bit_out | ( | TEncoder & | dest | ) |
| inline

Definition at line 177 of file encoding.h.

## ◆ ~bit_out()

template<class TEncoder >

bm::bit_out< TEncoder >::~bit_out | ( |  | ) |
| inline

Definition at line 181 of file encoding.h.

## Member Function Documentation

## ◆ bic_encode_u16()

template<class TEncoder >

void bm::bit_out< TEncoder >::bic_encode_u16 | ( | const bm::gap_word_t * | arr,
|  | unsigned | sz,
|  | bm::gap_word_t | lo,
|  | bm::gap_word_t | hi
| ) |  |
| inline

Binary Interpolative array decode.

Definition at line 199 of file encoding.h.

Referenced by bm::serializer< bvector_type >::bienc_gap_bit_block(), bm::serializer< bvector_type >::interpolated_arr_bit_block(), bm::serializer< bvector_type >::interpolated_encode_gap_block(), bm::serializer< bvector_type >::interpolated_gap_array(), and bm::serializer< bvector_type >::interpolated_gap_array_v0().

## ◆ bic_encode_u16_cm()

template<typename TEncoder >

void bm::bit_out< TEncoder >::bic_encode_u16_cm | ( | const bm::gap_word_t * | arr,
|  | unsigned | sz,
|  | bm::gap_word_t | lo,
|  | bm::gap_word_t | hi
| ) |  |

Binary Interpolative encoding (array of 16-bit ints) cm - "center-minimal".

Definition at line 1336 of file encoding.h.

References bm::bit_scan_reverse32(), and BM_ASSERT.

## ◆ bic_encode_u16_rg()

template<typename TEncoder >

void bm::bit_out< TEncoder >::bic_encode_u16_rg | ( | const bm::gap_word_t * | arr,
|  | unsigned | sz,
|  | bm::gap_word_t | lo,
|  | bm::gap_word_t | hi
| ) |  |

Binary Interpolative encoding (array of 16-bit ints)

Definition at line 1175 of file encoding.h.

References bm::bit_scan_reverse32(), and BM_ASSERT.

## ◆ bic_encode_u32_cm()

template<typename TEncoder >

void bm::bit_out< TEncoder >::bic_encode_u32_cm | ( | const bm::word_t * | arr,
|  | unsigned | sz,
|  | bm::word_t | lo,
|  | bm::word_t | hi
| ) |  |

Binary Interpolative encoding (array of 32-bit ints) cm - "center-minimal".

Definition at line 1210 of file encoding.h.

References bm::bit_scan_reverse32(), and BM_ASSERT.

## ◆ flush()

template<class TEncoder >

void bm::bit_out< TEncoder >::flush | ( |  | ) |
| inline

Flush the incomplete 32-bit accumulator word.

Definition at line 222 of file encoding.h.

Referenced by bm::serializer< bvector_type >::bienc_gap_bit_block(), bm::serializer< bvector_type >::interpolated_arr_bit_block(), bm::serializer< bvector_type >::interpolated_encode_gap_block(), bm::serializer< bvector_type >::interpolated_gap_array(), and bm::serializer< bvector_type >::interpolated_gap_array_v0().

## ◆ gamma()

template<typename TEncoder >

void bm::bit_out< TEncoder >::gamma | ( | unsigned | value | ) |

Elias Gamma encode the specified value.

Definition at line 1103 of file encoding.h.

References bm::bit_scan_reverse32(), and BM_ASSERT.

Referenced by bm::serializer< bvector_type >::gamma_gap_array(), and bm::serializer< bvector_type >::interpolated_gap_array_v0().

## ◆ put_bit()

template<typename TEncoder >

void bm::bit_out< TEncoder >::put_bit | ( | unsigned | value | ) |

issue single bit into encode bit-stream

Definition at line 1011 of file encoding.h.

References BM_ASSERT.

## ◆ put_bits()

template<typename TEncoder >

void bm::bit_out< TEncoder >::put_bits | ( | unsigned | value,
|  | unsigned | count
| ) |  |

issue count bits out of value

Definition at line 1022 of file encoding.h.

References BM_ASSERT.

## ◆ put_zero_bit()

template<typename TEncoder >

void bm::bit_out< TEncoder >::put_zero_bit

issue 0 into output stream

Definition at line 1064 of file encoding.h.

## ◆ put_zero_bits()

template<typename TEncoder >

void bm::bit_out< TEncoder >::put_zero_bits | ( | unsigned | count | ) |

issue specified number of 0s

Definition at line 1073 of file encoding.h.

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

- encoding.h