iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
iox::popo::NotificationInfo Class Reference

NotificationInfo holds the state of a trigger like the pointer to the triggerOrigin, the notification id and the callback. More...

#include <iceoryx_posh/popo/notification_info.hpp>

Public Member Functions

 NotificationInfo () noexcept=default
 constructs an empty NotificationInfo
 
template<typename T , typename ContextDataType >
 NotificationInfo (T *const notificationOrigin, const uint64_t notificationId, const NotificationCallback< T, ContextDataType > &callback) noexcept
 constructs a NotificationInfo object
 
uint64_t getNotificationId () const noexcept
 returns the notification id
 
template<typename T >
bool doesOriginateFrom (T *const notificationOrigin) const noexcept
 confirms the notificationOrigin
 
template<typename T >
TgetOrigin () const noexcept
 returns the pointer to the notificationOrigin.
 
bool operator() () const noexcept
 If a callback is set it executes the callback.
 

Static Public Attributes

static constexpr uint64_t INVALID_ID = std::numeric_limits<uint64_t>::max()
 

Protected Attributes

voidm_notificationOrigin = nullptr
 
voidm_userValue = nullptr
 
uint64_t m_notificationOriginTypeHash = 0U
 
uint64_t m_notificationId = INVALID_ID
 
internal::GenericCallbackPtr_t m_callbackPtr = nullptr
 
internal::TranslationCallbackPtr_t m_callback = nullptr
 

Friends

class Trigger
 

Detailed Description

NotificationInfo holds the state of a trigger like the pointer to the triggerOrigin, the notification id and the callback.

Constructor & Destructor Documentation

◆ NotificationInfo()

iox::popo::NotificationInfo::NotificationInfo ( T *const  notificationOrigin,
const uint64_t  notificationId,
const NotificationCallback< T, ContextDataType > &  callback 
)
noexcept

constructs a NotificationInfo object

Parameters
[in]notificationOriginthe origin of the event
[in]notificationIdid of the event
[in]callbackthe callback of the event

Member Function Documentation

◆ doesOriginateFrom()

template<typename T >
bool iox::popo::NotificationInfo::doesOriginateFrom ( T *const  notificationOrigin) const
noexcept

confirms the notificationOrigin

Parameters
[in]notificationOriginthe possible notificationOrigin
Returns
true if the address is equal to the notificationOrigin, otherwise false. The empty NotificationInfo returns always false.

◆ getNotificationId()

uint64_t iox::popo::NotificationInfo::getNotificationId ( ) const
noexcept

returns the notification id

Returns
the empty NotificationInfo always returns INVALID_ID, otherwise the actual notificationId is returned which can also be INVALID_ID

◆ getOrigin()

template<typename T >
T * iox::popo::NotificationInfo::getOrigin ( ) const
noexcept

returns the pointer to the notificationOrigin.

Returns
If T equals the Triggerable type it returns the notificationOrigin. Otherwise it calls the errorHandler with a moderate error of kPOPO__EVENT_INFO_TYPE_INCONSISTENCY_IN_GET_ORIGIN and returns nullptr.

◆ operator()()

bool iox::popo::NotificationInfo::operator() ( ) const
noexcept

If a callback is set it executes the callback.

Returns
true if the callback was called, otherwise false

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