iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iox::popo::TriggerHandle Class Reference

TriggerHandle is threadsafe without restrictions in a single process. Not qualified for inter process usage. The TriggerHandle is generated by a Notifyable like the WaitSet and handed out to the user when they acquire a trigger. The TriggerHandle corresponds with an internal Trigger and is used to signal an event via the trigger method. When it goes out of scope it cleans up the corresponding trigger in the Notifyable. More...

#include <iceoryx_posh/popo/trigger_handle.hpp>

Public Member Functions

 TriggerHandle () noexcept
 
 TriggerHandle (ConditionVariableData &conditionVariableData, const cxx::MethodCallback< void, uint64_t > resetCallback, const uint64_t uniqueTriggerId) noexcept
 Creates a TriggerHandle.
 
 TriggerHandle (const TriggerHandle &)=delete
 
TriggerHandleoperator= (const TriggerHandle &)=delete
 
 TriggerHandle (TriggerHandle &&rhs) noexcept
 
TriggerHandleoperator= (TriggerHandle &&rhs) noexcept
 
 operator bool () const noexcept
 returns true if the TriggerHandle is valid otherwise false. A TriggerHandle is valid if m_conditionVariableDataPtr != nullptr.
 
bool isValid () const noexcept
 returns true if the TriggerHandle is valid otherwise false. A TriggerHandle is valid if m_conditionVariableDataPtr != nullptr.
 
bool wasTriggered () const noexcept
 Returns true when the TriggerHandle was triggered.
 
void trigger () noexcept
 triggers the Trigger and informs the Notifyable which verifies that the Trigger was triggered by calling the hasTriggeredCallback
 
void reset () noexcept
 calls the resetCallback and invalidates the TriggerHandle
 
void invalidate () noexcept
 invalidates the TriggerHandle without calling the reset callback
 
uint64_t getUniqueId () const noexcept
 returns the uniqueTriggerId
 
ConditionVariableDatagetConditionVariableData () noexcept
 returns the pointer to the ConditionVariableData
 

Detailed Description

TriggerHandle is threadsafe without restrictions in a single process. Not qualified for inter process usage. The TriggerHandle is generated by a Notifyable like the WaitSet and handed out to the user when they acquire a trigger. The TriggerHandle corresponds with an internal Trigger and is used to signal an event via the trigger method. When it goes out of scope it cleans up the corresponding trigger in the Notifyable.

Constructor & Destructor Documentation

◆ TriggerHandle() [1/2]

iox::popo::TriggerHandle::TriggerHandle ( )
noexcept
Note
explicitly implemented for MSVC and QNX

◆ TriggerHandle() [2/2]

iox::popo::TriggerHandle::TriggerHandle ( ConditionVariableData conditionVariableData,
const cxx::MethodCallback< void, uint64_t resetCallback,
const uint64_t  uniqueTriggerId 
)
noexcept

Creates a TriggerHandle.

Parameters
[in]conditionVariableDataRefreference to a condition variable data struct
[in]resetCallbackcallback which will be called it goes out of scope or reset is called
[in]uniqueTriggerIdthe unique trigger id of the Trigger which corresponds to the TriggerHandle. Usually stored in a Notifyable. It is required for the resetCallback

Member Function Documentation

◆ wasTriggered()

bool iox::popo::TriggerHandle::wasTriggered ( ) const
noexcept

Returns true when the TriggerHandle was triggered.

Note
The TriggerHandle wasTriggered state is set to false again after the underlying ConditionListener gathered all events.

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