Skip to content

iox::popo::SubscriberImpl🔗

The SubscriberImpl class implements the typed subscriber API. More...

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

Inherits from iox::popo::BaseSubscriber<>

Inherited by iox::popo::Subscriber< roudi::ServiceRegistry >

Public Types🔗

Name
using typename BaseSubscriberType::PortType PortType
using SampleDeleter< PortType > SubscriberSampleDeleter

Public Functions🔗

Name
SubscriberImpl(const capro::ServiceDescription & service, const SubscriberOptions & subscriberOptions =SubscriberOptions())
SubscriberImpl(const SubscriberImpl & other)
SubscriberImpl & operator=(const SubscriberImpl & )
SubscriberImpl(SubscriberImpl && rhs)
SubscriberImpl & operator=(SubscriberImpl && rhs)
virtual ~SubscriberImpl()
cxx::expected< Sample< const T, const H >, ChunkReceiveResult > take()
Take the samples from the top of the receive queue.

Additional inherited members🔗

Public Functions inherited from iox::popo::BaseSubscriber<>

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 inherited from iox::popo::BaseSubscriber<>

Name
BaseSubscriber()
BaseSubscriber(const capro::ServiceDescription & service, const SubscriberOptions & subscriberOptions)
BaseSubscriber(const BaseSubscriber & other)
BaseSubscriber(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 inherited from iox::popo::BaseSubscriber<>

Name
port_t m_port
TriggerHandle m_trigger

Friends inherited from iox::popo::BaseSubscriber<>

Name
class NotificationAttorney
class iox::runtime::ServiceDiscovery

Detailed Description🔗

template <typename T ,
typename H  =iox::mepoo::NoUserHeader,
typename BaseSubscriberType  =BaseSubscriber<>>
class iox::popo::SubscriberImpl;

The SubscriberImpl class implements the typed subscriber API.

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

Public Types Documentation🔗

using PortType🔗

using iox::popo::SubscriberImpl< T, H, BaseSubscriberType >::PortType =  typename BaseSubscriberType::PortType;

using SubscriberSampleDeleter🔗

using iox::popo::SubscriberImpl< T, H, BaseSubscriberType >::SubscriberSampleDeleter =  SampleDeleter<PortType>;

Public Functions Documentation🔗

function SubscriberImpl🔗

explicit SubscriberImpl(
    const capro::ServiceDescription & service,
    const SubscriberOptions & subscriberOptions =SubscriberOptions()
)

function SubscriberImpl🔗

SubscriberImpl(
    const SubscriberImpl & other
)

function operator=🔗

SubscriberImpl & operator=(
    const SubscriberImpl & 
)

function SubscriberImpl🔗

SubscriberImpl(
    SubscriberImpl && rhs
)

function operator=🔗

SubscriberImpl & operator=(
    SubscriberImpl && rhs
)

function ~SubscriberImpl🔗

virtual ~SubscriberImpl()

function take🔗

cxx::expected< Sample< const T, const H >, ChunkReceiveResult > take()

Take the samples from the top of the receive queue.

Return: Either a sample or a ChunkReceiveResult.

The sample takes care of the cleanup. Don't store the raw pointer to the content of the sample, but always the whole sample.


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