18#ifndef IOX_POSH_POPO_BASE_SUBSCRIBER_HPP
19#define IOX_POSH_POPO_BASE_SUBSCRIBER_HPP
21#include "iceoryx_hoofs/cxx/expected.hpp"
22#include "iceoryx_hoofs/cxx/optional.hpp"
23#include "iceoryx_hoofs/cxx/unique_ptr.hpp"
24#include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
25#include "iceoryx_posh/popo/enum_trigger_type.hpp"
26#include "iceoryx_posh/popo/sample.hpp"
27#include "iceoryx_posh/popo/subscriber_options.hpp"
28#include "iceoryx_posh/popo/wait_set.hpp"
29#include "iceoryx_posh/runtime/posh_runtime.hpp"
39using uid_t = UniquePortId;
41enum class SubscriberEvent : EventEnumIdentifier
46enum class SubscriberState : StateEnumIdentifier
54template <
typename port_t = iox::SubscriberPortUserType>
58 virtual ~BaseSubscriber()
noexcept;
105 friend class NotificationAttorney;
106 friend class iox::runtime::ServiceDiscovery;
113 using PortType = port_t;
115 BaseSubscriber() noexcept;
116 BaseSubscriber(const capro::ServiceDescription& service, const
SubscriberOptions& subscriberOptions) noexcept;
118 BaseSubscriber(const BaseSubscriber& other) = delete;
119 BaseSubscriber& operator=(const BaseSubscriber&) = delete;
120 BaseSubscriber(BaseSubscriber&& rhs) = delete;
121 BaseSubscriber& operator=(BaseSubscriber&& rhs) = delete;
125 cxx::expected<const mepoo::ChunkHeader*, ChunkReceiveResult>
takeChunk() noexcept;
127 void invalidateTrigger(const uint64_t trigger) noexcept;
137 WaitSetIsConditionSatisfiedCallback
156 const port_t&
port() const noexcept;
164 port_t m_port{
nullptr};
171#include "iceoryx_posh/internal/popo/base_subscriber.inl"
WaitSetIsConditionSatisfiedCallback getCallbackForIsStateConditionSatisfied(const SubscriberState subscriberState) const noexcept
void enableState(iox::popo::TriggerHandle &&triggerHandle, const SubscriberState subscriberState) noexcept
capro::ServiceDescription getServiceDescription() const noexcept
void enableEvent(iox::popo::TriggerHandle &&triggerHandle, const SubscriberEvent subscriberState) noexcept
void subscribe() noexcept
uid_t getUid() const noexcept
uid Get the unique ID of the subscriber.
const port_t & port() const noexcept
void disableState(const SubscriberState subscriberState) noexcept
bool hasData() const noexcept
void unsubscribe() noexcept
cxx::expected< const mepoo::ChunkHeader *, ChunkReceiveResult > takeChunk() noexcept
void releaseQueuedData() noexcept
void disableEvent(const SubscriberEvent subscriberEvent) noexcept
BaseSubscriber< port_t > SelfType
Only usable by the WaitSet, not for public use. Invalidates the internal triggerHandle.
Definition base_subscriber.hpp:112
bool hasMissedData() noexcept
SubscribeState getSubscriptionState() const noexcept
TriggerHandle is threadsafe without restrictions in a single process. Not qualified for inter process...
Definition trigger_handle.hpp:38
Definition service_discovery.hpp:45
This struct is used to configure the subscriber.
Definition subscriber_options.hpp:33