Lunchbox
1.10.0
|
A monitor primitive. More...
#include <monitor.h>
Public Member Functions | |
Monitor () | |
Construct a new monitor with a default value of 0. More... | |
Monitor (const T &value) | |
Construct a new monitor with a given default value. More... | |
Monitor (const Monitor< T > &from) | |
Ctor initializing with the given monitor value. More... | |
~Monitor () | |
Destructs the monitor. More... | |
template<> | |
Monitor< bool > & | operator++ () |
template<> | |
Monitor< bool > & | operator-- () |
template<> | |
Monitor< bool > & | operator|= (const bool &value) |
Changing the monitored value. | |
Monitor & | operator++ () |
Increment the monitored value, prefix only. More... | |
Monitor & | operator-- () |
Decrement the monitored value, prefix only. More... | |
Monitor & | operator= (const T &value) |
Assign a new value. More... | |
const Monitor & | operator= (const Monitor< T > &from) |
Assign a new value. More... | |
Monitor & | operator|= (const T &value) |
Perform an or operation on the value. More... | |
Monitor & | operator&= (const T &value) |
Perform an and operation on the value. More... | |
void | set (const T &value) |
Set a new value. More... | |
Monitor the value. | |
const T & | waitEQ (const T &value) const |
Block until the monitor has the given value. More... | |
const T | waitNE (const T &value) const |
Block until the monitor has not the given value. More... | |
const T | waitNE (const T &v1, const T &v2) const |
Block until the monitor has none of the given values. More... | |
const T | waitGE (const T &value) const |
Block until the monitor has a value greater or equal to the given value. More... | |
const T | waitLE (const T &value) const |
Block until the monitor has a value less or equal to the given value. More... | |
Monitor the value with a timeout. | |
bool | timedWaitEQ (const T &value, const uint32_t timeout) const |
Block until the monitor has the given value. More... | |
bool | timedWaitGE (const T &value, const uint32_t timeout) const |
Block until the monitor has a value greater or equal to the given value. More... | |
bool | timedWaitNE (const T &value, const uint32_t timeout) const |
Block until the monitor has not the given value. More... | |
Comparison Operators. @version 1.0 | |
bool | operator== (const T &value) const |
bool | operator!= (const T &value) const |
bool | operator< (const T &value) const |
bool | operator> (const T &value) const |
bool | operator<= (const T &value) const |
bool | operator>= (const T &value) const |
bool | operator== (const Monitor< T > &rhs) const |
bool | operator!= (const Monitor< T > &rhs) const |
bool | operator< (const Monitor< T > &rhs) const |
bool | operator> (const Monitor< T > &rhs) const |
bool | operator<= (const Monitor< T > &rhs) const |
bool | operator>= (const Monitor< T > &rhs) const |
operator bool_t () | |
Data Access. | |
const T & | operator-> () const |
const T & | get () const |
T | operator+ (const T &value) const |
T | operator| (const T &value) const |
T | operator& (const T &value) const |
A monitor primitive.
A monitor has a value, which can be monitored to reach a certain state. The caller is blocked until the condition is fulfilled. The concept is similar to a pthread condition, with more usage convenience.
Example:
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
Definition at line 362 of file monitor.h.
Referenced by lunchbox::operator<<().
|
inline |
|
inline |
|
inline |
Perform an and operation on the value.
Definition at line 104 of file monitor.h.
References lunchbox::Condition::broadcast().
|
inline |
|
inline |
Increment the monitored value, prefix only.
Definition at line 63 of file monitor.h.
References lunchbox::Condition::broadcast().
|
inline |
Decrement the monitored value, prefix only.
Definition at line 72 of file monitor.h.
References lunchbox::Condition::broadcast().
|
inline |
|
inline |
Assign a new value.
Definition at line 81 of file monitor.h.
References lunchbox::Monitor< T >::set().
|
inline |
Assign a new value.
Definition at line 88 of file monitor.h.
References lunchbox::Monitor< T >::set().
|
inline |
|
inline |
Perform an or operation on the value.
Definition at line 95 of file monitor.h.
References lunchbox::Condition::broadcast().
|
inline |
Set a new value.
Definition at line 113 of file monitor.h.
References lunchbox::Condition::broadcast().
Referenced by lunchbox::Monitor< T >::operator=().
|
inline |
Block until the monitor has the given value.
value | the exact value to monitor. |
timeout | the timeout in milliseconds to wait for the value. |
Definition at line 222 of file monitor.h.
References lunchbox::Condition::timedWait().
|
inline |
Block until the monitor has a value greater or equal to the given value.
value | the exact value to monitor. |
timeout | the timeout in milliseconds to wait for the value. |
Definition at line 245 of file monitor.h.
References lunchbox::Condition::timedWait().
|
inline |
Block until the monitor has not the given value.
value | the exact value to monitor. |
timeout | the timeout in milliseconds to wait for not the value. |
Definition at line 268 of file monitor.h.
References lunchbox::Condition::timedWait().
|
inline |
Block until the monitor has the given value.
Definition at line 128 of file monitor.h.
References lunchbox::Condition::wait().
|
inline |
Block until the monitor has a value greater or equal to the given value.
Definition at line 181 of file monitor.h.
References lunchbox::Condition::wait().
|
inline |
Block until the monitor has a value less or equal to the given value.
Definition at line 199 of file monitor.h.
References lunchbox::Condition::wait().
|
inline |
Block until the monitor has not the given value.
Definition at line 143 of file monitor.h.
References lunchbox::Condition::wait().
|
inline |
Block until the monitor has none of the given values.
Definition at line 162 of file monitor.h.
References lunchbox::Condition::wait().