Wraps a boost::fibers::condition_variable with a boost::fibers::mutex and a condition checking function.
More...
#include <fiber_condition.h>
|
| | ~FiberCondition ()=default |
| |
| | FiberCondition ()=delete |
| |
| | FiberCondition (FiberCondition &)=delete |
| |
| | FiberCondition (const std::function< bool()> condition_function) |
| | Registers the condition function that encapsulates the condition checking. More...
|
| |
| void | Wait () const |
| | Blocks until fiber is notified and condition_function_ returns true. More...
|
| |
| template<typename Tick , typename Period > |
| bool | WaitFor (std::chrono::duration< Tick, Period > duration) const |
| | Blocks until fiber is notified and condition_function_ returns true or duration time has passed. More...
|
| |
| void | NotifyOne () const noexcept |
| | Unblocks one thread waiting for condition_variable_. More...
|
| |
| void | NotifyAll () const noexcept |
| | Unblocks all threads waiting for condition_variable_. More...
|
| |
| boost::fibers::mutex & | GetMutex () noexcept |
| | Get the mutex. More...
|
| |
Wraps a boost::fibers::condition_variable with a boost::fibers::mutex and a condition checking function.
◆ ~FiberCondition()
| encrypto::motion::FiberCondition::~FiberCondition |
( |
| ) |
|
|
default |
◆ FiberCondition() [1/3]
| encrypto::motion::FiberCondition::FiberCondition |
( |
| ) |
|
|
delete |
◆ FiberCondition() [2/3]
◆ FiberCondition() [3/3]
| encrypto::motion::FiberCondition::FiberCondition |
( |
const std::function< bool()> |
condition_function | ) |
|
|
inline |
Registers the condition function that encapsulates the condition checking.
- Parameters
-
◆ GetMutex()
| boost::fibers::mutex& encrypto::motion::FiberCondition::GetMutex |
( |
| ) |
|
|
inlinenoexcept |
Get the mutex.
- Note
- The variables that the condition function depends on shall only be modified under the locked mutex.
◆ NotifyAll()
| void encrypto::motion::FiberCondition::NotifyAll |
( |
| ) |
const |
|
inlinenoexcept |
Unblocks all threads waiting for condition_variable_.
◆ NotifyOne()
| void encrypto::motion::FiberCondition::NotifyOne |
( |
| ) |
const |
|
inlinenoexcept |
Unblocks one thread waiting for condition_variable_.
◆ Wait()
| void encrypto::motion::FiberCondition::Wait |
( |
| ) |
const |
|
inline |
Blocks until fiber is notified and condition_function_ returns true.
◆ WaitFor()
template<typename Tick , typename Period >
| bool encrypto::motion::FiberCondition::WaitFor |
( |
std::chrono::duration< Tick, Period > |
duration | ) |
const |
|
inline |
Blocks until fiber is notified and condition_function_ returns true or duration time has passed.
The documentation for this class was generated from the following file: