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

Handles unpacking objects stored in an arg_storage. More...

Public Member Functions

 packed_value (storage_type *const p, void *const base, message_ptr m) noexcept
 
 packed_value (storage_type *const p, void *const base, message_shared_ptr &m) noexcept
 
void set (storage_type *const p, void *const base, message_ptr m) noexcept
 Sets the information required to unpack and retrieve an object. More...
 
void set (storage_type *const p, void *const base, message_shared_ptr &m) noexcept
 Sets the information required to unpack and retrieve an object. More...
 
void set (T const &t)
 Sets a value in packed form that will be unpacked through get(). More...
 
void set (T &&t)
 
get (void)
 Unpacks and returns the packed object. More...
 
void release (void) noexcept
 Releases the buffer without unpacking. More...
 

Public Types

using storage_type = arg_storage_t< T, T >
 

Detailed Description

template<typename T>
struct stapl::runtime::packed_value< T >

Handles unpacking objects stored in an arg_storage.

Template Parameters
TObject type.
Warning
If a message or value is set, then release() or get() has to be called to ensure proper resource reclamation.
See also
arg_storage

Member Function Documentation

◆ set() [1/4]

template<typename T>
void stapl::runtime::packed_value< T >::set ( storage_type *const  p,
void *const  base,
message_ptr  m 
)
noexcept

Sets the information required to unpack and retrieve an object.

This function stores a pointer to the buffer where the object remains packed until get() is called.

Parameters
pPointer to the arg_storage in msg.
baseAddress in msg that the arg_storage was created in.
msgBuffer that contains the arg_storage.

◆ set() [2/4]

template<typename T>
void stapl::runtime::packed_value< T >::set ( storage_type *const  p,
void *const  base,
message_shared_ptr m 
)
noexcept

Sets the information required to unpack and retrieve an object.

This function stores a pointer to the buffer where the object remains packed until get() is called.

Warning
The reference count of the buffer will be increased to protect against accidental deletion.
Parameters
pPointer to the arg_storage in msg.
baseAddress in msg that the arg_storage was created in.
msgBuffer that contains the arg_storage.

◆ set() [3/4]

template<typename T>
void stapl::runtime::packed_value< T >::set ( T const &  t)

Sets a value in packed form that will be unpacked through get().

This function will create a new message to store the value and stores a pointer to the buffer where the object remains packed until get() is called.

Parameters
tValue to set.

◆ set() [4/4]

template<typename T>
void stapl::runtime::packed_value< T >::set ( T &&  t)

◆ get()

template<typename T>
T stapl::runtime::packed_value< T >::get ( void  )

Unpacks and returns the packed object.

Warning
This function will clean-up after the unpacking and will decrease the reference count of the buffer, which may lead to its destruction.

◆ release()

template<typename T>
void stapl::runtime::packed_value< T >::release ( void  )
noexcept

Releases the buffer without unpacking.

Warning
The reference count of the buffer will be decreased if it was assigned through set(storage_type* const,void* const,message_shared_ptr&) noexcept, which may lead to its destruction.

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