Template Class Sample

Inheritance Relationships

Base Type

  • public iox::popo::SmartChunk< PublisherInterface< T, cxx::add_const_conditionally_t< mepoo::NoUserHeader, T > >, T, cxx::add_const_conditionally_t< mepoo::NoUserHeader, T > > (Template Class SmartChunk)

Class Documentation

template<typename T, typename H = cxx::add_const_conditionally_t<mepoo::NoUserHeader, T>>
class Sample : public iox::popo::SmartChunk<PublisherInterface<T, cxx::add_const_conditionally_t<mepoo::NoUserHeader, T>>, T, cxx::add_const_conditionally_t<mepoo::NoUserHeader, T>>

The Sample class is a mutable abstraction over types which are written to loaned shared memory. These samples are publishable to the iceoryx system.

Public Types

template<typename T1, typename T2>
using ForPublisherOnly = typename BaseType::template ForProducerOnly<T1, T2>

Public Functions

template<typename S = T, typename = ForPublisherOnly<S, T>>
void publish() noexcept

Publish the sample via the publisher from which it was loaned and automatically release ownership to it.

Only available for non-const type T.

template<typename R = H, typename = HasUserHeader<R, H>>
cxx::add_const_conditionally_t<R, T> &getUserHeader() noexcept

Retrieve the user-header of the underlying memory chunk loaned to the sample.

Returns:

The user-header of the underlying memory chunk.

template<typename R = H, typename = HasUserHeader<R, H>>
const R &getUserHeader() const noexcept

Retrieve the user-header of the underlying memory chunk loaned to the sample.

Returns:

The user-header of the underlying memory chunk.