|
OpenWalnut
1.2.5
|
Class to encapsulate boost::condition_variable_any. More...
#include <WCondition.h>
Inheritance diagram for WCondition:Public Types | |
| typedef boost::shared_ptr < WCondition > | SPtr |
| Shared pointer type for WCondition. | |
| typedef boost::shared_ptr < const WCondition > | ConstSPtr |
| Const shared pointer type for WCondition. | |
| typedef boost::function0< void > | t_ConditionNotifierType |
| Type used for signalling condition changes. | |
Public Member Functions | |
| WCondition () | |
| Default constructor. | |
| virtual | ~WCondition () |
| Destructor. | |
| virtual void | wait () const |
| Wait for the condition. | |
| virtual void | notify () |
| Notifies all waiting threads. | |
| boost::signals2::connection | subscribeSignal (t_ConditionNotifierType notifier) |
| Subscribes a specified function to be notified on condition change. | |
Protected Types | |
| typedef boost::signals2::signal< void(void)> | t_ConditionSignalType |
| Type used for condition notification. | |
Protected Attributes | |
| t_ConditionSignalType | signal_ConditionFired |
| Signal getting fired whenever the condition fires. | |
| boost::condition_variable_any | m_condition |
| The condition. | |
| boost::shared_mutex | m_mutex |
| The mutex used for the condition. | |
Friends | |
| class | WCondition_test |
Class to encapsulate boost::condition_variable_any.
You may use it to efficiently wait for events (a condition comes true). It is a very simple implementation. It might be extended easily. Timed wait functions and so on.
Definition at line 39 of file WCondition.h.
| typedef boost::shared_ptr< const WCondition > WCondition::ConstSPtr |
Const shared pointer type for WCondition.
Definition at line 51 of file WCondition.h.
| typedef boost::shared_ptr< WCondition > WCondition::SPtr |
Shared pointer type for WCondition.
Definition at line 46 of file WCondition.h.
| typedef boost::function0< void > WCondition::t_ConditionNotifierType |
Type used for signalling condition changes.
Definition at line 76 of file WCondition.h.
|
protected |
Type used for condition notification.
Definition at line 92 of file WCondition.h.
| WCondition::WCondition | ( | ) |
Default constructor.
Definition at line 27 of file WCondition.cpp.
|
virtual |
Destructor.
Definition at line 32 of file WCondition.cpp.
|
virtual |
Notifies all waiting threads.
Reimplemented in WConditionOneShot.
Definition at line 42 of file WCondition.cpp.
References m_condition, and signal_ConditionFired.
Referenced by WConditionSet::conditionFired(), WPropertyObserver::propertyUpdated(), Callable::threadMain(), and WModuleInputConnector::WModuleInputConnector().
| boost::signals2::connection WCondition::subscribeSignal | ( | t_ConditionNotifierType | notifier | ) |
Subscribes a specified function to be notified on condition change.
| notifier | the notifier function |
Definition at line 48 of file WCondition.cpp.
References signal_ConditionFired.
Referenced by WFlagTest::testChangeCondition().
|
virtual |
Wait for the condition.
Sets the calling thread asleep.
Reimplemented in WConditionSet, and WConditionOneShot.
Definition at line 37 of file WCondition.cpp.
References m_condition, and m_mutex.
Referenced by WConditionTest::testWaitNotify().
|
mutableprotected |
|
mutableprotected |
The mutex used for the condition.
Definition at line 107 of file WCondition.h.
Referenced by WConditionOneShot::wait(), wait(), and WConditionOneShot::WConditionOneShot().
|
protected |
Signal getting fired whenever the condition fires.
Definition at line 97 of file WCondition.h.
Referenced by notify(), and subscribeSignal().
1.8.1