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

#include <port_factory_server.hpp>

Public Member Functions

auto backpressure_strategy (const BackpressureStrategy value) -> decltype(auto)
 
auto max_loaned_responses_per_request (const uint64_t value) -> decltype(auto)
 
 PortFactoryServer (const PortFactoryServer &)=delete
 
 PortFactoryServer (PortFactoryServer &&)=default
 
auto operator= (const PortFactoryServer &) -> PortFactoryServer &=delete
 
auto operator= (PortFactoryServer &&) -> PortFactoryServer &=default
 
 ~PortFactoryServer ()=default
 
auto override_response_preallocation (const OverridePreallocationCallback &callback) &&-> PortFactoryServer &&
 
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto initial_max_slice_len (uint64_t value) &&-> PortFactoryServer &&
 Sets the maximum initial slice length configured for this [Server].
 
template<typename T = ResponsePayload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto allocation_strategy (AllocationStrategy value) &&-> PortFactoryServer &&
 
auto set_request_degradation_handler (DegradationHandler *handler) &&-> PortFactoryServer &&
 
auto set_response_degradation_handler (DegradationHandler *handler) &&-> PortFactoryServer &&
 
auto set_backpressure_handler (BackpressureHandler *handler) &&-> PortFactoryServer &&
 
auto create () &&-> bb::Expected< Server< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >, ServerCreateError >
 Creates a new [Server] or returns a [ServerCreateError] 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::PortFactoryServer< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >

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

Definition at line 36 of file port_factory_server.hpp.

Constructor & Destructor Documentation

◆ PortFactoryServer() [1/2]

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

◆ PortFactoryServer() [2/2]

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

◆ ~PortFactoryServer()

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

Member Function Documentation

◆ allocation_strategy()

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

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

Definition at line 163 of file port_factory_server.hpp.

◆ backpressure_strategy()

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

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

◆ create()

template<ServiceType Service, typename RequestPayload , typename RequestUserHeader , typename ResponsePayload , typename ResponseUserHeader >
auto iox2::PortFactoryServer< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::create ( ) && -> bb::Expected<Server<Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader>, ServerCreateError>
inline

Creates a new [Server] or returns a [ServerCreateError] on failure.

Definition at line 207 of file port_factory_server.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::PortFactoryServer< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >::initial_max_slice_len ( uint64_t  value) && -> PortFactoryServer&&
inline

Sets the maximum initial slice length configured for this [Server].

Definition at line 139 of file port_factory_server.hpp.

◆ max_loaned_responses_per_request()

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

Defines the maximum number of [ResponseMut] that the [Server] can loan in parallel per [ActiveRequest].

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ override_response_preallocation()

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

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

Important

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

Definition at line 150 of file port_factory_server.hpp.

◆ set_backpressure_handler()

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

Sets the [BackpressureHandler] of the [Server]. Whenever a [ResponseMut] cannot be sent to a [Client], 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 server. If the [Server], including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 196 of file port_factory_server.hpp.

◆ set_request_degradation_handler()

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

Sets the [DegradationHandler] for receiving [ActiveRequest]s from a [Client]. Whenever a request connection to a [Client](crate::port::client::Client) 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 server. If the [Server], including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 174 of file port_factory_server.hpp.

◆ set_response_degradation_handler()

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

Sets the [DegradationHandler] for sending [ResponseMut]s to a [Client]. Whenever a response connection to a [Client] 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 server. If the [Server], including the send and receive functions, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 185 of file port_factory_server.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 120 of file port_factory_server.hpp.


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