13#ifndef IOX2_PORTFACTORY_BLACKBOARD_HPP
14#define IOX2_PORTFACTORY_BLACKBOARD_HPP
22#include "iox2/iceoryx2.h"
35template <ServiceType S,
typename KeyType>
101 void drop() noexcept;
103 iox2_port_factory_blackboard_h m_handle =
nullptr;
108 : m_handle { handle } {
111template <ServiceType S,
typename KeyType>
112inline void PortFactoryBlackboard<S, KeyType>::drop() noexcept {
113 if (m_handle !=
nullptr) {
114 iox2_port_factory_blackboard_drop(m_handle);
119template <ServiceType S,
typename KeyType>
121 *
this = std::move(rhs);
124template <ServiceType S,
typename KeyType>
129 m_handle = rhs.m_handle;
130 rhs.m_handle =
nullptr;
136template <ServiceType S,
typename KeyType>
141template <ServiceType S,
typename KeyType>
143 const auto* service_name_ptr = iox2_port_factory_blackboard_service_name(&m_handle);
147template <ServiceType S,
typename KeyType>
151 iox2_port_factory_blackboard_service_hash(&m_handle, &buffer[0], IOX2_SERVICE_HASH_LENGTH_NULL_TERMINATED);
156 IOX2_SERVICE_HASH_LENGTH_NULL_TERMINATED));
159template <ServiceType S,
typename KeyType>
161 return AttributeSetView(iox2_port_factory_blackboard_attributes(&m_handle));
164template <ServiceType S,
typename KeyType>
167 iox2_port_factory_blackboard_static_config(&m_handle, &
static_config);
172template <ServiceType S,
typename KeyType>
177template <ServiceType S,
typename KeyType>
186 if (ret_val == IOX2_OK) {
193template <ServiceType S,
typename KeyType>
195 iox2_cleanup_state_t cleanup_state {};
197 iox2_port_factory_blackboard_try_cleanup_dead_nodes(&m_handle, &cleanup_state);
200 ret_val.
cleanups = cleanup_state.cleanups;
205template <ServiceType T,
typename KeyType>
208 iox2_cleanup_state_t cleanup_state {};
210 iox2_port_factory_blackboard_blocking_cleanup_dead_nodes(
211 &m_handle, &cleanup_state, timeout.as_secs(), timeout.subsec_nanos());
214 ret_val.
cleanups = cleanup_state.cleanups;
219template <ServiceType S,
typename KeyType>
224template <ServiceType S,
typename KeyType>
229template <
typename KeyType>
232 auto result = (*callback)(*
static_cast<const KeyType* const
>(key_ptr));
236template <ServiceType S,
typename KeyType>
239 auto mutable_callback = callback;
Describes the state of a [Node].
friend class ServiceBuilderBlackboardCreator
auto dynamic_config() const -> DynamicConfigBlackboard
PortFactoryBlackboard(const PortFactoryBlackboard &)=delete
void list_keys(const iox2::bb::StaticFunction< CallbackProgression(const KeyType &)> &callback) const
auto static_config() const -> StaticConfigBlackboard
auto attributes() const -> AttributeSetView
Returns the attributes defined in the [Service].
auto blocking_cleanup_dead_nodes(iox2::bb::Duration timeout) const -> CleanupState
friend class ServiceBuilderBlackboardOpener
auto writer_builder() const -> PortFactoryWriter< S, KeyType >
Returns a [PortFactoryWriter] to create a new [Writer] port.
auto service_hash() const -> ServiceHash
Returns the [ServiceHash] of the [Service].
auto operator=(const PortFactoryBlackboard &) -> PortFactoryBlackboard &=delete
PortFactoryBlackboard(PortFactoryBlackboard &&rhs) noexcept
auto name() const -> ServiceNameView
Returns the [ServiceName] of the service.
auto try_cleanup_dead_nodes() const -> CleanupState
auto reader_builder() const -> PortFactoryReader< S, KeyType >
Returns a [PortFactoryReader] to create a new [Reader] port.
auto nodes(const iox2::bb::StaticFunction< CallbackProgression(NodeState< S >)> &callback) const -> bb::Expected< void, NodeListFailure >
auto operator=(PortFactoryBlackboard &&rhs) noexcept -> PortFactoryBlackboard &
Represents the unique if of a [Service].
Non-owning view of a [ServiceName].
static auto from_utf8_null_terminated_unchecked_truncated(char const *utf8_str, SizeType count) -> StaticString
Wrapper class for a C-style array of type ElementType and size Capacity. Per default it is uninitiali...
detail::StaticFunction< Capacity, Signature > StaticFunction
A static memory replacement for std::function.
constexpr auto into(const SourceType value) noexcept -> typename detail::ExtractIntoType< DestinationType >::TargetType
Converts a value of type SourceType to a corresponding value of type DestinationType....
constexpr auto err(const E &error) -> Unexpected< E >
iox2::bb::variation::Expected< T, E > Expected
auto list_callback(iox2_node_state_e node_state, iox2_unique_node_id_ptr node_id_ptr, const char *executable, iox2_node_name_ptr node_name, iox2_config_ptr config, iox2_callback_context context) -> iox2_callback_progression_e
auto ctx(const T &ptr) -> CallbackContext< T >
auto list_keys_callback(const void *const key_ptr, void *ctx) -> iox2_callback_progression_e
NodeListFailure
All failures that can occur in [Node::list()].
uint64_t failed_cleanups
The number of failed dead node cleanups.
uint64_t cleanups
The number of successful dead node cleanups.