#include <bit_stream.hpp>
Public Types | |
enum | { ResultOutOfBuffer = 0, ResultOk = 1 } |
Public Member Functions | |
BitStream (ITransferBuffer &buf) | |
int | read (uint8_t *bytes, const unsigned bitlen) |
int | write (const uint8_t *bytes, const unsigned bitlen) |
Static Public Attributes | |
static const unsigned | MaxBitsPerRW = MaxBytesPerRW * 8 |
Static Private Member Functions | |
static unsigned | bitlenToBytelen (unsigned bits) |
static void | copyBitArrayAlignedToUnaligned (const uint8_t *src_org, unsigned src_len, uint8_t *dst_org, unsigned dst_offset) |
static void | copyBitArrayUnalignedToAligned (const uint8_t *src_org, unsigned src_offset, unsigned src_len, uint8_t *dst_org) |
Private Attributes | |
unsigned | bit_offset_ |
ITransferBuffer & | buf_ |
uint8_t | byte_cache_ |
Static Private Attributes | |
static const unsigned | MaxBytesPerRW = 16 |
This class treats a chunk of memory as an array of bits. It is used by the bit codec for serialization/deserialization.
Definition at line 31 of file bit_stream.hpp.
anonymous enum |
Enumerator | |
---|---|
ResultOutOfBuffer | |
ResultOk |
Definition at line 58 of file bit_stream.hpp.
|
inlineexplicit |
Definition at line 64 of file bit_stream.hpp.
|
inlinestaticprivate |
Definition at line 39 of file bit_stream.hpp.
|
inlinestaticprivate |
Definition at line 41 of file bit_stream.hpp.
|
inlinestaticprivate |
Definition at line 48 of file bit_stream.hpp.
Definition at line 55 of file uc_bit_stream.cpp.
Write/read calls interpret bytes as bit arrays, 8 bits per byte, where the most significant bits have lower index, i.e.: Hex: 55 2d Bits: 01010101 00101101 Indices: 0 .. 7 8 .. 15 Return values: Negative - Error Zero - Out of buffer space Positive - OK
Definition at line 15 of file uc_bit_stream.cpp.
|
private |
Definition at line 36 of file bit_stream.hpp.
|
private |
Definition at line 35 of file bit_stream.hpp.
|
private |
Definition at line 37 of file bit_stream.hpp.
|
static |
Definition at line 56 of file bit_stream.hpp.
|
staticprivate |
Definition at line 33 of file bit_stream.hpp.