BitStream
bitstream::fixed_policy Struct Reference

#include <stream_traits.h>

Public Member Functions

 fixed_policy (void *buffer, uint32_t num_bits) noexcept
 Construct a stream pointing to the given byte array with num_bytes size. More...
 
template<size_t Size>
 fixed_policy (byte_buffer< Size > &buffer, uint32_t num_bits) noexcept
 Construct a stream pointing to the given buffer. More...
 
template<size_t Size>
 fixed_policy (byte_buffer< Size > &buffer) noexcept
 Construct a stream pointing to the given buffer. More...
 
uint32_t * get_buffer () const noexcept
 
uint32_t get_num_bits_serialized () const noexcept
 
bool can_serialize_bits (uint32_t num_bits) const noexcept
 
uint32_t get_total_bits () const noexcept
 
bool extend (uint32_t num_bits)
 

Public Attributes

uint32_t * m_Buffer
 
uint32_t m_NumBitsSerialized
 
uint32_t m_TotalBits
 

Constructor & Destructor Documentation

◆ fixed_policy() [1/3]

bitstream::fixed_policy::fixed_policy ( void *  buffer,
uint32_t  num_bits 
)
inlinenoexcept

Construct a stream pointing to the given byte array with num_bytes size.

Parameters
bytesThe byte array to serialize to/from. Must be 4-byte aligned and the size must be a multiple of 4
num_bytesThe number of bytes in the array

◆ fixed_policy() [2/3]

template<size_t Size>
bitstream::fixed_policy::fixed_policy ( byte_buffer< Size > &  buffer,
uint32_t  num_bits 
)
inlinenoexcept

Construct a stream pointing to the given buffer.

Parameters
bufferThe buffer to serialize to/from
num_bitsThe maximum number of bits that we can read

◆ fixed_policy() [3/3]

template<size_t Size>
bitstream::fixed_policy::fixed_policy ( byte_buffer< Size > &  buffer)
inlinenoexcept

Construct a stream pointing to the given buffer.

Parameters
bufferThe buffer to serialize to/from

Member Function Documentation

◆ can_serialize_bits()

bool bitstream::fixed_policy::can_serialize_bits ( uint32_t  num_bits) const
inlinenoexcept

◆ extend()

bool bitstream::fixed_policy::extend ( uint32_t  num_bits)
inline

◆ get_buffer()

uint32_t* bitstream::fixed_policy::get_buffer ( ) const
inlinenoexcept

◆ get_num_bits_serialized()

uint32_t bitstream::fixed_policy::get_num_bits_serialized ( ) const
inlinenoexcept

◆ get_total_bits()

uint32_t bitstream::fixed_policy::get_total_bits ( ) const
inlinenoexcept

Member Data Documentation

◆ m_Buffer

uint32_t* bitstream::fixed_policy::m_Buffer

◆ m_NumBitsSerialized

uint32_t bitstream::fixed_policy::m_NumBitsSerialized

◆ m_TotalBits

uint32_t bitstream::fixed_policy::m_TotalBits

The documentation for this struct was generated from the following file: