#include <BitStreamWriter.h>
Writer class which allows to write various data to the bit stream.
Definition at line 21 of file BitStreamWriter.h.
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 116 of file BitStreamWriter.cpp.
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 122 of file BitStreamWriter.cpp.
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 126 of file BitStreamWriter.cpp.
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 132 of file BitStreamWriter.cpp.
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 71 of file BitStreamWriter.h.
zserio::BitStreamWriter::~BitStreamWriter |
( |
| ) |
|
|
default |
Copying and moving is disallowed!
Copying and moving is disallowed!
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 309 of file BitStreamWriter.cpp.
BitPosType zserio::BitStreamWriter::getBitPosition |
( |
| ) |
const |
|
inline |
Gets current bit position.
- Returns
- Current bit position.
Definition at line 273 of file BitStreamWriter.h.
Span< const uint8_t > zserio::BitStreamWriter::getBuffer |
( |
| ) |
const |
size_t zserio::BitStreamWriter::getBufferBitSize |
( |
| ) |
const |
|
inline |
Gets size of the underlying buffer in bits.
- Returns
- Buffer bit size.
Definition at line 315 of file BitStreamWriter.h.
const uint8_t * zserio::BitStreamWriter::getWriteBuffer |
( |
| ) |
const |
Gets the write buffer.
- Returns
- Pointer to the beginning of write buffer.
Definition at line 319 of file BitStreamWriter.cpp.
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 294 of file BitStreamWriter.h.
Copying and moving is disallowed!
Copying and moving is disallowed!
void zserio::BitStreamWriter::setBitPosition |
( |
BitPosType |
position | ) |
|
Sets current bit position. Use with caution!
- Parameters
-
position | New bit position. |
Definition at line 301 of file BitStreamWriter.cpp.
template<typename ALLOC >
void zserio::BitStreamWriter::writeBitBuffer |
( |
const BasicBitBuffer< ALLOC > & |
bitBuffer | ) |
|
|
inline |
Writes bit buffer.
- Parameters
-
bitBuffer | Bit buffer to write. |
Definition at line 237 of file BitStreamWriter.h.
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 144 of file BitStreamWriter.cpp.
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 155 of file BitStreamWriter.cpp.
void zserio::BitStreamWriter::writeBool |
( |
bool |
data | ) |
|
void zserio::BitStreamWriter::writeBytes |
( |
Span< const uint8_t > |
data | ) |
|
void zserio::BitStreamWriter::writeFloat16 |
( |
float |
data | ) |
|
void zserio::BitStreamWriter::writeFloat32 |
( |
float |
data | ) |
|
void zserio::BitStreamWriter::writeFloat64 |
( |
double |
data | ) |
|
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 166 of file BitStreamWriter.cpp.
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 177 of file BitStreamWriter.cpp.
void zserio::BitStreamWriter::writeString |
( |
StringView |
data | ) |
|
void zserio::BitStreamWriter::writeVarInt |
( |
int64_t |
data | ) |
|
void zserio::BitStreamWriter::writeVarInt16 |
( |
int16_t |
data | ) |
|
void zserio::BitStreamWriter::writeVarInt32 |
( |
int32_t |
data | ) |
|
void zserio::BitStreamWriter::writeVarInt64 |
( |
int64_t |
data | ) |
|
void zserio::BitStreamWriter::writeVarSize |
( |
uint32_t |
data | ) |
|
void zserio::BitStreamWriter::writeVarUInt |
( |
uint64_t |
data | ) |
|
void zserio::BitStreamWriter::writeVarUInt16 |
( |
uint16_t |
data | ) |
|
Writes unsigned variable integer up to 16 bits.
- Parameters
-
Definition at line 213 of file BitStreamWriter.cpp.
void zserio::BitStreamWriter::writeVarUInt32 |
( |
uint32_t |
data | ) |
|
Writes unsigned variable integer up to 32 bits.
- Parameters
-
Definition at line 208 of file BitStreamWriter.cpp.
void zserio::BitStreamWriter::writeVarUInt64 |
( |
uint64_t |
data | ) |
|
Writes unsigned variable integer up to 64 bits.
- Parameters
-
Definition at line 203 of file BitStreamWriter.cpp.
The documentation for this class was generated from the following files: