Zserio C++17 runtime library
0.5.0
Built for Zserio 2.17.0
|
#include <BitBuffer.h>
Public Types | |
using | allocator_type = ALLOC |
Public Member Functions | |
ALLOC | get_allocator () const |
BasicBitBuffer () | |
BasicBitBuffer (const ALLOC &allocator) | |
BasicBitBuffer (size_t bitSize, const ALLOC &allocator={}) | |
BasicBitBuffer (Span< const uint8_t > buffer, const ALLOC &allocator={}) | |
BasicBitBuffer (Span< const uint8_t > buffer, size_t bitSize, const ALLOC &allocator={}) | |
BasicBitBuffer (std::vector< uint8_t, ALLOC > &&buffer) | |
BasicBitBuffer (std::vector< uint8_t, ALLOC > &&buffer, size_t bitSize) | |
BasicBitBuffer (const BasicBitBuffer &other, const ALLOC &allocator) | |
BasicBitBuffer (BasicBitBuffer &&other, const ALLOC &allocator) | |
bool | operator== (const BasicBitBuffer &other) const |
bool | operator!= (const BasicBitBuffer &other) const |
bool | operator< (const BasicBitBuffer &other) const |
bool | operator> (const BasicBitBuffer &other) const |
bool | operator<= (const BasicBitBuffer &other) const |
bool | operator>= (const BasicBitBuffer &other) const |
uint32_t | hashCode () const |
const uint8_t * | getBuffer () const |
uint8_t * | getBuffer () |
size_t | getBitSize () const |
size_t | getByteSize () const |
const std::vector< uint8_t, ALLOC > & | getBytes () const |
Span< const uint8_t > | getData () const |
Span< uint8_t > | getData () |
~BasicBitBuffer ()=default | |
BasicBitBuffer (const BasicBitBuffer &)=default | |
BasicBitBuffer & | operator= (const BasicBitBuffer &)=default |
BasicBitBuffer (BasicBitBuffer &&)=default | |
BasicBitBuffer & | operator= (BasicBitBuffer &&)=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 35 of file BitBuffer.h.
using zserio::BasicBitBuffer< ALLOC >::allocator_type = ALLOC |
Definition at line 41 of file BitBuffer.h.
zserio::BasicBitBuffer< ALLOC >::BasicBitBuffer |
Empty constructor.
allocator | Allocator to use for internal vector allocation. |
Definition at line 268 of file BitBuffer.h.
|
explicit |
Constructor from given allocator.
allocator | Allocator to use for internal vector allocation. |
Definition at line 274 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 280 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 286 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 292 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 305 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 311 of file BitBuffer.h.
|
inline |
Allocator aware copy constructor.
Definition at line 324 of file BitBuffer.h.
|
inline |
Allocator aware move constructor.
Definition at line 330 of file BitBuffer.h.
|
default |
Method generated by default.
|
default |
Method generated by default.
|
default |
Method generated by default.
|
inline |
Get copy of the allocator used for dynamic memory allocations.
Definition at line 48 of file BitBuffer.h.
size_t zserio::BasicBitBuffer< ALLOC >::getBitSize |
Gets the number of bits stored in the bit buffer.
Definition at line 447 of file BitBuffer.h.
uint8_t * zserio::BasicBitBuffer< ALLOC >::getBuffer |
Gets the underlying buffer.
Definition at line 441 of file BitBuffer.h.
const uint8_t * zserio::BasicBitBuffer< ALLOC >::getBuffer |
Gets the underlying buffer.
Definition at line 435 of file BitBuffer.h.
const std::vector< uint8_t, ALLOC > & zserio::BasicBitBuffer< ALLOC >::getBytes |
Convenience getter for the underlying buffer.
Definition at line 459 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 453 of file BitBuffer.h.
Span< uint8_t > zserio::BasicBitBuffer< ALLOC >::getData |
Convenience getter for the underlying buffer.
Definition at line 471 of file BitBuffer.h.
Span< const uint8_t > zserio::BasicBitBuffer< ALLOC >::getData |
Convenience getter for the underlying buffer.
Definition at line 465 of file BitBuffer.h.
uint32_t zserio::BasicBitBuffer< ALLOC >::hashCode |
Calculates hash code of the bit buffer.
Definition at line 414 of file BitBuffer.h.
|
inline |
Non-equal operator.
other | The another instance of bit buffer to which compare this bit buffer. |
Definition at line 152 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 367 of file BitBuffer.h.
|
inline |
Operator less than or equal.
other | The another instance of bit buffer to which compare this bit buffer. |
Definition at line 185 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 336 of file BitBuffer.h.
|
inline |
Operator greater than.
other | The another instance of bit buffer to which compare this bit buffer. |
Definition at line 173 of file BitBuffer.h.
|
inline |
Operator greater than or equal.
other | The another instance of bit buffer to which compare this bit buffer. |
Definition at line 197 of file BitBuffer.h.