iox::popo::BaseSubscriber🔗
base class for all types of subscriber More...
#include <base_subscriber.hpp>
Protected Types🔗
Name | |
---|---|
using BaseSubscriber< port_t > | SelfType Only usable by the WaitSet, not for public use. Invalidates the internal triggerHandle. |
using port_t | PortType |
Public Functions🔗
Name | |
---|---|
virtual | ~BaseSubscriber() |
uid_t | getUid() const uid Get the unique ID of the subscriber. |
capro::ServiceDescription | getServiceDescription() const getServiceDescription Get the service description of the subscriber. |
void | subscribe() subscribe Initiate subscription. |
SubscribeState | getSubscriptionState() const getSubscriptionState Get current subscription state. |
void | unsubscribe() unsubscribe Unsubscribes if currently subscribed, otherwise do nothing. |
bool | hasData() const Check if data is available. |
bool | hasMissedData() Check if data has been missed since the last call of this method. |
void | releaseQueuedData() Releases any unread queued data. |
Protected Functions🔗
Name | |
---|---|
BaseSubscriber() | |
BaseSubscriber(const capro::ServiceDescription & service, const SubscriberOptions & subscriberOptions) | |
BaseSubscriber(const BaseSubscriber & other) | |
BaseSubscriber & | operator=(const BaseSubscriber & ) |
BaseSubscriber(BaseSubscriber && rhs) | |
BaseSubscriber & | operator=(BaseSubscriber && rhs) |
cxx::expected< const mepoo::ChunkHeader *, ChunkReceiveResult > | takeChunk() small helper method to unwrap the expected<optional<ChunkHeader*>> from the tryGetChunk method of the port |
void | invalidateTrigger(const uint64_t trigger) |
void | enableState(iox::popo::TriggerHandle && triggerHandle, const SubscriberState subscriberState) Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger. |
WaitSetIsConditionSatisfiedCallback | getCallbackForIsStateConditionSatisfied(const SubscriberState subscriberState) const Only usable by the WaitSet, not for public use. Returns method pointer to the event corresponding hasTriggered method callback. |
void | disableState(const SubscriberState subscriberState) Only usable by the WaitSet, not for public use. Resets the internal triggerHandle. |
void | enableEvent(iox::popo::TriggerHandle && triggerHandle, const SubscriberEvent subscriberState) Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger. |
void | disableEvent(const SubscriberEvent subscriberEvent) Only usable by the WaitSet, not for public use. Resets the internal triggerHandle. |
const port_t & | port() const const accessor of the underlying port |
port_t & | port() accessor of the underlying port |
Protected Attributes🔗
Name | |
---|---|
port_t | m_port |
TriggerHandle | m_trigger |
Friends🔗
Name | |
---|---|
class | NotificationAttorney |
Detailed Description🔗
template <typename port_t =iox::SubscriberPortUserType>
class iox::popo::BaseSubscriber;
base class for all types of subscriber
Parameters:
- port_t type of the underlying port, required for testing
Protected Types Documentation🔗
using SelfType🔗
using iox::popo::BaseSubscriber< port_t >::SelfType = BaseSubscriber<port_t>;
Only usable by the WaitSet, not for public use. Invalidates the internal triggerHandle.
Parameters:
- uniqueTriggerId the id of the corresponding trigger
Only usable by the WaitSet, not for public use
using PortType🔗
using iox::popo::BaseSubscriber< port_t >::PortType = port_t;
Public Functions Documentation🔗
function ~BaseSubscriber🔗
inline virtual ~BaseSubscriber()
function getUid🔗
inline uid_t getUid() const
uid Get the unique ID of the subscriber.
Return: The subscriber's unique ID.
function getServiceDescription🔗
inline capro::ServiceDescription getServiceDescription() const
getServiceDescription Get the service description of the subscriber.
Return: The service description.
todo #25 make this a reference.
function subscribe🔗
inline void subscribe()
subscribe Initiate subscription.
Return:
function getSubscriptionState🔗
inline SubscribeState getSubscriptionState() const
getSubscriptionState Get current subscription state.
Return: The current subscription state.
function unsubscribe🔗
inline void unsubscribe()
unsubscribe Unsubscribes if currently subscribed, otherwise do nothing.
function hasData🔗
inline bool hasData() const
Check if data is available.
Return: True if data is available.
function hasMissedData🔗
inline bool hasMissedData()
Check if data has been missed since the last call of this method.
Return: True if data has been missed.
Data may be missed due to overflowing receive queue.
function releaseQueuedData🔗
inline void releaseQueuedData()
Releases any unread queued data.
Protected Functions Documentation🔗
function BaseSubscriber🔗
inline BaseSubscriber()
function BaseSubscriber🔗
inline BaseSubscriber(
const capro::ServiceDescription & service,
const SubscriberOptions & subscriberOptions
)
function BaseSubscriber🔗
BaseSubscriber(
const BaseSubscriber & other
)
function operator=🔗
BaseSubscriber & operator=(
const BaseSubscriber &
)
function BaseSubscriber🔗
BaseSubscriber(
BaseSubscriber && rhs
)
function operator=🔗
BaseSubscriber & operator=(
BaseSubscriber && rhs
)
function takeChunk🔗
inline cxx::expected< const mepoo::ChunkHeader *, ChunkReceiveResult > takeChunk()
small helper method to unwrap the expected<optional<ChunkHeader*>>
from the tryGetChunk
method of the port
function invalidateTrigger🔗
inline void invalidateTrigger(
const uint64_t trigger
)
function enableState🔗
inline void enableState(
iox::popo::TriggerHandle && triggerHandle,
const SubscriberState subscriberState
)
Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger.
Parameters:
- triggerHandle rvalue reference to the triggerHandle. This class takes the ownership of that handle.
- subscriberState the state which should be attached
function getCallbackForIsStateConditionSatisfied🔗
inline WaitSetIsConditionSatisfiedCallback getCallbackForIsStateConditionSatisfied(
const SubscriberState subscriberState
) const
Only usable by the WaitSet, not for public use. Returns method pointer to the event corresponding hasTriggered method callback.
Parameters:
- subscriberState the state to which the hasTriggeredCallback is required
function disableState🔗
inline void disableState(
const SubscriberState subscriberState
)
Only usable by the WaitSet, not for public use. Resets the internal triggerHandle.
Parameters:
- subscriberState the state which should be detached
function enableEvent🔗
inline void enableEvent(
iox::popo::TriggerHandle && triggerHandle,
const SubscriberEvent subscriberState
)
Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger.
Parameters:
- triggerHandle rvalue reference to the triggerHandle. This class takes the ownership of that handle.
- subscriberEvent the event which should be attached
function disableEvent🔗
inline void disableEvent(
const SubscriberEvent subscriberEvent
)
Only usable by the WaitSet, not for public use. Resets the internal triggerHandle.
Parameters:
- subscriberEvent the event which should be detached
function port🔗
inline const port_t & port() const
const accessor of the underlying port
function port🔗
port_t & port()
accessor of the underlying port
Protected Attributes Documentation🔗
variable m_port🔗
port_t m_port {nullptr};
variable m_trigger🔗
TriggerHandle m_trigger;
Friends🔗
friend NotificationAttorney🔗
friend class NotificationAttorney;
Updated on 31 May 2022 at 15:29:16 CEST