Loading...
Searching...
No Matches
alignment
Embedded Template Library. » Utilities

## Classes

class | etl::type_with_alignment< Alignment >
struct | etl::aligned_storage< Length, Alignment >
struct | etl::aligned_storage_as< Length, T >
class | etl::uninitialized_buffer< VObject_Size, VN_Objects, VAlignment >
class | etl::uninitialized_buffer_of< T, VN_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<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

### Public Member Functions

| ETL_STATIC_ASSERT (etl::alignment_of< type >::value==Alignment, "Unable to create the type with the specified alignment")

## etl::aligned_storage

struct etl::aligned_storage

template<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 VObject_Size, size_t VN_Objects, size_t VAlignment>
class etl::uninitialized_buffer< VObject_Size, VN_Objects, VAlignment >

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 [VObject_Size *VN_Objects] |
etl::type_with_alignment< Alignment >::type etl_alignment_type |
}; |

### Static Public Attributes

static ETL_CONSTANT size_t | Object_Size = VObject_Size
static ETL_CONSTANT size_t | N_Objects = VN_Objects
static ETL_CONSTANT size_t | Alignment = VAlignment

## etl::uninitialized_buffer_of

class etl::uninitialized_buffer_of

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

Declares an aligned buffer of VN_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 = VN_Objects
static ETL_CONSTANT size_t | Alignment = etl::alignment_of<T>::value