iceoryx_doc  1.0.1
Public Types | Public Member Functions | Protected Member Functions | List of all members
iox::popo::ConditionListener Class Reference

ConditionListener allows one to wait using a shared memory condition variable. More...

#include <condition_listener.hpp>

Public Types

using NotificationVector_t = cxx::vector< cxx::BestFittingType_t< MAX_NUMBER_OF_NOTIFIERS_PER_CONDITION_VARIABLE >, MAX_NUMBER_OF_NOTIFIERS_PER_CONDITION_VARIABLE >
 

Public Member Functions

 ConditionListener (ConditionVariableData &condVarData) noexcept
 
 ConditionListener (const ConditionListener &rhs)=delete
 
 ConditionListener (ConditionListener &&rhs) noexcept=delete
 
ConditionListeneroperator= (const ConditionListener &rhs)=delete
 
ConditionListeneroperator= (ConditionListener &&rhs) noexcept=delete
 
bool wasNotified () const noexcept
 Was the ConditionListener notified by a ConditionNotifier? More...
 
void destroy () noexcept
 Used in classes to signal a thread which waits in wait() to return and stop working. Destroy will send an empty notification to wait() and after this call wait() turns into a non blocking call which always returns an empty vector.
 
NotificationVector_t wait () noexcept
 returns a sorted vector of indices of active notifications; blocking if ConditionVariableData was not notified unless destroy() was called before. The indices of active notifications are never empty unless destroy() was called, then it's always empty. More...
 
NotificationVector_t timedWait (const units::Duration &timeToWait) noexcept
 returns a sorted vector of indices of active notifications; blocking for the specified time if ConditionVariableData was not notified unless destroy() was called before. The indices of active notifications can be empty (spurious wakeups). When destroy() was called then it is always empty. More...
 

Protected Member Functions

const ConditionVariableDatagetMembers () const noexcept
 
ConditionVariableDatagetMembers () noexcept
 

Detailed Description

ConditionListener allows one to wait using a shared memory condition variable.

Member Function Documentation

◆ timedWait()

NotificationVector_t iox::popo::ConditionListener::timedWait ( const units::Duration &  timeToWait)
noexcept

returns a sorted vector of indices of active notifications; blocking for the specified time if ConditionVariableData was not notified unless destroy() was called before. The indices of active notifications can be empty (spurious wakeups). When destroy() was called then it is always empty.

Parameters
[in]timeToWaitduration how long at most this method should wait
Returns
a sorted vector of active notifications

◆ wait()

NotificationVector_t iox::popo::ConditionListener::wait ( )
noexcept

returns a sorted vector of indices of active notifications; blocking if ConditionVariableData was not notified unless destroy() was called before. The indices of active notifications are never empty unless destroy() was called, then it's always empty.

Returns
a sorted vector of active notifications

◆ wasNotified()

bool iox::popo::ConditionListener::wasNotified ( ) const
noexcept

Was the ConditionListener notified by a ConditionNotifier?

Returns
true if it was notified otherwise false

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