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>
|
| TriggerHandle () noexcept |
|
| TriggerHandle (ConditionVariableData &conditionVariableData, const cxx::MethodCallback< void, uint64_t > resetCallback, const uint64_t uniqueTriggerId) noexcept |
| Creates a TriggerHandle. More...
|
|
| TriggerHandle (const TriggerHandle &)=delete |
|
TriggerHandle & | operator= (const TriggerHandle &)=delete |
|
| TriggerHandle (TriggerHandle &&rhs) noexcept |
|
TriggerHandle & | operator= (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. More...
|
|
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
|
|
ConditionVariableData * | getConditionVariableData () noexcept |
| returns the pointer to the ConditionVariableData
|
|
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.
◆ 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] | conditionVariableDataRef | reference to a condition variable data struct |
[in] | resetCallback | callback which will be called it goes out of scope or reset is called |
[in] | uniqueTriggerId | the unique trigger id of the Trigger which corresponds to the TriggerHandle. Usually stored in a Notifyable. It is required for the resetCallback |
◆ 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: