iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
iox2::PortFactoryPublisher< S, Payload, UserHeader > Class Template Reference

#include <port_factory_publisher.hpp>

Public Member Functions

auto backpressure_strategy (const BackpressureStrategy value) -> decltype(auto)
 Sets the [BackpressureStrategy].
 
auto max_loaned_samples (const uint64_t value) -> decltype(auto)
 
 PortFactoryPublisher (const PortFactoryPublisher &)=delete
 
 PortFactoryPublisher (PortFactoryPublisher &&)=default
 
auto operator= (const PortFactoryPublisher &) -> PortFactoryPublisher &=delete
 
auto operator= (PortFactoryPublisher &&) -> PortFactoryPublisher &=default
 
 ~PortFactoryPublisher ()=default
 
auto override_sample_preallocation (const OverridePreallocationCallback &callback) &&-> PortFactoryPublisher &&
 
template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto initial_max_slice_len (uint64_t value) &&-> PortFactoryPublisher &&
 
template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>>
auto allocation_strategy (AllocationStrategy value) &&-> PortFactoryPublisher &&
 
auto set_degradation_handler (DegradationHandler *handler) &&-> PortFactoryPublisher &&
 
auto set_backpressure_handler (BackpressureHandler *handler) &&-> PortFactoryPublisher &&
 
auto create () &&-> bb::Expected< Publisher< S, Payload, UserHeader >, PublisherCreateError >
 Creates a new [Publisher] or returns a [PublisherCreateError] on failure.
 

Friends

template<ServiceType , typename , typename >
class PortFactoryPublishSubscribe
 

Detailed Description

template<ServiceType S, typename Payload, typename UserHeader>
class iox2::PortFactoryPublisher< S, Payload, UserHeader >

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

Definition at line 34 of file port_factory_publisher.hpp.

Constructor & Destructor Documentation

◆ PortFactoryPublisher() [1/2]

template<ServiceType S, typename Payload , typename UserHeader >
iox2::PortFactoryPublisher< S, Payload, UserHeader >::PortFactoryPublisher ( const PortFactoryPublisher< S, Payload, UserHeader > &  )
delete

◆ PortFactoryPublisher() [2/2]

template<ServiceType S, typename Payload , typename UserHeader >
iox2::PortFactoryPublisher< S, Payload, UserHeader >::PortFactoryPublisher ( PortFactoryPublisher< S, Payload, UserHeader > &&  )
default

◆ ~PortFactoryPublisher()

template<ServiceType S, typename Payload , typename UserHeader >
iox2::PortFactoryPublisher< S, Payload, UserHeader >::~PortFactoryPublisher ( )
default

Member Function Documentation

◆ allocation_strategy()

template<ServiceType S, typename Payload , typename UserHeader >
template<typename T , typename >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::allocation_strategy ( AllocationStrategy  value) && -> PortFactoryPublisher&&
inline

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

Definition at line 140 of file port_factory_publisher.hpp.

◆ backpressure_strategy()

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::backpressure_strategy ( const BackpressureStrategy  value) -> decltype(auto)

Sets the [BackpressureStrategy].

◆ create()

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::create ( ) && -> bb::Expected<Publisher<S, Payload, UserHeader>, PublisherCreateError>
inline

Creates a new [Publisher] or returns a [PublisherCreateError] on failure.

Definition at line 161 of file port_factory_publisher.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 S, typename Payload , typename UserHeader >
template<typename T , typename >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::initial_max_slice_len ( uint64_t  value) && -> PortFactoryPublisher&&
inline

Sets the maximum slice length that a user can allocate with [Publisher::loan_slice()] or [Publisher::loan_slice_uninit()].

Definition at line 126 of file port_factory_publisher.hpp.

◆ max_loaned_samples()

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::max_loaned_samples ( const uint64_t  value) -> decltype(auto)

Defines how many [SampleMut] the [Publisher] can loan with [Publisher::loan()] or [Publisher::loan_uninit()] in parallel.

◆ operator=() [1/2]

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::operator= ( const PortFactoryPublisher< S, Payload, UserHeader > &  ) -> PortFactoryPublisher &=delete
delete

◆ operator=() [2/2]

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::operator= ( PortFactoryPublisher< S, Payload, UserHeader > &&  ) -> PortFactoryPublisher &=default
default

◆ override_sample_preallocation()

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::override_sample_preallocation ( const OverridePreallocationCallback callback) && -> PortFactoryPublisher&&
inline

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

Important

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

Definition at line 132 of file port_factory_publisher.hpp.

◆ set_backpressure_handler()

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::set_backpressure_handler ( BackpressureHandler handler) && -> PortFactoryPublisher&&
inline

Sets the [BackpressureHandler] of the [Publisher]. Whenever a [SampleMut] cannot be sent to a [Subscriber], 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 publisher. If the [Publisher], including the send function, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 154 of file port_factory_publisher.hpp.

◆ set_degradation_handler()

template<ServiceType S, typename Payload , typename UserHeader >
auto iox2::PortFactoryPublisher< S, Payload, UserHeader >::set_degradation_handler ( DegradationHandler handler) && -> PortFactoryPublisher&&
inline

Sets the [DegradationHandler] of the [Publisher]. Whenever a connection to a [Subscriber] 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 publisher. If the [Publisher], including the send function, is accessed from multiple threads, the handler must be thread-safe if it captures data

Definition at line 147 of file port_factory_publisher.hpp.

Friends And Related Symbol Documentation

◆ PortFactoryPublishSubscribe

template<ServiceType S, typename Payload , typename UserHeader >
template<ServiceType , typename , typename >
friend class PortFactoryPublishSubscribe
friend

Definition at line 106 of file port_factory_publisher.hpp.


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