STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions
stapl::runtime::moved_cref_storage< T > Class Template Reference

Storage for a moved object that is retrieved by const reference. More...

Public Member Functions

 moved_cref_storage (T &&t, void *const base, std::size_t &size) noexcept
 Constructs a new object by packing t in it. More...
 
template<typename Tuple >
 moved_cref_storage (Tuple &&t) noexcept
 Packs the object contained in tuple t. More...
 
T & get (void *const base)
 Returns the stored object after unpacking it. More...
 
T & get (void *const base, std::size_t &size)
 Returns the stored object after unpacking it. More...
 

Static Public Member Functions

static std::size_t packed_size (T &&t) noexcept
 Returns the packed size of t. More...
 

Private Member Functions

bool construct (T &&t, void *const base, std::size_t &size)
 Initializes this object by moving t in it. More...
 
bool construct (T const &t, void *const base, std::size_t &size)
 Initializes this object by copying t in it. More...
 
void destroy (void) noexcept
 Destroys the internal storage as if it holds a moved or copied object.
 
void destroy_packed (void) noexcept
 Destroys the internal storage as if it holds a packed object.
 
T & get (void) noexcept
 Returns the moved or copied object.
 
moveout (void)
 Moves the object out if it was moved or copied in.
 

Static Private Member Functions

static std::size_t packed_size (T const &t) noexcept
 Returns the packed size of t.
 

Detailed Description

template<typename T>
class stapl::runtime::moved_cref_storage< T >

Storage for a moved object that is retrieved by const reference.

Template Parameters
TObject type.

Constructor & Destructor Documentation

◆ moved_cref_storage() [1/2]

template<typename T >
stapl::runtime::moved_cref_storage< T >::moved_cref_storage ( T &&  t,
void *const  base,
std::size_t &  size 
)
noexcept

Constructs a new object by packing t in it.

This constructor will copy the dynamic part of the object at base + size, which should be big enough to fit it.

Parameters
tObject to pack.
basePointer to buffer start where the dynamic part of t can be stored in.
sizeOffset from base where space is available.

◆ moved_cref_storage() [2/2]

template<typename T >
template<typename Tuple >
stapl::runtime::moved_cref_storage< T >::moved_cref_storage ( Tuple &&  t)
noexcept

Packs the object contained in tuple t.

Parameters
tTuple with the object to pack, the start of the buffer for the dynamic part of the object and the offset from the start of the buffer.

Member Function Documentation

◆ packed_size()

template<typename T >
static std::size_t stapl::runtime::moved_cref_storage< T >::packed_size ( T &&  t)
staticnoexcept

Returns the packed size of t.

◆ get() [1/2]

template<typename T >
T& stapl::runtime::moved_cref_storage< T >::get ( void *const  base)

Returns the stored object after unpacking it.

Parameters
baseBuffer where the dynamic part of the object is stored.

◆ get() [2/2]

template<typename T >
T& stapl::runtime::moved_cref_storage< T >::get ( void *const  base,
std::size_t &  size 
)

Returns the stored object after unpacking it.

Parameters
baseBuffer where the dynamic part of the object is stored.
sizeVariable to store how many bytes were unpacked.

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