iceoryx2
C++ Bindings
Loading...
Searching...
No Matches
iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader > Class Template Reference

#include <response_mut_uninit.hpp>

Public Member Functions

 ResponseMutUninit (ResponseMutUninit &&rhs) noexcept=default
auto operator= (ResponseMutUninit &&rhs) noexcept -> ResponseMutUninit &=default
 ~ResponseMutUninit () noexcept=default
 ResponseMutUninit (const ResponseMutUninit &)=delete
auto operator= (const ResponseMutUninit &) -> ResponseMutUninit &=delete
template<typename T = ResponsePayload, typename = std::enable_if_t<!has_flatbuffer_marker<T>(), void>>
auto header () const -> ResponseHeader
 Returns a reference to the [ResponseHeader].
template<typename T = ResponseUserHeader, typename U = ResponsePayload, typename = std::enable_if_t<!std::is_same<void, ResponseUserHeader>::value && !has_flatbuffer_marker<U>(), void>>
auto user_header () const -> const T &
 Returns a reference to the user header of the response.
template<typename T = ResponseUserHeader, typename U = ResponsePayload, typename = std::enable_if_t<!std::is_same<void, ResponseUserHeader>::value && !has_flatbuffer_marker<T>(), void>>
auto user_header_mut () -> T &
 Returns a mutable reference to the user header of the response.
template<typename T = ResponsePayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE && !has_flatbuffer_marker<T>(), void>>
auto payload () const -> const T &
 Returns a reference to the payload of the response.
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto payload () const -> bb::ImmutableSlice< ValueType >
 Returns a reference to the payload of the response.
template<typename T = ResponsePayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE && !has_flatbuffer_marker<T>(), void>>
auto payload_mut () -> T &
 Returns a mutable reference to the payload of the response.
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto payload_mut () -> bb::MutableSlice< ValueType >
 Returns a mutable reference to the payload of the response.
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
void truncate (uint64_t number_of_elements)
template<typename T = ResponsePayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE && !has_flatbuffer_marker<T>(), T>>
auto write_payload (ResponsePayload &&payload) -> ResponseMut< Service, T, ResponseUserHeader >
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, T>>
auto write_from_slice (bb::ImmutableSlice< ValueType > &value) -> ResponseMut< Service, T, ResponseUserHeader >
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, T>>
auto write_from_fn (const iox2::bb::StaticFunction< typename T::ValueType(uint64_t)> &initializer) -> ResponseMut< Service, T, ResponseUserHeader >
template<typename T = ResponsePayload, typename = std::enable_if_t<has_flatbuffer_marker<T>(), T>>
auto flatbuffer_builder () -> flatbuffers::FlatBufferBuilder &

Friends

template<ServiceType, typename, typename, typename, typename>
class ActiveRequest
template<ServiceType S, typename ResponsePayloadT, typename ResponseUserHeaderT>
auto assume_init (ResponseMutUninit< S, ResponsePayloadT, ResponseUserHeaderT > &&self) -> ResponseMut< S, ResponsePayloadT, ResponseUserHeaderT >
template<ServiceType S, typename ResponsePayloadT, typename ResponseUserHeaderT>
auto assume_init (ResponseMutUninit< S, Flatbuffer< ResponsePayloadT >, ResponseUserHeaderT > &&self, flatbuffers::Offset< ResponsePayloadT >) -> ResponseMut< S, Flatbuffer< ResponsePayloadT >, ResponseUserHeaderT >

Detailed Description

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
class iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >

Acquired by a [ActiveRequest] with

It stores the payload of the response that will be sent to the corresponding [PendingResponse] of the [Client].

If the [ResponseMutUninit] is not sent it will reelase the loaned memory when going out of scope.

Definition at line 43 of file response_mut_uninit.hpp.

Constructor & Destructor Documentation

◆ ResponseMutUninit() [1/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::ResponseMutUninit ( ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader > && rhs)
defaultnoexcept

◆ ~ResponseMutUninit()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::~ResponseMutUninit ( )
defaultnoexcept

◆ ResponseMutUninit() [2/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::ResponseMutUninit ( const ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader > & )
delete

References ResponseMutUninit().

Member Function Documentation

◆ flatbuffer_builder()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::flatbuffer_builder ( ) ->flatbuffers::FlatBufferBuilder &
inline

Returns the internal [FlatBufferBuilder] that was constructed with the internal iceoryx2 allocator to enable true zero-copy data transfer.

Definition at line 236 of file response_mut_uninit.hpp.

◆ header()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::header ( ) const->ResponseHeader
inline

Returns a reference to the [ResponseHeader].

Definition at line 148 of file response_mut_uninit.hpp.

Referenced by operator=().

◆ operator=() [1/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::operator= ( const ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader > & ) ->ResponseMutUninit &=delete
delete

◆ operator=() [2/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::operator= ( ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader > && rhs) ->ResponseMutUninit &=default
defaultnoexcept

References ResponseMutUninit().

◆ payload() [1/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::payload ( ) const->bb::ImmutableSlice< ValueType >
inline

Returns a reference to the payload of the response.

Definition at line 172 of file response_mut_uninit.hpp.

◆ payload() [2/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::payload ( ) const->constT &
inline

Returns a reference to the payload of the response.

Definition at line 166 of file response_mut_uninit.hpp.

Referenced by operator=(), and write_payload().

◆ payload_mut() [1/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::payload_mut ( ) ->bb::MutableSlice< ValueType >
inline

Returns a mutable reference to the payload of the response.

Definition at line 185 of file response_mut_uninit.hpp.

◆ payload_mut() [2/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::payload_mut ( ) ->T &
inline

Returns a mutable reference to the payload of the response.

Definition at line 179 of file response_mut_uninit.hpp.

Referenced by operator=(), write_from_fn(), write_from_slice(), and write_payload().

◆ truncate()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
void iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::truncate ( uint64_t number_of_elements)
inline

Shortens the payload to its first number_of_elements elements, so that only those are sent. It has no effect when number_of_elements is not smaller than the current number of elements.

Definition at line 192 of file response_mut_uninit.hpp.

Referenced by operator=().

◆ user_header()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename U, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::user_header ( ) const->constT &
inline

Returns a reference to the user header of the response.

Definition at line 154 of file response_mut_uninit.hpp.

References user_header().

Referenced by operator=(), and user_header().

◆ user_header_mut()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename U, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::user_header_mut ( ) ->T &
inline

Returns a mutable reference to the user header of the response.

Definition at line 160 of file response_mut_uninit.hpp.

References user_header_mut().

Referenced by operator=(), and user_header_mut().

◆ write_from_fn()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::write_from_fn ( const iox2::bb::StaticFunction< typename T::ValueType(uint64_t)> & initializer) ->ResponseMut< Service, T, ResponseUserHeader >
inline

Writes the provided payload into the [ResponseMutUninit] and returns an initialized [ResponseMut] that is ready to be sent.

Definition at line 218 of file response_mut_uninit.hpp.

References payload_mut().

Referenced by operator=().

◆ write_from_slice()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::write_from_slice ( bb::ImmutableSlice< ValueType > & value) ->ResponseMut< Service, T, ResponseUserHeader >
inline

Writes the provided payload into the [ResponseMutUninit] and returns an initialized [ResponseMut] that is ready to be sent.

Definition at line 207 of file response_mut_uninit.hpp.

References IOX2_ASSERT, and payload_mut().

Referenced by operator=().

◆ write_payload()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >::write_payload ( ResponsePayload && payload) ->ResponseMut< Service, T, ResponseUserHeader >
inline

Writes the provided payload into the [ResponseMutUninit] and returns an initialized [ResponseMut] that is ready to be sent.

Definition at line 198 of file response_mut_uninit.hpp.

References payload(), and payload_mut().

Referenced by operator=().

◆ ActiveRequest

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<ServiceType, typename, typename, typename, typename>
friend class ActiveRequest
friend

Definition at line 121 of file response_mut_uninit.hpp.

References ActiveRequest.

Referenced by ActiveRequest.

◆ assume_init [1/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<ServiceType S, typename ResponsePayloadT, typename ResponseUserHeaderT>
auto assume_init ( ResponseMutUninit< S, Flatbuffer< ResponsePayloadT >, ResponseUserHeaderT > && self,
flatbuffers::Offset< ResponsePayloadT >  )->ResponseMut< S, Flatbuffer< ResponsePayloadT >, ResponseUserHeaderT >
friend

References ResponseMutUninit().

◆ assume_init [2/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<ServiceType S, typename ResponsePayloadT, typename ResponseUserHeaderT>
auto assume_init ( ResponseMutUninit< S, ResponsePayloadT, ResponseUserHeaderT > && self) ->ResponseMut< S, ResponsePayloadT, ResponseUserHeaderT >
friend

References ResponseMutUninit().


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