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

#include <active_request.hpp>

Public Member Functions

 ActiveRequest (ActiveRequest &&rhs) noexcept
auto operator= (ActiveRequest &&rhs) noexcept -> ActiveRequest &
 ~ActiveRequest () noexcept
 ActiveRequest (const ActiveRequest &)=delete
auto operator= (const ActiveRequest &) noexcept -> ActiveRequest &=delete
template<typename T = ResponsePayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE, void>>
auto loan_uninit () -> bb::Expected< ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >, LoanError >
 Loans uninitialized memory for a [ResponseMutUninit] where the user can write its payload to.
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto loan_slice_uninit (uint64_t number_of_elements) -> bb::Expected< ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >, LoanError >
 Loans uninitialized memory for a [ResponseMutUninit] where the user can write its payload to.
template<typename T = RequestPayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE, void>>
auto send_copy (const ResponsePayload &payload) const -> bb::Expected< void, SendError >
template<typename T = RequestPayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto send_slice_copy (const bb::ImmutableSlice< ValueType > &payload) const -> bb::Expected< void, SendError >
template<typename T = RequestPayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE, void>>
auto payload () const -> const T &
 Returns a reference to the payload of the received [RequestMut].
template<typename T = RequestPayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto payload () const -> bb::ImmutableSlice< ValueType >
 Returns a reference to the payload of the received [RequestMut].
template<typename T = RequestUserHeader, typename = std::enable_if_t<!std::is_same<void, RequestUserHeader>::value, T>>
auto user_header () const -> const T &
 Returns a reference to the user_header of the received [RequestMut].
auto header () const -> RequestHeader
 Returns a reference to the [RequestHeader] of the received [RequestMut].
auto origin () const -> UniqueClientId
 Returns the [UniqueClientId] of the [Client].
auto is_connected () const -> bool
auto has_disconnect_hint () const -> bool
template<typename T = ResponsePayload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE, void>>
auto loan () -> bb::Expected< ResponseMut< Service, ResponsePayload, ResponseUserHeader >, LoanError >
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto loan_slice (uint64_t number_of_elements) -> bb::Expected< ResponseMut< Service, ResponsePayload, ResponseUserHeader >, LoanError >
template<typename T = RequestPayload, 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 = RequestPayload, typename = std::enable_if_t<has_flatbuffer_marker<T>(), void>>
auto payload_root () const -> const typename T::ValueType *
 Returns the root of the flatbuffer.
template<typename T = ResponsePayload, typename = std::enable_if_t<has_flatbuffer_marker<T>(), void>>
auto loan_flatbuffer () -> bb::Expected< ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >, LoanError >

Friends

template<ServiceType, typename, typename, typename, typename>
class Server

Detailed Description

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
class iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >

Represents a one-to-one connection to a [Client] holding the corresponding [PendingResponse] that is coupled with the [RequestMut] the [Client] sent to the [Server]. The [Server] will use it to send arbitrary many [Response]s.

Definition at line 41 of file active_request.hpp.

Constructor & Destructor Documentation

◆ ActiveRequest() [1/2]

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

Definition at line 140 of file active_request.hpp.

References ActiveRequest().

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

◆ ~ActiveRequest()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::~ActiveRequest ( )
inlinenoexcept

Definition at line 166 of file active_request.hpp.

◆ ActiveRequest() [2/2]

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

References ActiveRequest().

Member Function Documentation

◆ has_disconnect_hint()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::has_disconnect_hint ( ) const->bool
inline

Returns [true] if the [Client] wants to gracefully disconnect. This allows the [Server] to send its last response and then drop the [ActiveRequest] to signal the [Client] that no more [ResponseMut] will be sent.

Definition at line 377 of file active_request.hpp.

Referenced by operator=().

◆ header()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::header ( ) const->RequestHeader
inline

Returns a reference to the [RequestHeader] of the received [RequestMut].

Definition at line 342 of file active_request.hpp.

Referenced by operator=(), origin(), and payload_bytes().

◆ is_connected()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::is_connected ( ) const->bool
inline

Returns [true] until the [PendingResponse] goes out of scope on the [Client] side indicating that the [Client] no longer receives the [ResponseMut].

Definition at line 366 of file active_request.hpp.

Referenced by operator=().

◆ loan()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::loan ( ) ->bb::Expected< ResponseMut< Service, ResponsePayload, ResponseUserHeader >, LoanError >
inline

Loans default initialized memory for a [ResponseMut] where the user can write its payload to.

Definition at line 388 of file active_request.hpp.

References iox2::assume_init(), iox2::bb::err(), and iox2::loan_uninit().

Referenced by operator=().

◆ loan_flatbuffer()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::loan_flatbuffer ( ) ->bb::Expected< ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >, LoanError >
inline

Definition at line 450 of file active_request.hpp.

References iox2::bb::err(), and iox2::bb::into().

Referenced by operator=().

◆ loan_slice()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::loan_slice ( uint64_t number_of_elements) ->bb::Expected< ResponseMut< Service, ResponsePayload, ResponseUserHeader >, LoanError >
inline

Loans default initialized memory for a [ResponseMut] where the user can write its payload to.

Definition at line 405 of file active_request.hpp.

References iox2::assume_init(), iox2::bb::err(), and loan_slice_uninit().

Referenced by operator=().

◆ loan_slice_uninit()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::loan_slice_uninit ( uint64_t number_of_elements) ->bb::Expected< ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >, LoanError >
inline

Loans uninitialized memory for a [ResponseMutUninit] where the user can write its payload to.

Definition at line 231 of file active_request.hpp.

References iox2::bb::err(), iox2::bb::into(), and iox2::internal::PlacementDefault< T >::placement_default().

Referenced by loan_slice().

◆ loan_uninit()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::loan_uninit ( ) ->bb::Expected< ResponseMutUninit< Service, ResponsePayload, ResponseUserHeader >, LoanError >
inline

Loans uninitialized memory for a [ResponseMutUninit] where the user can write its payload to.

Definition at line 211 of file active_request.hpp.

References iox2::bb::err(), iox2::bb::into(), and iox2::internal::PlacementDefault< T >::placement_default().

◆ operator=() [1/2]

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

Definition at line 150 of file active_request.hpp.

References ActiveRequest().

◆ operator=() [2/2]

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

◆ origin()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::origin ( ) const->UniqueClientId
inline

Returns the [UniqueClientId] of the [Client].

Definition at line 355 of file active_request.hpp.

References header().

Referenced by operator=().

◆ payload() [1/2]

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

Returns a reference to the payload of the received [RequestMut].

Definition at line 305 of file active_request.hpp.

◆ payload() [2/2]

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

Returns a reference to the payload of the received [RequestMut].

Definition at line 291 of file active_request.hpp.

Referenced by operator=(), send_copy(), and send_slice_copy().

◆ payload_bytes()

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

Returns the serialized flatbuffer data as bytes.

Definition at line 179 of file active_request.hpp.

References header().

Referenced by payload_root().

◆ payload_root()

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

Returns the root of the flatbuffer.

Definition at line 198 of file active_request.hpp.

References payload_bytes().

Referenced by operator=().

◆ send_copy()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::send_copy ( const ResponsePayload & payload) const->bb::Expected< void, SendError >
inline

Sends a copy of the provided data to the [PendingResponse] of the corresponding [Client]. This is not a zero-copy API. Use [ActiveRequest::loan_uninit()] instead.

Definition at line 250 of file active_request.hpp.

References iox2::bb::err(), iox2::bb::into(), and payload().

◆ send_slice_copy()

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<typename T, typename>
auto iox2::ActiveRequest< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::send_slice_copy ( const bb::ImmutableSlice< ValueType > & payload) const->bb::Expected< void, SendError >
inline

Sends a copy of the provided data to the [PendingResponse] of the corresponding [Client]. This is not a zero-copy API. Use [ActiveRequest::loan_slice_uninit()] instead.

Definition at line 271 of file active_request.hpp.

References iox2::bb::err(), iox2::bb::into(), and payload().

◆ user_header()

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

Returns a reference to the user_header of the received [RequestMut].

Definition at line 329 of file active_request.hpp.

Referenced by operator=().

◆ Server

template<ServiceType Service, typename RequestPayload, typename RequestUserHeader, typename ResponsePayload, typename ResponseUserHeader>
template<ServiceType, typename, typename, typename, typename>
friend class Server
friend

Definition at line 126 of file active_request.hpp.

References Server.

Referenced by Server.


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