|
iceoryx2
C++ Bindings
|
Sending endpoint of a publish-subscriber based communication. More...
#include <publisher.hpp>
Public Member Functions | |
| Publisher (Publisher &&rhs) noexcept | |
| auto | operator= (Publisher &&rhs) noexcept -> Publisher & |
| ~Publisher () | |
| Publisher (const Publisher &)=delete | |
| auto | operator= (const Publisher &) -> Publisher &=delete |
| auto | id () const -> UniquePublisherId |
Returns the [UniquePublisherId] of the [Publisher]. | |
| auto | name () const -> PortNameView |
Returns the [PortNameView] of the [Publisher]. | |
| auto | backpressure_strategy () const -> BackpressureStrategy |
| template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>> | |
| auto | initial_max_slice_len () const -> uint64_t |
| Returns the maximum number of elements that can be loaned in a slice. | |
| auto | max_loaned_samples () const -> uint64_t |
Returns the maximum number of [SampleMut] that can be loaned in parallel. | |
| template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>> | |
| auto | allocation_strategy () const -> AllocationStrategy |
| template<typename T = Payload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE, void>> | |
| auto | send_copy (const Payload &payload) const -> bb::Expected< size_t, SendError > |
| template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>> | |
| auto | send_slice_copy (bb::ImmutableSlice< ValueType > &payload) const -> bb::Expected< size_t, SendError > |
| template<typename T = Payload, typename = std::enable_if_t<has_flatbuffer_marker<T>(), void>> | |
| auto | loan_flatbuffer () -> bb::Expected< SampleMutUninit< S, Payload, UserHeader >, LoanError > |
Acquires a [SampleMutUninit] with an integrated flatbuffer builder. | |
| template<typename T = Payload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE && !has_flatbuffer_marker<T>(), void>> | |
| auto | loan_uninit () -> bb::Expected< SampleMutUninit< S, Payload, UserHeader >, LoanError > |
| template<typename T = Payload, typename = std::enable_if_t<!bb::IsSlice<T>::VALUE && !has_flatbuffer_marker<T>(), void>> | |
| auto | loan () -> bb::Expected< SampleMut< S, Payload, UserHeader >, LoanError > |
| template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>> | |
| auto | loan_slice (uint64_t number_of_elements) -> bb::Expected< SampleMut< S, T, UserHeader >, LoanError > |
| template<typename T = Payload, typename = std::enable_if_t<bb::IsSlice<T>::VALUE, void>> | |
| auto | loan_slice_uninit (uint64_t number_of_elements) -> bb::Expected< SampleMutUninit< S, T, UserHeader >, LoanError > |
| auto | update_connections () -> bb::Expected< void, ConnectionFailure > |
Friends | |
| template<ServiceType , typename , typename > | |
| class | PortFactoryPublisher |
Sending endpoint of a publish-subscriber based communication.
Definition at line 40 of file publisher.hpp.
|
inlinenoexcept |
Definition at line 156 of file publisher.hpp.
|
inline |
Definition at line 172 of file publisher.hpp.
|
delete |
|
inline |
Returns the [AllocationStrategy] that is used when the provided [Publisher] loans a slice bigger than the initial maximum slice length.
Definition at line 195 of file publisher.hpp.
|
inline |
Returns the strategy the [Publisher] follows when a [SampleMut] cannot be delivered since the [Subscriber]s buffer is full.
Definition at line 177 of file publisher.hpp.
|
inline |
Returns the [UniquePublisherId] of the [Publisher].
Definition at line 200 of file publisher.hpp.
|
inline |
Returns the maximum number of elements that can be loaned in a slice.
Definition at line 184 of file publisher.hpp.
|
inline |
Loans/allocates a [SampleMut] from the underlying data segment of the [Publisher] and initialize it with the default value. This can be a performance hit and [Publisher::loan_uninit] can be used to loan an uninitialized [SampleMut].
On failure it returns [LoanError] describing the failure.
Definition at line 295 of file publisher.hpp.
References iox2::assume_init(), iox2::bb::err(), and iox2::loan_uninit().
|
inline |
Acquires a [SampleMutUninit] with an integrated flatbuffer builder.
Definition at line 253 of file publisher.hpp.
References iox2::bb::err(), and iox2::internal::ResizableMemoryPublishSubscribe< Service >::len().
|
inline |
Loans/allocates a [SampleMut] from the underlying data segment of the [Publisher] and initializes all slice elements with the default value. This can be a performance hit and [Publisher::loan_slice_uninit()] can be used to loan a slice of uninitialized [Payload].
On failure it returns [LoanError] describing the failure.
Definition at line 309 of file publisher.hpp.
References iox2::assume_init(), and iox2::bb::err().
|
inline |
Loans/allocates a [SampleMutUninit] from the underlying data segment of the [Publisher]. The user has to initialize the payload before it can be sent.
On failure it returns [LoanError] describing the failure.
Definition at line 327 of file publisher.hpp.
References iox2::bb::err(), and iox2::internal::PlacementDefault< T >::placement_default().
|
inline |
Loans/allocates a [SampleMutUninit] from the underlying data segment of the [Publisher]. The user has to initialize the payload before it can be sent.
On failure it returns [LoanError] describing the failure.
Definition at line 279 of file publisher.hpp.
References iox2::bb::err(), and iox2::internal::PlacementDefault< T >::placement_default().
|
inline |
Returns the maximum number of [SampleMut] that can be loaned in parallel.
Definition at line 189 of file publisher.hpp.
|
inline |
Returns the [PortNameView] of the [Publisher].
Definition at line 208 of file publisher.hpp.
References iox2::PortNameView::from_native_ptr().
|
delete |
|
inlinenoexcept |
Definition at line 161 of file publisher.hpp.
|
inline |
Copies the input value into a [SampleMut] and delivers it. On success it returns the number of [Subscriber]s that received the data, otherwise a [SendError] describing the failure.
Definition at line 215 of file publisher.hpp.
References iox2::bb::err().
|
inline |
Copies the input payload slice into a [SampleMut] and delivers it. On success it returns the number of [Subscriber]s that received the data, otherwise a [SendError] describing the failure.
Definition at line 233 of file publisher.hpp.
References iox2::bb::err().
|
inline |
Explicitly updates all connections to the [Subscriber]s. This is required to be called whenever a new [Subscriber] is connected to the service. It is called implicitly whenever [SampleMut::send()] or [Publisher::send_copy()] is called. When a [Subscriber] is connected that requires a history this call will deliver it.
Definition at line 343 of file publisher.hpp.
References iox2::bb::err().
|
friend |
Definition at line 134 of file publisher.hpp.