#include <BitStreamWriter.h>
Writer class which allows to write various data to the bit stream.
Definition at line 20 of file BitStreamWriter.h.
◆ BitPosType
◆ BitStreamWriter() [1/7]
| zserio::BitStreamWriter::BitStreamWriter |
( |
uint8_t * |
buffer, |
|
|
size_t |
bufferBitSize, |
|
|
BitsTag |
|
|
) |
| |
|
explicit |
Constructor from externally allocated byte buffer.
- Parameters
-
| buffer | External byte buffer to create from. |
| bufferBitSize | Size of the buffer in bits. |
Definition at line 327 of file BitStreamWriter.cpp.
◆ BitStreamWriter() [2/7]
| zserio::BitStreamWriter::BitStreamWriter |
( |
uint8_t * |
buffer, |
|
|
size_t |
bufferByteSize |
|
) |
| |
|
explicit |
Constructor from externally allocated byte buffer.
- Parameters
-
| buffer | External byte buffer to create from. |
| bufferByteSize | Size of the buffer in bytes. |
Definition at line 333 of file BitStreamWriter.cpp.
◆ BitStreamWriter() [3/7]
| zserio::BitStreamWriter::BitStreamWriter |
( |
Span< uint8_t > |
buffer | ) |
|
|
explicit |
Constructor from externally allocated byte buffer.
- Parameters
-
| buffer | External buffer to create from as a Span. |
Definition at line 337 of file BitStreamWriter.cpp.
◆ BitStreamWriter() [4/7]
| zserio::BitStreamWriter::BitStreamWriter |
( |
Span< uint8_t > |
buffer, |
|
|
size_t |
bufferBitSize |
|
) |
| |
|
explicit |
Constructor from externally allocated byte buffer with exact bit size.
- Parameters
-
| buffer | External buffer to create from as a Span. |
| bufferBitSize | Size of the buffer in bits. |
Definition at line 343 of file BitStreamWriter.cpp.
◆ BitStreamWriter() [5/7]
template<typename ALLOC >
| zserio::BitStreamWriter::BitStreamWriter |
( |
BasicBitBuffer< ALLOC > & |
bitBuffer | ) |
|
|
inlineexplicit |
Constructor from externally allocated bit buffer.
- Parameters
-
| bitBuffer | External bit buffer to create from. |
Definition at line 70 of file BitStreamWriter.h.
◆ ~BitStreamWriter()
| zserio::BitStreamWriter::~BitStreamWriter |
( |
| ) |
|
|
default |
◆ BitStreamWriter() [6/7]
Copying and moving is disallowed!
◆ BitStreamWriter() [7/7]
Copying and moving is disallowed!
◆ alignTo()
| void zserio::BitStreamWriter::alignTo |
( |
size_t |
alignment | ) |
|
Moves current bit position to perform the requested bit alignment.
- Parameters
-
| alignment | Size of the alignment in bits. |
Definition at line 536 of file BitStreamWriter.cpp.
◆ getBitPosition()
| BitPosType zserio::BitStreamWriter::getBitPosition |
( |
| ) |
const |
|
inline |
Gets current bit position.
- Returns
- Current bit position.
Definition at line 275 of file BitStreamWriter.h.
◆ getBuffer()
| Span< const uint8_t > zserio::BitStreamWriter::getBuffer |
( |
| ) |
const |
◆ getBufferBitSize()
| size_t zserio::BitStreamWriter::getBufferBitSize |
( |
| ) |
const |
|
inline |
Gets size of the underlying buffer in bits.
- Returns
- Buffer bit size.
Definition at line 323 of file BitStreamWriter.h.
◆ getWriteBuffer()
| const uint8_t * zserio::BitStreamWriter::getWriteBuffer |
( |
| ) |
const |
Gets the write buffer.
- Returns
- Pointer to the beginning of write buffer.
Definition at line 546 of file BitStreamWriter.cpp.
◆ hasWriteBuffer()
| bool zserio::BitStreamWriter::hasWriteBuffer |
( |
| ) |
const |
|
inline |
Gets whether the writer has assigned a write buffer.
- Returns
- True when a buffer is assigned. False otherwise.
Definition at line 299 of file BitStreamWriter.h.
◆ operator=() [1/2]
Copying and moving is disallowed!
◆ operator=() [2/2]
Copying and moving is disallowed!
◆ setBitPosition()
| void zserio::BitStreamWriter::setBitPosition |
( |
BitPosType |
position | ) |
|
Sets current bit position. Use with caution!
- Parameters
-
| position | New bit position. |
Definition at line 526 of file BitStreamWriter.cpp.
◆ writeBitBuffer()
template<typename ALLOC >
| void zserio::BitStreamWriter::writeBitBuffer |
( |
const BasicBitBuffer< ALLOC > & |
bitBuffer | ) |
|
|
inline |
Writes bit buffer.
- Parameters
-
| bitBuffer | Bit buffer to write. |
Definition at line 235 of file BitStreamWriter.h.
◆ writeBits()
| void zserio::BitStreamWriter::writeBits |
( |
uint32_t |
data, |
|
|
uint8_t |
numBits = 32 |
|
) |
| |
Writes unsigned bits up to 32 bits.
- Parameters
-
| data | Data to write. |
| numBits | Number of bits to write. |
Definition at line 355 of file BitStreamWriter.cpp.
◆ writeBits64()
| void zserio::BitStreamWriter::writeBits64 |
( |
uint64_t |
data, |
|
|
uint8_t |
numBits = 64 |
|
) |
| |
Writes unsigned bits up to 64 bits.
- Parameters
-
| data | Data to write. |
| numBits | Number of bits to write. |
Definition at line 366 of file BitStreamWriter.cpp.
◆ writeBool()
| void zserio::BitStreamWriter::writeBool |
( |
bool |
data | ) |
|
◆ writeBytes()
| void zserio::BitStreamWriter::writeBytes |
( |
Span< const uint8_t > |
data | ) |
|
◆ writeFloat16()
| void zserio::BitStreamWriter::writeFloat16 |
( |
float |
data | ) |
|
◆ writeFloat32()
| void zserio::BitStreamWriter::writeFloat32 |
( |
float |
data | ) |
|
◆ writeFloat64()
| void zserio::BitStreamWriter::writeFloat64 |
( |
double |
data | ) |
|
◆ writeSignedBits()
| void zserio::BitStreamWriter::writeSignedBits |
( |
int32_t |
data, |
|
|
uint8_t |
numBits = 32 |
|
) |
| |
Writes signed bits up to 32 bits.
- Parameters
-
| data | Data to write. |
| numBits | Number of bits to write. |
Definition at line 377 of file BitStreamWriter.cpp.
◆ writeSignedBits64()
| void zserio::BitStreamWriter::writeSignedBits64 |
( |
int64_t |
data, |
|
|
uint8_t |
numBits = 64 |
|
) |
| |
Writes signed bits up to 64 bits.
- Parameters
-
| data | Data to write. |
| numBits | Number of bits to write. |
Definition at line 389 of file BitStreamWriter.cpp.
◆ writeString()
| void zserio::BitStreamWriter::writeString |
( |
StringView |
data | ) |
|
◆ writeVarInt()
| void zserio::BitStreamWriter::writeVarInt |
( |
int64_t |
data | ) |
|
◆ writeVarInt16()
| void zserio::BitStreamWriter::writeVarInt16 |
( |
int16_t |
data | ) |
|
◆ writeVarInt32()
| void zserio::BitStreamWriter::writeVarInt32 |
( |
int32_t |
data | ) |
|
◆ writeVarInt64()
| void zserio::BitStreamWriter::writeVarInt64 |
( |
int64_t |
data | ) |
|
◆ writeVarSize()
| void zserio::BitStreamWriter::writeVarSize |
( |
uint32_t |
data | ) |
|
◆ writeVarUInt()
| void zserio::BitStreamWriter::writeVarUInt |
( |
uint64_t |
data | ) |
|
◆ writeVarUInt16()
| void zserio::BitStreamWriter::writeVarUInt16 |
( |
uint16_t |
data | ) |
|
Writes unsigned variable integer up to 16 bits.
- Parameters
-
Definition at line 426 of file BitStreamWriter.cpp.
◆ writeVarUInt32()
| void zserio::BitStreamWriter::writeVarUInt32 |
( |
uint32_t |
data | ) |
|
Writes unsigned variable integer up to 32 bits.
- Parameters
-
Definition at line 421 of file BitStreamWriter.cpp.
◆ writeVarUInt64()
| void zserio::BitStreamWriter::writeVarUInt64 |
( |
uint64_t |
data | ) |
|
Writes unsigned variable integer up to 64 bits.
- Parameters
-
Definition at line 416 of file BitStreamWriter.cpp.
The documentation for this class was generated from the following files: