31#ifndef ETL_PACKET_INCLUDED
32#define ETL_PACKET_INCLUDED
35#include "static_assert.h"
53 template <
typename TBase,
size_t SIZE,
size_t ALIGNMENT>
70 ETL_STATIC_ASSERT(
sizeof(type) <= SIZE,
"Unsupported size");
83 ETL_STATIC_ASSERT(
sizeof(
T) <= SIZE,
"Unsupported size");
86 ::new (
static_cast<T*
>(data))
T(value);
103 template <
typename T>
109 ETL_STATIC_ASSERT(
sizeof(type) <= SIZE,
"Unsupported size");
122 template <
typename T>
126 ETL_STATIC_ASSERT(
sizeof(
T) <= SIZE,
"Unsupported size");
130 ::new (
static_cast<T*
>(data))
T(value);
141 return *
static_cast<TBase*
>(data);
149 return *
static_cast<const TBase*
>(data);
TBase & get()
Get access to the contained object.
Definition packet.h:139
~packet()
Destructor.
Definition packet.h:93
packet & operator=(const T &value)
Definition packet.h:123
packet(const T &value)
Constructor that static asserts any types that do not conform to the max size and alignment.
Definition packet.h:80
const TBase & get() const
Get access to the contained object.
Definition packet.h:147
add_rvalue_reference
Definition type_traits_generator.h:1322
is_base_of
Definition type_traits_generator.h:1247
bitset_ext
Definition absolute.h:38
Definition alignment.h:233
pair holds two objects of arbitrary type
Definition utility.h:164