Zserio C++ runtime library
1.1.0
Built for Zserio 2.15.0
|
#include <BitBuffer.h>
Public Types | |
using | allocator_type = ALLOC |
Public Member Functions | |
allocator_type | get_allocator () const |
BasicBitBuffer () | |
BasicBitBuffer (const ALLOC &allocator) | |
BasicBitBuffer (size_t bitSize, const ALLOC &allocator=ALLOC()) | |
BasicBitBuffer (Span< const uint8_t > buffer, const ALLOC &allocator=ALLOC()) | |
BasicBitBuffer (Span< const uint8_t > buffer, size_t bitSize, const ALLOC &allocator=ALLOC()) | |
BasicBitBuffer (vector< uint8_t, ALLOC > &&buffer) | |
BasicBitBuffer (vector< uint8_t, ALLOC > &&buffer, size_t bitSize) | |
BasicBitBuffer (const uint8_t *buffer, size_t bitSize, const ALLOC &allocator=ALLOC()) | |
bool | operator== (const BasicBitBuffer< ALLOC > &other) const |
bool | operator< (const BasicBitBuffer< ALLOC > &other) const |
uint32_t | hashCode () const |
const uint8_t * | getBuffer () const |
uint8_t * | getBuffer () |
size_t | getBitSize () const |
size_t | getByteSize () const |
const vector< uint8_t, ALLOC > & | getBytes () const |
Span< const uint8_t > | getData () const |
Span< uint8_t > | getData () |
~BasicBitBuffer ()=default | |
BasicBitBuffer (const BasicBitBuffer< ALLOC > &)=default | |
BasicBitBuffer (const BasicBitBuffer< ALLOC > &other, const ALLOC &allocator) | |
BasicBitBuffer & | operator= (const BasicBitBuffer< ALLOC > &)=default |
BasicBitBuffer (BasicBitBuffer< ALLOC > &&)=default | |
BasicBitBuffer (const BasicBitBuffer< ALLOC > &&other, const ALLOC &allocator) | |
BasicBitBuffer & | operator= (BasicBitBuffer< ALLOC > &&)=default |
Class which holds any bit sequence.
Because bit buffer size does not have to be byte aligned (divisible by 8), it's possible that not all bits of the last byte are used. In this case, only most significant bits of the corresponded size are used.
Definition at line 32 of file BitBuffer.h.
using zserio::BasicBitBuffer< ALLOC >::allocator_type = ALLOC |
Definition at line 38 of file BitBuffer.h.
zserio::BasicBitBuffer< ALLOC >::BasicBitBuffer |
Empty constructor.
allocator | Allocator to use for internal vector allocation. |
Definition at line 218 of file BitBuffer.h.
|
explicit |
Constructor from given allocator.
allocator | Allocator to use for internal vector allocation. |
Definition at line 224 of file BitBuffer.h.
|
explicit |
Constructor from bit size.
bitSize | Size in bits of created bit buffer. |
allocator | Allocator to use for internal vector allocation. |
Definition at line 230 of file BitBuffer.h.
|
explicit |
Constructor from span.
buffer | Span of bytes from which the bit buffer should be created. |
allocator | Allocator to use for internal vector allocation. |
Definition at line 236 of file BitBuffer.h.
|
explicit |
Constructor from span and bit size.
buffer | Span of bytes from which the bit buffer should be created. |
bitSize | Number of bits stored in buffer to use. |
allocator | Allocator to use for internal vector allocation. |
CppRuntimeException | If given bit size is out of range for given Span. |
Definition at line 242 of file BitBuffer.h.
|
explicit |
Constructor from moved STL vector.
buffer | STL vector of bytes from which the bit buffer should be created. |
Definition at line 255 of file BitBuffer.h.
|
explicit |
Constructor from moved STL vector and bit size.
buffer | STL vector of bytes from which the bit buffer should be created. |
bitSize | Number of bits stored in buffer to use. |
CppRuntimeException | If given bit size is out of range for given vector. |
Definition at line 261 of file BitBuffer.h.
|
explicit |
Constructor from raw pointer.
buffer | Raw pointer to all bytes from which the bit buffer should be created. |
bitSize | Number of bits stored in buffer to use. |
allocator | Allocator to use for internal vector allocation. |
Definition at line 274 of file BitBuffer.h.
|
default |
Method generated by default.
|
default |
Method generated by default.
|
inline |
Method generated by default.
Definition at line 280 of file BitBuffer.h.
|
default |
Method generated by default.
|
inline |
Method generated by default.
Definition at line 286 of file BitBuffer.h.
|
inline |
Get copy of the allocator used for dynamic memory allocations.
Definition at line 45 of file BitBuffer.h.
size_t zserio::BasicBitBuffer< ALLOC >::getBitSize |
Gets the number of bits stored in the bit buffer.
Definition at line 403 of file BitBuffer.h.
uint8_t * zserio::BasicBitBuffer< ALLOC >::getBuffer |
Gets the underlying buffer.
Definition at line 397 of file BitBuffer.h.
const uint8_t * zserio::BasicBitBuffer< ALLOC >::getBuffer |
Gets the underlying buffer.
Definition at line 391 of file BitBuffer.h.
const vector< uint8_t, ALLOC > & zserio::BasicBitBuffer< ALLOC >::getBytes |
Convenience getter for the underlying buffer.
Definition at line 415 of file BitBuffer.h.
size_t zserio::BasicBitBuffer< ALLOC >::getByteSize |
Gets the number of bytes stored in the bit buffer.
Not all bits of the last byte must be used. Unused bits of the last byte are set to zero.
Definition at line 409 of file BitBuffer.h.
Span< uint8_t > zserio::BasicBitBuffer< ALLOC >::getData |
Convenience getter for the underlying buffer.
Definition at line 427 of file BitBuffer.h.
Span< const uint8_t > zserio::BasicBitBuffer< ALLOC >::getData |
Convenience getter for the underlying buffer.
Definition at line 421 of file BitBuffer.h.
uint32_t zserio::BasicBitBuffer< ALLOC >::hashCode |
Calculates hash code of the bit buffer.
Definition at line 370 of file BitBuffer.h.
bool zserio::BasicBitBuffer< ALLOC >::operator< | ( | const BasicBitBuffer< ALLOC > & | other | ) | const |
Operator less than.
other | The another instance of bit buffer to which compare this bit buffer. |
Definition at line 323 of file BitBuffer.h.
|
default |
Method generated by default.
|
default |
Method generated by default.
bool zserio::BasicBitBuffer< ALLOC >::operator== | ( | const BasicBitBuffer< ALLOC > & | other | ) | const |
Equal operator.
other | The another instance of bit buffer to which compare this bit buffer. |
Definition at line 292 of file BitBuffer.h.