SObjectizer  5.5
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
timertt::details::buffer_allocated_object< T > Class Template Reference

A special storage to be used for holding non-default constructible objects which are created by demand. More...

#include <all.hpp>

Public Types

using pointer = T *
 
using element_type = T
 
using reference = typename std::add_lvalue_reference< T >::type
 

Public Member Functions

 buffer_allocated_object () TIMERTT_NOEXCEPT=default
 
 buffer_allocated_object (const buffer_allocated_object &)=delete
 
 buffer_allocated_object (buffer_allocated_object &&)=delete
 
 ~buffer_allocated_object ()
 
template<typename... Args>
void allocate (Args &&...args)
 
void destroy ()
 
 operator bool () const TIMERTT_NOEXCEPT
 
pointer get () const TIMERTT_NOEXCEPT
 
pointer operator-> () const TIMERTT_NOEXCEPT
 
reference operator* () const TIMERTT_NOEXCEPT
 

Private Member Functions

void destroy_if_allocated ()
 

Private Attributes

TIMERTT_ALIGNAS_WORKAROUND(T) std bool allocated_ { false }
 

Detailed Description

template<typename T>
class timertt::details::buffer_allocated_object< T >

A special storage to be used for holding non-default constructible objects which are created by demand.

Note
In C++17 std::optional can be used instead of this class.
Since
v.1.2.0

Member Typedef Documentation

◆ element_type

template<typename T>
using timertt::details::buffer_allocated_object< T >::element_type = T

◆ pointer

template<typename T>
using timertt::details::buffer_allocated_object< T >::pointer = T*

◆ reference

template<typename T>
using timertt::details::buffer_allocated_object< T >::reference = typename std::add_lvalue_reference<T>::type

Constructor & Destructor Documentation

◆ buffer_allocated_object() [1/3]

◆ buffer_allocated_object() [2/3]

◆ buffer_allocated_object() [3/3]

◆ ~buffer_allocated_object()

Member Function Documentation

◆ allocate()

template<typename T>
template<typename... Args>
void timertt::details::buffer_allocated_object< T >::allocate ( Args &&...  args)
inline

◆ destroy()

template<typename T>
void timertt::details::buffer_allocated_object< T >::destroy ( )
inline

◆ destroy_if_allocated()

template<typename T>
void timertt::details::buffer_allocated_object< T >::destroy_if_allocated ( )
inlineprivate

◆ get()

template<typename T>
pointer timertt::details::buffer_allocated_object< T >::get ( ) const
inline

◆ operator bool()

template<typename T>
timertt::details::buffer_allocated_object< T >::operator bool ( ) const
inline

◆ operator*()

template<typename T>
reference timertt::details::buffer_allocated_object< T >::operator* ( ) const
inline

◆ operator->()

template<typename T>
pointer timertt::details::buffer_allocated_object< T >::operator-> ( ) const
inline

Member Data Documentation

◆ allocated_

template<typename T>
TIMERTT_ALIGNAS_WORKAROUND (T) std bool timertt::details::buffer_allocated_object< T >::allocated_ { false }
private

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