Skip to content

iox::popo::BaseSubscriber🔗

base class for all types of subscriber More...

#include <iceoryx_posh/internal/popo/base_subscriber.hpp>

Inherited by iox::popo::SubscriberImpl< T, mepoo::NoUserHeader >, iox::popo::SubscriberImpl< T, H, BaseSubscriberType >, iox::popo::UntypedSubscriberImpl< BaseSubscriberType >

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
class iox::runtime::ServiceDiscovery

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

Note: Not intended for public usage! Use the [Subscriber](/v2.0.2/API-reference/posh/Classes/classiox_1_1popo_1_1Subscriber/) or [UntypedSubscriber](/v2.0.2/API-reference/posh/Classes/classiox_1_1popo_1_1UntypedSubscriber/) instead!

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🔗

virtual ~BaseSubscriber()

function getUid🔗

uid_t getUid() const

uid Get the unique ID of the subscriber.

Return: The subscriber's unique ID.

function getServiceDescription🔗

capro::ServiceDescription getServiceDescription() const

getServiceDescription Get the service description of the subscriber.

Return: The service description.

function subscribe🔗

void subscribe()

subscribe Initiate subscription.

Return:

function getSubscriptionState🔗

SubscribeState getSubscriptionState() const

getSubscriptionState Get current subscription state.

Return: The current subscription state.

function unsubscribe🔗

void unsubscribe()

unsubscribe Unsubscribes if currently subscribed, otherwise do nothing.

function hasData🔗

bool hasData() const

Check if data is available.

Return: True if data is available.

function hasMissedData🔗

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🔗

void releaseQueuedData()

Releases any unread queued data.

Protected Functions Documentation🔗

function BaseSubscriber🔗

BaseSubscriber()

function BaseSubscriber🔗

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🔗

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🔗

void invalidateTrigger(
    const uint64_t trigger
)

function enableState🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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(
    NotificationAttorney 
);

friend iox::runtime::ServiceDiscovery🔗

friend class iox::runtime::ServiceDiscovery(
    iox::runtime::ServiceDiscovery 
);

Updated on 31 May 2022 at 11:34:55 CEST