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

#include <response_mut.hpp>

Public Member Functions

 ResponseMut (ResponseMut &&rhs) noexcept
auto operator= (ResponseMut &&rhs) noexcept -> ResponseMut &
 ~ResponseMut () noexcept
 ResponseMut (const ResponseMut &)=delete
auto operator= (const ResponseMut &) -> ResponseMut &=delete
auto header () const -> ResponseHeader
 Returns a reference to the [ResponseHeader].
template<typename T = ResponseUserHeader, typename = std::enable_if_t<!std::is_same<void, ResponseUserHeader>::value, T>>
auto user_header () const -> const T &
 Returns a reference to the user header of the response.
template<typename T = ResponseUserHeader, typename = std::enable_if_t<!std::is_same<void, ResponseUserHeader>::value, T>>
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 ResponsePayload &
 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 () -> ResponsePayload &
 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<has_flatbuffer_marker<T>(), void>>
auto payload_bytes () const -> bb::ImmutableSlice< uint8_t >
 Returns the serialized flatbuffer data as bytes.
template<typename T = ResponsePayload, typename = std::enable_if_t<has_flatbuffer_marker<T>(), void>>
auto payload_root () const -> const typename T::ValueType *
 Returns the root of the flatbuffer.

Friends

template<ServiceType, typename, typename>
class ResponseMutUninit
template<ServiceType, typename, typename, typename, typename>
class ActiveRequest
template<ServiceType S, typename ResponsePayloadT, typename ResponseUserHeaderT>
auto send (ResponseMut< S, ResponsePayloadT, ResponseUserHeaderT > &&response) -> bb::Expected< void, SendError >

Detailed Description

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
class iox2::ResponseMut< 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 [ResponseMut] is not sent it will reelase the loaned memory when going out of scope.

Definition at line 43 of file response_mut.hpp.

Constructor & Destructor Documentation

◆ ResponseMut() [1/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
iox2::ResponseMut< Service, ResponsePayload, ResponseUserHeader >::ResponseMut ( ResponseMut< Service, ResponsePayload, ResponseUserHeader > && rhs)
inlinenoexcept

Definition at line 120 of file response_mut.hpp.

References ResponseMut().

Referenced by operator=(), operator=(), ResponseMut(), ResponseMut(), and send.

◆ ~ResponseMut()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
iox2::ResponseMut< Service, ResponsePayload, ResponseUserHeader >::~ResponseMut ( )
inlinenoexcept

Definition at line 144 of file response_mut.hpp.

◆ ResponseMut() [2/2]

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

References ResponseMut().

Member Function Documentation

◆ header()

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

Returns a reference to the [ResponseHeader].

Definition at line 172 of file response_mut.hpp.

Referenced by payload_bytes().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ResponseMut< Service, ResponsePayload, ResponseUserHeader >::operator= ( ResponseMut< Service, ResponsePayload, ResponseUserHeader > && rhs) ->ResponseMut &
inlinenoexcept

Definition at line 131 of file response_mut.hpp.

References iox2::internal::iox2_response_mut_move(), and ResponseMut().

◆ payload() [1/2]

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

Returns a reference to the payload of the response.

Definition at line 204 of file response_mut.hpp.

◆ payload() [2/2]

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

Returns a reference to the payload of the response.

Definition at line 196 of file response_mut.hpp.

Referenced by operator=().

◆ payload_bytes()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMut< Service, ResponsePayload, ResponseUserHeader >::payload_bytes ( ) const->bb::ImmutableSlice< uint8_t >
inline

Returns the serialized flatbuffer data as bytes.

Definition at line 151 of file response_mut.hpp.

References header().

Referenced by payload_root().

◆ payload_mut() [1/2]

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

Returns a mutable reference to the payload of the response.

Definition at line 230 of file response_mut.hpp.

◆ payload_mut() [2/2]

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

Returns a mutable reference to the payload of the response.

Definition at line 222 of file response_mut.hpp.

Referenced by operator=().

◆ payload_root()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ResponseMut< Service, ResponsePayload, ResponseUserHeader >::payload_root ( ) const->consttypenameT::ValueType *
inline

Returns the root of the flatbuffer.

Definition at line 165 of file response_mut.hpp.

References payload_bytes().

Referenced by operator=().

◆ truncate()

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
void iox2::ResponseMut< 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 247 of file response_mut.hpp.

Referenced by operator=().

◆ user_header()

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

Returns a reference to the user header of the response.

Definition at line 180 of file response_mut.hpp.

Referenced by operator=().

◆ user_header_mut()

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

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

Definition at line 188 of file response_mut.hpp.

Referenced by operator=().

◆ ActiveRequest

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

Definition at line 104 of file response_mut.hpp.

References ActiveRequest.

Referenced by ActiveRequest.

◆ ResponseMutUninit

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

Definition at line 102 of file response_mut.hpp.

References ResponseMutUninit.

Referenced by ResponseMutUninit.

◆ send

template<ServiceType Service, typename ResponsePayload, typename ResponseUserHeader>
template<ServiceType S, typename ResponsePayloadT, typename ResponseUserHeaderT>
auto send ( ResponseMut< S, ResponsePayloadT, ResponseUserHeaderT > && response) ->bb::Expected< void, SendError >
friend

Sends a [ResponseMut] to the corresponding [PendingResponse] of the [Client].

References ResponseMut().


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