ESPHome  2024.11.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
esphome::bytebuffer::ByteBuffer Class Reference

A class modelled on the Java ByteBuffer class. More...

#include <bytebuffer.h>

Public Member Functions

 ByteBuffer ()
 
 ByteBuffer (size_t capacity, Endian endianness=LITTLE)
 Create a new Bytebuffer with the given capacity. More...
 
template<typename T >
get (typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)<=sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
get (size_t offset, typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)<=sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)<=sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, size_t offset, typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)<=sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
get (typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
get (size_t offset, typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, size_t offset, typename std::enable_if< std::is_integral< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
get (typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
get (typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
get (size_t offset, typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
get (size_t offset, typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)<=sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, size_t offset, typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)<=sizeof(uint32_t)), T >::type *=0)
 
template<typename T >
void put (const T &value, size_t offset, typename std::enable_if< std::is_floating_point< T >::value, T >::type *=0, typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type *=0)
 
void put_float (float value)
 
void put_double (double value)
 
uint8_t get_uint8 ()
 
uint16_t get_uint16 ()
 
uint32_t get_uint24 ()
 
uint32_t get_uint32 ()
 
uint64_t get_uint64 ()
 
uint8_t get_int8 ()
 
int16_t get_int16 ()
 
int32_t get_int32 ()
 
int64_t get_int64 ()
 
float get_float ()
 
double get_double ()
 
bool get_bool ()
 
uint32_t get_int24 (size_t offset)
 
uint32_t get_int24 ()
 
std::vector< uint8_t > get_vector (size_t length, size_t offset)
 
std::vector< uint8_t > get_vector (size_t length)
 
void put_uint8 (uint8_t value)
 
void put_uint16 (uint16_t value)
 
void put_uint24 (uint32_t value)
 
void put_uint32 (uint32_t value)
 
void put_uint64 (uint64_t value)
 
void put_int8 (int8_t value)
 
void put_int16 (int16_t value)
 
void put_int24 (int32_t value)
 
void put_int32 (int32_t value)
 
void put_int64 (int64_t value)
 
void put_bool (bool value)
 
uint64_t get_uint64 (size_t offset)
 
uint32_t get_uint24 (size_t offset)
 
double get_double (size_t offset)
 
uint8_t get_uint8 (size_t offset)
 
uint16_t get_uint16 (size_t offset)
 
uint32_t get_uint32 (size_t offset)
 
uint8_t get_int8 (size_t offset)
 
int16_t get_int16 (size_t offset)
 
int32_t get_int32 (size_t offset)
 
int64_t get_int64 (size_t offset)
 
float get_float (size_t offset)
 
bool get_bool (size_t offset)
 
void put_uint8 (uint8_t value, size_t offset)
 
void put_uint16 (uint16_t value, size_t offset)
 
void put_uint24 (uint32_t value, size_t offset)
 
void put_uint32 (uint32_t value, size_t offset)
 
void put_uint64 (uint64_t value, size_t offset)
 
void put_int8 (int8_t value, size_t offset)
 
void put_int16 (int16_t value, size_t offset)
 
void put_int24 (int32_t value, size_t offset)
 
void put_int32 (int32_t value, size_t offset)
 
void put_int64 (int64_t value, size_t offset)
 
void put_float (float value, size_t offset)
 
void put_double (double value, size_t offset)
 
void put_bool (bool value, size_t offset)
 
void put (const std::vector< uint8_t > &value, size_t offset)
 
void put_vector (const std::vector< uint8_t > &value, size_t offset)
 
void put (const std::vector< uint8_t > &value)
 
void put_vector (const std::vector< uint8_t > &value)
 
size_t get_capacity () const
 
size_t get_position () const
 
size_t get_limit () const
 
size_t get_remaining () const
 
Endian get_endianness () const
 
void mark ()
 
void big_endian ()
 
void little_endian ()
 
std::vector< uint8_t > get_data ()
 
void get_bytes (void *dest, size_t length)
 
void get_bytes (void *dest, size_t length, size_t offset)
 
void rewind ()
 
void reset ()
 
void set_limit (size_t limit)
 
void set_position (size_t position)
 
void clear ()
 
void flip ()
 

Static Public Member Functions

template<typename T >
static ByteBuffer wrap (T value, Endian endianness=LITTLE)
 
static ByteBuffer wrap (std::vector< uint8_t > const &data, Endian endianness=LITTLE)
 
static ByteBuffer wrap (const uint8_t *ptr, size_t len, Endian endianness=LITTLE)
 

Protected Member Functions

uint64_t get_uint64_ (size_t offset, size_t length) const
 
uint64_t get_uint64_ (size_t length)
 
uint32_t get_uint32_ (size_t offset, size_t length) const
 
uint32_t get_uint32_ (size_t length)
 
void put_uint64_ (uint64_t value, size_t length)
 Putters. More...
 
void put_uint32_ (uint32_t value, size_t length)
 
void put_uint64_ (uint64_t value, size_t offset, size_t length)
 
void put_uint32_ (uint32_t value, size_t offset, size_t length)
 
 ByteBuffer (std::vector< uint8_t > const &data)
 

Protected Attributes

std::vector< uint8_t > data_
 
Endian endianness_ {LITTLE}
 
size_t position_ {0}
 
size_t mark_ {0}
 
size_t limit_ {0}
 

Detailed Description

A class modelled on the Java ByteBuffer class.

It wraps a vector of bytes and permits putting and getting items of various sizes, with an automatically incremented position.

There are three variables maintained pointing into the buffer:

capacity: the maximum amount of data that can be stored - set on construction and cannot be changed limit: the limit of the data currently available to get or put position: the current insert or extract position

0 <= position <= limit <= capacity

In addition a mark can be set to the current position with mark(). A subsequent call to reset() will restore the position to the mark.

The buffer can be marked to be little-endian (default) or big-endian. All subsequent operations will use that order.

The flip() operation will reset the position to 0 and limit to the current position. This is useful for reading data from a buffer after it has been written.

The code is defined here in the header file rather than in a .cpp file, so that it does not get compiled if not used. The templated functions ensure that only those typed functions actually used are compiled. The functions are implicitly inline-able which will aid performance.

Definition at line 38 of file bytebuffer.h.

Constructor & Destructor Documentation

◆ ByteBuffer() [1/3]

esphome::bytebuffer::ByteBuffer::ByteBuffer ( )
inline

Definition at line 42 of file bytebuffer.h.

◆ ByteBuffer() [2/3]

esphome::bytebuffer::ByteBuffer::ByteBuffer ( size_t  capacity,
Endian  endianness = LITTLE 
)
inline

Create a new Bytebuffer with the given capacity.

Definition at line 47 of file bytebuffer.h.

◆ ByteBuffer() [3/3]

esphome::bytebuffer::ByteBuffer::ByteBuffer ( std::vector< uint8_t > const &  data)
inlineprotected

Definition at line 411 of file bytebuffer.h.

Member Function Documentation

◆ big_endian()

void esphome::bytebuffer::ByteBuffer::big_endian ( )
inline

Definition at line 297 of file bytebuffer.h.

◆ clear()

void esphome::bytebuffer::ByteBuffer::clear ( )
inline

Definition at line 316 of file bytebuffer.h.

◆ flip()

void esphome::bytebuffer::ByteBuffer::flip ( )
inline

Definition at line 320 of file bytebuffer.h.

◆ get() [1/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( typename std::enable_if< std::is_integral< T >::value, T >::type = 0)
inline

Definition at line 59 of file bytebuffer.h.

◆ get() [2/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( size_t  offset,
typename std::enable_if< std::is_integral< T >::value, T >::type = 0 
)
inline

Definition at line 66 of file bytebuffer.h.

◆ get() [3/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( typename std::enable_if< std::is_integral< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 85 of file bytebuffer.h.

◆ get() [4/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( size_t  offset,
typename std::enable_if< std::is_integral< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 91 of file bytebuffer.h.

◆ get() [5/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint32_t)), T >::type = 0 
)
inline

Definition at line 110 of file bytebuffer.h.

◆ get() [6/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 116 of file bytebuffer.h.

◆ get() [7/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( size_t  offset,
typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint32_t)), T >::type = 0 
)
inline

Definition at line 122 of file bytebuffer.h.

◆ get() [8/8]

template<typename T >
T esphome::bytebuffer::ByteBuffer::get ( size_t  offset,
typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 128 of file bytebuffer.h.

◆ get_bool() [1/2]

bool esphome::bytebuffer::ByteBuffer::get_bool ( )
inline

Definition at line 197 of file bytebuffer.h.

◆ get_bool() [2/2]

bool esphome::bytebuffer::ByteBuffer::get_bool ( size_t  offset)
inline

Definition at line 262 of file bytebuffer.h.

◆ get_bytes() [1/2]

void esphome::bytebuffer::ByteBuffer::get_bytes ( void *  dest,
size_t  length 
)
inline

Definition at line 302 of file bytebuffer.h.

◆ get_bytes() [2/2]

void esphome::bytebuffer::ByteBuffer::get_bytes ( void *  dest,
size_t  length,
size_t  offset 
)
inline

Definition at line 307 of file bytebuffer.h.

◆ get_capacity()

size_t esphome::bytebuffer::ByteBuffer::get_capacity ( ) const
inline

Definition at line 291 of file bytebuffer.h.

◆ get_data()

std::vector<uint8_t> esphome::bytebuffer::ByteBuffer::get_data ( )
inline

Definition at line 300 of file bytebuffer.h.

◆ get_double() [1/2]

double esphome::bytebuffer::ByteBuffer::get_double ( )
inline

Definition at line 194 of file bytebuffer.h.

◆ get_double() [2/2]

double esphome::bytebuffer::ByteBuffer::get_double ( size_t  offset)
inline

Definition at line 244 of file bytebuffer.h.

◆ get_endianness()

Endian esphome::bytebuffer::ByteBuffer::get_endianness ( ) const
inline

Definition at line 295 of file bytebuffer.h.

◆ get_float() [1/2]

float esphome::bytebuffer::ByteBuffer::get_float ( )
inline

Definition at line 192 of file bytebuffer.h.

◆ get_float() [2/2]

float esphome::bytebuffer::ByteBuffer::get_float ( size_t  offset)
inline

Definition at line 258 of file bytebuffer.h.

◆ get_int16() [1/2]

int16_t esphome::bytebuffer::ByteBuffer::get_int16 ( )
inline

Definition at line 188 of file bytebuffer.h.

◆ get_int16() [2/2]

int16_t esphome::bytebuffer::ByteBuffer::get_int16 ( size_t  offset)
inline

Definition at line 254 of file bytebuffer.h.

◆ get_int24() [1/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_int24 ( size_t  offset)
inline

Definition at line 199 of file bytebuffer.h.

◆ get_int24() [2/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_int24 ( )
inline

Definition at line 207 of file bytebuffer.h.

◆ get_int32() [1/2]

int32_t esphome::bytebuffer::ByteBuffer::get_int32 ( )
inline

Definition at line 189 of file bytebuffer.h.

◆ get_int32() [2/2]

int32_t esphome::bytebuffer::ByteBuffer::get_int32 ( size_t  offset)
inline

Definition at line 255 of file bytebuffer.h.

◆ get_int64() [1/2]

int64_t esphome::bytebuffer::ByteBuffer::get_int64 ( )
inline

Definition at line 190 of file bytebuffer.h.

◆ get_int64() [2/2]

int64_t esphome::bytebuffer::ByteBuffer::get_int64 ( size_t  offset)
inline

Definition at line 256 of file bytebuffer.h.

◆ get_int8() [1/2]

uint8_t esphome::bytebuffer::ByteBuffer::get_int8 ( )
inline

Definition at line 187 of file bytebuffer.h.

◆ get_int8() [2/2]

uint8_t esphome::bytebuffer::ByteBuffer::get_int8 ( size_t  offset)
inline

Definition at line 253 of file bytebuffer.h.

◆ get_limit()

size_t esphome::bytebuffer::ByteBuffer::get_limit ( ) const
inline

Definition at line 293 of file bytebuffer.h.

◆ get_position()

size_t esphome::bytebuffer::ByteBuffer::get_position ( ) const
inline

Definition at line 292 of file bytebuffer.h.

◆ get_remaining()

size_t esphome::bytebuffer::ByteBuffer::get_remaining ( ) const
inline

Definition at line 294 of file bytebuffer.h.

◆ get_uint16() [1/2]

uint16_t esphome::bytebuffer::ByteBuffer::get_uint16 ( )
inline

Definition at line 179 of file bytebuffer.h.

◆ get_uint16() [2/2]

uint16_t esphome::bytebuffer::ByteBuffer::get_uint16 ( size_t  offset)
inline

Definition at line 249 of file bytebuffer.h.

◆ get_uint24() [1/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_uint24 ( )
inline

Definition at line 181 of file bytebuffer.h.

◆ get_uint24() [2/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_uint24 ( size_t  offset)
inline

Definition at line 243 of file bytebuffer.h.

◆ get_uint32() [1/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_uint32 ( )
inline

Definition at line 183 of file bytebuffer.h.

◆ get_uint32() [2/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_uint32 ( size_t  offset)
inline

Definition at line 251 of file bytebuffer.h.

◆ get_uint32_() [1/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_uint32_ ( size_t  offset,
size_t  length 
) const
inlineprotected

Definition at line 348 of file bytebuffer.h.

◆ get_uint32_() [2/2]

uint32_t esphome::bytebuffer::ByteBuffer::get_uint32_ ( size_t  length)
inlineprotected

Definition at line 365 of file bytebuffer.h.

◆ get_uint64() [1/2]

uint64_t esphome::bytebuffer::ByteBuffer::get_uint64 ( )
inline

Definition at line 185 of file bytebuffer.h.

◆ get_uint64() [2/2]

uint64_t esphome::bytebuffer::ByteBuffer::get_uint64 ( size_t  offset)
inline

Definition at line 242 of file bytebuffer.h.

◆ get_uint64_() [1/2]

uint64_t esphome::bytebuffer::ByteBuffer::get_uint64_ ( size_t  offset,
size_t  length 
) const
inlineprotected

Definition at line 326 of file bytebuffer.h.

◆ get_uint64_() [2/2]

uint64_t esphome::bytebuffer::ByteBuffer::get_uint64_ ( size_t  length)
inlineprotected

Definition at line 343 of file bytebuffer.h.

◆ get_uint8() [1/2]

uint8_t esphome::bytebuffer::ByteBuffer::get_uint8 ( )
inline

Definition at line 177 of file bytebuffer.h.

◆ get_uint8() [2/2]

uint8_t esphome::bytebuffer::ByteBuffer::get_uint8 ( size_t  offset)
inline

Definition at line 247 of file bytebuffer.h.

◆ get_vector() [1/2]

std::vector<uint8_t> esphome::bytebuffer::ByteBuffer::get_vector ( size_t  length,
size_t  offset 
)
inline

Definition at line 214 of file bytebuffer.h.

◆ get_vector() [2/2]

std::vector<uint8_t> esphome::bytebuffer::ByteBuffer::get_vector ( size_t  length)
inline

Definition at line 219 of file bytebuffer.h.

◆ little_endian()

void esphome::bytebuffer::ByteBuffer::little_endian ( )
inline

Definition at line 298 of file bytebuffer.h.

◆ mark()

void esphome::bytebuffer::ByteBuffer::mark ( )
inline

Definition at line 296 of file bytebuffer.h.

◆ put() [1/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
typename std::enable_if< std::is_integral< T >::value, T >::type = 0 
)
inline

Definition at line 72 of file bytebuffer.h.

◆ put() [2/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
size_t  offset,
typename std::enable_if< std::is_integral< T >::value, T >::type = 0 
)
inline

Definition at line 78 of file bytebuffer.h.

◆ put() [3/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
typename std::enable_if< std::is_integral< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 97 of file bytebuffer.h.

◆ put() [4/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
size_t  offset,
typename std::enable_if< std::is_integral< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 103 of file bytebuffer.h.

◆ put() [5/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0 
)
inline

Definition at line 133 of file bytebuffer.h.

◆ put() [6/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 139 of file bytebuffer.h.

◆ put() [7/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
size_t  offset,
typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0 
)
inline

Definition at line 145 of file bytebuffer.h.

◆ put() [8/10]

template<typename T >
void esphome::bytebuffer::ByteBuffer::put ( const T &  value,
size_t  offset,
typename std::enable_if< std::is_floating_point< T >::value, T >::type = 0,
typename std::enable_if<(sizeof(T)==sizeof(uint64_t)), T >::type = 0 
)
inline

Definition at line 151 of file bytebuffer.h.

◆ put() [9/10]

void esphome::bytebuffer::ByteBuffer::put ( const std::vector< uint8_t > &  value,
size_t  offset 
)
inline

Definition at line 279 of file bytebuffer.h.

◆ put() [10/10]

void esphome::bytebuffer::ByteBuffer::put ( const std::vector< uint8_t > &  value)
inline

Definition at line 283 of file bytebuffer.h.

◆ put_bool() [1/2]

void esphome::bytebuffer::ByteBuffer::put_bool ( bool  value)
inline

Definition at line 238 of file bytebuffer.h.

◆ put_bool() [2/2]

void esphome::bytebuffer::ByteBuffer::put_bool ( bool  value,
size_t  offset 
)
inline

Definition at line 278 of file bytebuffer.h.

◆ put_double() [1/2]

void esphome::bytebuffer::ByteBuffer::put_double ( double  value)
inline

Definition at line 175 of file bytebuffer.h.

◆ put_double() [2/2]

void esphome::bytebuffer::ByteBuffer::put_double ( double  value,
size_t  offset 
)
inline

Definition at line 277 of file bytebuffer.h.

◆ put_float() [1/2]

void esphome::bytebuffer::ByteBuffer::put_float ( float  value)
inline

Definition at line 174 of file bytebuffer.h.

◆ put_float() [2/2]

void esphome::bytebuffer::ByteBuffer::put_float ( float  value,
size_t  offset 
)
inline

Definition at line 276 of file bytebuffer.h.

◆ put_int16() [1/2]

void esphome::bytebuffer::ByteBuffer::put_int16 ( int16_t  value)
inline

Definition at line 233 of file bytebuffer.h.

◆ put_int16() [2/2]

void esphome::bytebuffer::ByteBuffer::put_int16 ( int16_t  value,
size_t  offset 
)
inline

Definition at line 271 of file bytebuffer.h.

◆ put_int24() [1/2]

void esphome::bytebuffer::ByteBuffer::put_int24 ( int32_t  value)
inline

Definition at line 234 of file bytebuffer.h.

◆ put_int24() [2/2]

void esphome::bytebuffer::ByteBuffer::put_int24 ( int32_t  value,
size_t  offset 
)
inline

Definition at line 272 of file bytebuffer.h.

◆ put_int32() [1/2]

void esphome::bytebuffer::ByteBuffer::put_int32 ( int32_t  value)
inline

Definition at line 235 of file bytebuffer.h.

◆ put_int32() [2/2]

void esphome::bytebuffer::ByteBuffer::put_int32 ( int32_t  value,
size_t  offset 
)
inline

Definition at line 273 of file bytebuffer.h.

◆ put_int64() [1/2]

void esphome::bytebuffer::ByteBuffer::put_int64 ( int64_t  value)
inline

Definition at line 236 of file bytebuffer.h.

◆ put_int64() [2/2]

void esphome::bytebuffer::ByteBuffer::put_int64 ( int64_t  value,
size_t  offset 
)
inline

Definition at line 274 of file bytebuffer.h.

◆ put_int8() [1/2]

void esphome::bytebuffer::ByteBuffer::put_int8 ( int8_t  value)
inline

Definition at line 232 of file bytebuffer.h.

◆ put_int8() [2/2]

void esphome::bytebuffer::ByteBuffer::put_int8 ( int8_t  value,
size_t  offset 
)
inline

Definition at line 270 of file bytebuffer.h.

◆ put_uint16() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint16 ( uint16_t  value)
inline

Definition at line 227 of file bytebuffer.h.

◆ put_uint16() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint16 ( uint16_t  value,
size_t  offset 
)
inline

Definition at line 265 of file bytebuffer.h.

◆ put_uint24() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint24 ( uint32_t  value)
inline

Definition at line 228 of file bytebuffer.h.

◆ put_uint24() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint24 ( uint32_t  value,
size_t  offset 
)
inline

Definition at line 266 of file bytebuffer.h.

◆ put_uint32() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint32 ( uint32_t  value)
inline

Definition at line 229 of file bytebuffer.h.

◆ put_uint32() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint32 ( uint32_t  value,
size_t  offset 
)
inline

Definition at line 267 of file bytebuffer.h.

◆ put_uint32_() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint32_ ( uint32_t  value,
size_t  length 
)
inlineprotected

Definition at line 377 of file bytebuffer.h.

◆ put_uint32_() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint32_ ( uint32_t  value,
size_t  offset,
size_t  length 
)
inlineprotected

Definition at line 397 of file bytebuffer.h.

◆ put_uint64() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint64 ( uint64_t  value)
inline

Definition at line 230 of file bytebuffer.h.

◆ put_uint64() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint64 ( uint64_t  value,
size_t  offset 
)
inline

Definition at line 268 of file bytebuffer.h.

◆ put_uint64_() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint64_ ( uint64_t  value,
size_t  length 
)
inlineprotected

Putters.

Definition at line 373 of file bytebuffer.h.

◆ put_uint64_() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint64_ ( uint64_t  value,
size_t  offset,
size_t  length 
)
inlineprotected

Definition at line 382 of file bytebuffer.h.

◆ put_uint8() [1/2]

void esphome::bytebuffer::ByteBuffer::put_uint8 ( uint8_t  value)
inline

Definition at line 226 of file bytebuffer.h.

◆ put_uint8() [2/2]

void esphome::bytebuffer::ByteBuffer::put_uint8 ( uint8_t  value,
size_t  offset 
)
inline

Definition at line 264 of file bytebuffer.h.

◆ put_vector() [1/2]

void esphome::bytebuffer::ByteBuffer::put_vector ( const std::vector< uint8_t > &  value,
size_t  offset 
)
inline

Definition at line 282 of file bytebuffer.h.

◆ put_vector() [2/2]

void esphome::bytebuffer::ByteBuffer::put_vector ( const std::vector< uint8_t > &  value)
inline

Definition at line 287 of file bytebuffer.h.

◆ reset()

void esphome::bytebuffer::ByteBuffer::reset ( )
inline

Definition at line 312 of file bytebuffer.h.

◆ rewind()

void esphome::bytebuffer::ByteBuffer::rewind ( )
inline

Definition at line 311 of file bytebuffer.h.

◆ set_limit()

void esphome::bytebuffer::ByteBuffer::set_limit ( size_t  limit)
inline

Definition at line 314 of file bytebuffer.h.

◆ set_position()

void esphome::bytebuffer::ByteBuffer::set_position ( size_t  position)
inline

Definition at line 315 of file bytebuffer.h.

◆ wrap() [1/3]

template<typename T >
static ByteBuffer esphome::bytebuffer::ByteBuffer::wrap ( value,
Endian  endianness = LITTLE 
)
inlinestatic

Definition at line 156 of file bytebuffer.h.

◆ wrap() [2/3]

static ByteBuffer esphome::bytebuffer::ByteBuffer::wrap ( std::vector< uint8_t > const &  data,
Endian  endianness = LITTLE 
)
inlinestatic

Definition at line 163 of file bytebuffer.h.

◆ wrap() [3/3]

static ByteBuffer esphome::bytebuffer::ByteBuffer::wrap ( const uint8_t *  ptr,
size_t  len,
Endian  endianness = LITTLE 
)
inlinestatic

Definition at line 169 of file bytebuffer.h.

Field Documentation

◆ data_

std::vector<uint8_t> esphome::bytebuffer::ByteBuffer::data_
protected

Definition at line 413 of file bytebuffer.h.

◆ endianness_

Endian esphome::bytebuffer::ByteBuffer::endianness_ {LITTLE}
protected

Definition at line 414 of file bytebuffer.h.

◆ limit_

size_t esphome::bytebuffer::ByteBuffer::limit_ {0}
protected

Definition at line 417 of file bytebuffer.h.

◆ mark_

size_t esphome::bytebuffer::ByteBuffer::mark_ {0}
protected

Definition at line 416 of file bytebuffer.h.

◆ position_

size_t esphome::bytebuffer::ByteBuffer::position_ {0}
protected

Definition at line 415 of file bytebuffer.h.


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