| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
erpc::ManuallyConstructed< T > Class Template Reference
Infrastructure » Utilities

Allocates static storage for an object. More...

`#include <erpc_manually_constructed.h>`

## Public Member Functions
void | destroy (void)
| Invoke the object's destructor. More...
Object access
T * | get (void)
const T * | get (void) const
T * | operator-> (void)
const T * | operator-> (void) const
T & | operator* (void)
const T & | operator* (void) const
| operator T * (void)
| operator const T * (void) const
Explicit construction methods
void | construct (void)
template<typename A1 >
void | construct (const A1 &a1)
template<typename A1 , typename A2 >
void | construct (const A1 &a1, const A2 &a2)
template<typename A1 , typename A2 , typename A3 >
void | construct (const A1 &a1, const A2 &a2, const A3 &a3)
template<typename A1 , typename A2 , typename A3 , typename A4 >
void | construct (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
void | construct (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
template<typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 >
void | construct (const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)

## Protected Attributes
uint64_t | m_storage [(sizeof(T)+sizeof(uint64_t)-1)/sizeof(uint64_t)]
| Storage for the object. More...

## Detailed Description

### template<class T>
class erpc::ManuallyConstructed< T >

Allocates static storage for an object.

This template class defines storage of the template class' size. Then it gives the user explicit control over construction and destruction of the object residing in that storage. This is useful for placing objects in unions, or other situations where you need static storage but want to delay the actual construction of the object.

Objects of this class will act as a pointer to the template argument class type. Of course, if the object has not yet been constructed then the behavior is undefined if the pointer to it is used.

Note that there is not a constructor or deconstructor. This is because members of unions cannot have constructors or deconstructors.

Instances of this template class are aligned to 8 bytes.

## Member Function Documentation

template<class T >

void erpc::ManuallyConstructed< T >::destroy | ( | void |  | ) |
| inline

Invoke the object's destructor.

Behavior is undefined if the objected was not previously initialized.

## Member Data Documentation

template<class T >

uint64_t erpc::ManuallyConstructed< T >::m_storage[(sizeof(T)+sizeof(uint64_t)-1)/sizeof(uint64_t)]
| protected

Storage for the object.

An array of uint64 is used to get 8-byte alignment.

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

- erpc_manually_constructed.h