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

#include <port_factory_client.hpp>

Public Member Functions

auto backpressure_strategy (const BackpressureStrategy value) -> decltype(auto)
 
auto max_active_requests (const uint64_t value) -> decltype(auto)
 
 PortFactoryClient (const PortFactoryClient &)=delete
 
 PortFactoryClient (PortFactoryClient &&)=default
 
auto operator= (const PortFactoryClient &) -> PortFactoryClient &=delete
 
auto operator= (PortFactoryClient &&) -> PortFactoryClient &=default
 
 ~PortFactoryClient ()=default
 
template<typename T = RequestPayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto initial_max_slice_len (uint64_t value) &&-> PortFactoryClient &&
 Sets the maximum number of elements that can be loaned in a slice.
 
template<typename T = RequestPayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto allocation_strategy (AllocationStrategy value) &&-> PortFactoryClient &&
 
auto override_request_preallocation (const OverridePreallocationCallback &callback) &&-> PortFactoryClient &&
 
auto set_request_degradation_handler (DegradationHandler *handler) &&-> PortFactoryClient &&
 
auto set_response_degradation_handler (DegradationHandler *handler) &&-> PortFactoryClient &&
 
auto set_backpressure_handler (BackpressureHandler *handler) &&-> PortFactoryClient &&
 
auto create () &&-> bb::Expected< Client< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >, ClientCreateError >
 Creates a new [Client] or returns a [ClientCreateError] on failure.
 

Friends

template<ServiceType , typename , typename , typename , typename >
class PortFactoryRequestResponse
 

Detailed Description

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

Factory to create a new [Client] port/endpoint for [MessagingPattern::RequestResponse] based communication.

Definition at line 36 of file port_factory_client.hpp.

Constructor & Destructor Documentation

◆ PortFactoryClient() [1/2]

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

◆ PortFactoryClient() [2/2]

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::PortFactoryClient ( PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader > &&  )
default

◆ ~PortFactoryClient()

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

Member Function Documentation

◆ allocation_strategy()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
template<typename T , typename >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::allocation_strategy ( AllocationStrategy  value) && -> PortFactoryClient&&
inline

Defines the allocation strategy that is used when the provided [PortFactoryClient::initial_max_slice_len()] is exhausted. This happens when the user acquires more than max slice len in [Client::loan_slice()] or [Client::loan_slice_uninit()].

Definition at line 160 of file port_factory_client.hpp.

◆ backpressure_strategy()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::backpressure_strategy ( const BackpressureStrategy  value) -> decltype(auto)

Sets the [BackpressureStrategy] which defines how the [Client] shall behave when a [Server] cannot receive a [RequestMut] since its internal buffer is full.

◆ create()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::create ( ) && -> bb::Expected<Client<Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader>, ClientCreateError>
inline

Creates a new [Client] or returns a [ClientCreateError] on failure.

Definition at line 204 of file port_factory_client.hpp.

References iox2::detail::backpressure_handler_delegate(), iox2::detail::degradation_handler_delegate(), iox2::bb::err(), and iox2::internal::override_callback().

◆ initial_max_slice_len()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
template<typename T , typename >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::initial_max_slice_len ( uint64_t  value) && -> PortFactoryClient&&
inline

Sets the maximum number of elements that can be loaned in a slice.

Definition at line 136 of file port_factory_client.hpp.

◆ max_active_requests()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::max_active_requests ( const uint64_t  value) -> decltype(auto)

Defines the required maximal amount of active requests the [Client] can send. Smallest possible value is 1.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ override_request_preallocation()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::override_request_preallocation ( const OverridePreallocationCallback callback) && -> PortFactoryClient&&
inline

Defines a callback to reduce the number of preallocated [RequestMut]s. The input argument is the worst case number of preallocated [RequestMut]s required to guarantee that the [Client] never runs out of [RequestMut]s to loan and send. The return value is clamped between 1 and the worst case number of preallocated [RequestMut]s.

Important

If the user reduces the number of preallocated [RequestMut]s, iceoryx2 can no longer guarantee, that the [Client] can always loan a [RequestMut] to send.

Definition at line 147 of file port_factory_client.hpp.

◆ set_backpressure_handler()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::set_backpressure_handler ( BackpressureHandler handler) && -> PortFactoryClient&&
inline

Sets the [BackpressureHandler] of the [Client]. Whenever a [RequestMut] cannot be sent to a [Server], this handler is called and depending on the returned [BackpressureAction], measures will be taken. If no handler is set, the measures will be determined by the value set in [BackpressureStrategy].

Attention
The handler function needs to live as long as the generated client. If the [Client], including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 193 of file port_factory_client.hpp.

◆ set_request_degradation_handler()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::set_request_degradation_handler ( DegradationHandler handler) && -> PortFactoryClient&&
inline

Sets the [DegradationHandler] for sending [RequestMut] from the [Client]. Whenever a request connection to a [Server] is corrupted, this handler is called and depending on the returned [DegradationAction] measures will be taken.

Attention
The handler function needs to live as long as the generated client. If the [Client], including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 171 of file port_factory_client.hpp.

◆ set_response_degradation_handler()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::set_response_degradation_handler ( DegradationHandler handler) && -> PortFactoryClient&&
inline

Sets the [DegradationHandler] for receiving [Response]s from a [Server]. Whenever a response connection to a [Server] is corrupted, this handler is called and depending on the returned [DegradationAction] measures will be taken.

Attention
The handler function needs to live as long as the generated client. If the [Client], including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 182 of file port_factory_client.hpp.

Friends And Related Symbol Documentation

◆ PortFactoryRequestResponse

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

Definition at line 117 of file port_factory_client.hpp.


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