iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
iox::popo::BaseSubscriber< port_t > Class Template Reference

base class for all types of subscriber More...

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

Inheritance diagram for iox::popo::BaseSubscriber< port_t >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::BaseSubscriber< port_t >:
Collaboration graph
[legend]

Public Member Functions

uid_t getUid () const noexcept
 uid Get the unique ID of the subscriber.
 
capro::ServiceDescription getServiceDescription () const noexcept
 getServiceDescription Get the service description of the subscriber.
 
void subscribe () noexcept
 subscribe Initiate subscription.
 
SubscribeState getSubscriptionState () const noexcept
 getSubscriptionState Get current subscription state.
 
void unsubscribe () noexcept
 unsubscribe Unsubscribes if currently subscribed, otherwise do nothing.
 
bool hasData () const noexcept
 Check if data is available.
 
bool hasMissedData () noexcept
 Check if data has been missed since the last call of this method.
 
void releaseQueuedData () noexcept
 Releases any unread queued data.
 

Protected Types

using SelfType = BaseSubscriber< port_t >
 Only usable by the WaitSet, not for public use. Invalidates the internal triggerHandle.
 
using PortType = port_t
 

Protected Member Functions

 BaseSubscriber (const capro::ServiceDescription &service, const SubscriberOptions &subscriberOptions) noexcept
 
 BaseSubscriber (const BaseSubscriber &other)=delete
 
BaseSubscriberoperator= (const BaseSubscriber &)=delete
 
 BaseSubscriber (BaseSubscriber &&rhs)=delete
 
BaseSubscriberoperator= (BaseSubscriber &&rhs)=delete
 
cxx::expected< const mepoo::ChunkHeader *, ChunkReceiveResulttakeChunk () noexcept
 small helper method to unwrap the expected<optional<ChunkHeader*>> from the tryGetChunk method of the port
 
void invalidateTrigger (const uint64_t trigger) noexcept
 
void enableState (iox::popo::TriggerHandle &&triggerHandle, const SubscriberState subscriberState) noexcept
 Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger.
 
WaitSetIsConditionSatisfiedCallback getCallbackForIsStateConditionSatisfied (const SubscriberState subscriberState) const noexcept
 Only usable by the WaitSet, not for public use. Returns method pointer to the event corresponding hasTriggered method callback.
 
void disableState (const SubscriberState subscriberState) noexcept
 Only usable by the WaitSet, not for public use. Resets the internal triggerHandle.
 
void enableEvent (iox::popo::TriggerHandle &&triggerHandle, const SubscriberEvent subscriberState) noexcept
 Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger.
 
void disableEvent (const SubscriberEvent subscriberEvent) noexcept
 Only usable by the WaitSet, not for public use. Resets the internal triggerHandle.
 
const port_tport () const noexcept
 const accessor of the underlying port
 
port_tport () noexcept
 accessor of the underlying port
 

Protected Attributes

port_t m_port {nullptr}
 
TriggerHandle m_trigger
 

Friends

class NotificationAttorney
 
class iox::runtime::ServiceDiscovery
 

Detailed Description

template<typename port_t = iox::SubscriberPortUserType>
class iox::popo::BaseSubscriber< port_t >

base class for all types of subscriber

Parameters
[in]port_ttype of the underlying port, required for testing
Note
Not intended for public usage! Use the Subscriber or UntypedSubscriber instead!

Member Typedef Documentation

◆ SelfType

template<typename port_t = iox::SubscriberPortUserType>
using iox::popo::BaseSubscriber< port_t >::SelfType = BaseSubscriber<port_t>
protected

Only usable by the WaitSet, not for public use. Invalidates the internal triggerHandle.

Parameters
[in]uniqueTriggerIdthe id of the corresponding trigger

Only usable by the WaitSet, not for public use

Member Function Documentation

◆ disableEvent()

template<typename port_t = iox::SubscriberPortUserType>
void iox::popo::BaseSubscriber< port_t >::disableEvent ( const SubscriberEvent  subscriberEvent)
protectednoexcept

Only usable by the WaitSet, not for public use. Resets the internal triggerHandle.

Parameters
[in]subscriberEventthe event which should be detached

◆ disableState()

template<typename port_t = iox::SubscriberPortUserType>
void iox::popo::BaseSubscriber< port_t >::disableState ( const SubscriberState  subscriberState)
protectednoexcept

Only usable by the WaitSet, not for public use. Resets the internal triggerHandle.

Parameters
[in]subscriberStatethe state which should be detached

◆ enableEvent()

template<typename port_t = iox::SubscriberPortUserType>
void iox::popo::BaseSubscriber< port_t >::enableEvent ( iox::popo::TriggerHandle &&  triggerHandle,
const SubscriberEvent  subscriberState 
)
protectednoexcept

Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger.

Parameters
[in]triggerHandlervalue reference to the triggerHandle. This class takes the ownership of that handle.
[in]subscriberEventthe event which should be attached

◆ enableState()

template<typename port_t = iox::SubscriberPortUserType>
void iox::popo::BaseSubscriber< port_t >::enableState ( iox::popo::TriggerHandle &&  triggerHandle,
const SubscriberState  subscriberState 
)
protectednoexcept

Only usable by the WaitSet, not for public use. Attaches the triggerHandle to the internal trigger.

Parameters
[in]triggerHandlervalue reference to the triggerHandle. This class takes the ownership of that handle.
[in]subscriberStatethe state which should be attached

◆ getCallbackForIsStateConditionSatisfied()

template<typename port_t = iox::SubscriberPortUserType>
WaitSetIsConditionSatisfiedCallback iox::popo::BaseSubscriber< port_t >::getCallbackForIsStateConditionSatisfied ( const SubscriberState  subscriberState) const
protectednoexcept

Only usable by the WaitSet, not for public use. Returns method pointer to the event corresponding hasTriggered method callback.

Parameters
[in]subscriberStatethe state to which the hasTriggeredCallback is required

◆ getServiceDescription()

template<typename port_t = iox::SubscriberPortUserType>
capro::ServiceDescription iox::popo::BaseSubscriber< port_t >::getServiceDescription ( ) const
noexcept

getServiceDescription Get the service description of the subscriber.

Returns
The service description.

◆ getSubscriptionState()

template<typename port_t = iox::SubscriberPortUserType>
SubscribeState iox::popo::BaseSubscriber< port_t >::getSubscriptionState ( ) const
noexcept

getSubscriptionState Get current subscription state.

Returns
The current subscription state.

◆ getUid()

template<typename port_t = iox::SubscriberPortUserType>
uid_t iox::popo::BaseSubscriber< port_t >::getUid ( ) const
noexcept

uid Get the unique ID of the subscriber.

Returns
The subscriber's unique ID.

◆ hasData()

template<typename port_t = iox::SubscriberPortUserType>
bool iox::popo::BaseSubscriber< port_t >::hasData ( ) const
noexcept

Check if data is available.

Returns
True if data is available.

◆ hasMissedData()

template<typename port_t = iox::SubscriberPortUserType>
bool iox::popo::BaseSubscriber< port_t >::hasMissedData ( )
noexcept

Check if data has been missed since the last call of this method.

Returns
True if data has been missed.

Data may be missed due to overflowing receive queue.

◆ subscribe()

template<typename port_t = iox::SubscriberPortUserType>
void iox::popo::BaseSubscriber< port_t >::subscribe ( )
noexcept

subscribe Initiate subscription.

Returns

The documentation for this class was generated from the following file: