Embedded Template Library  1.0
alignment

Classes

class  etl::type_with_alignment< ALIGNMENT >
 
struct  etl::aligned_storage< LENGTH, ALIGNMENT >
 
struct  etl::aligned_storage_as< LENGTH, T >
 
class  etl::uninitialized_buffer< OBJECT_SIZE_, N_OBJECTS_, ALIGNMENT_ >
 
class  etl::uninitialized_buffer_of< T, N_OBJECTS_ >
 

Detailed Description

Creates a variable of the specified type at the specified alignment.


Class Documentation

◆ etl::type_with_alignment

class etl::type_with_alignment

template<const size_t ALIGNMENT>
class etl::type_with_alignment< ALIGNMENT >

Gets a type that has the same as the specified alignment.

Public Types

typedef private_alignment::type_with_alignment_helper< ALIGNMENT, int_least8_t, int_least16_t, int32_t, int64_t, float, double, void * >::type type
 

◆ etl::aligned_storage

struct etl::aligned_storage

template<const size_t LENGTH, const size_t ALIGNMENT>
struct etl::aligned_storage< LENGTH, ALIGNMENT >

Aligned storage LENGTH should be determined in terms of sizeof()

◆ etl::aligned_storage_as

struct etl::aligned_storage_as

template<size_t LENGTH, typename T>
struct etl::aligned_storage_as< LENGTH, T >

Aligned storage as

◆ etl::uninitialized_buffer

class etl::uninitialized_buffer

template<size_t OBJECT_SIZE_, size_t N_OBJECTS_, size_t ALIGNMENT_>
class etl::uninitialized_buffer< OBJECT_SIZE_, N_OBJECTS_, ALIGNMENT_ >

Declares an aligned buffer of N_OBJECTS x of size OBJECT_SIZE at alignment ALIGNMENT.

Public Member Functions

template<typename T >
 operator T& ()
 Convert to T reference.
 
template<typename T >
 operator const T & () const
 Convert to const T reference.
 
template<typename T >
 operator T* ()
 Convert to T pointer.
 
template<typename T >
 operator const T * () const
 Convert to const T pointer.
 

Public Attributes

union {
   char   raw [OBJECT_SIZE *N_OBJECTS]
 
   etl::type_with_alignment< ALIGNMENT >::type   etl_alignment_type
 
}; 
 

Static Public Attributes

static ETL_CONSTANT size_t OBJECT_SIZE = OBJECT_SIZE_
 
static ETL_CONSTANT size_t N_OBJECTS = N_OBJECTS_
 
static ETL_CONSTANT size_t ALIGNMENT = ALIGNMENT_
 

◆ etl::uninitialized_buffer_of

class etl::uninitialized_buffer_of

template<typename T, size_t N_OBJECTS_>
class etl::uninitialized_buffer_of< T, N_OBJECTS_ >

Declares an aligned buffer of N_OBJECTS as if they were type T.

Public Types

typedef T value_type
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

T & operator[] (int i)
 Index operator.
 
const T & operator[] (int i) const
 Index operator.
 
 operator T& ()
 Convert to T reference.
 
 operator const T & () const
 Convert to const T reference.
 
 operator T* ()
 Convert to T pointer.
 
 operator const T * () const
 Convert to const T pointer.
 
T * begin ()
 
const T * begin () const
 
T * end ()
 
const T * end () const
 

Public Attributes

union {
   char   raw [sizeof(T) *N_OBJECTS]
 
   etl::type_with_alignment< ALIGNMENT >::type   etl_alignment_type
 
}; 
 

Static Public Attributes

static ETL_CONSTANT size_t OBJECT_SIZE = sizeof(T)
 
static ETL_CONSTANT size_t N_OBJECTS = N_OBJECTS_
 
static ETL_CONSTANT size_t ALIGNMENT = etl::alignment_of<T>::value