This class is meant to be used similar to a shared future, but the value can be set any number of times. More...
#include <RecurrentSharedFuture.h>
Classes | |
struct | mapped_type |
Public Types | |
using | SharedException = detail::SharedException |
Public Member Functions | |
template<typename ExceptionT > | |
void | SetException (ExceptionT &&exception) |
Set a exception, this exception will be thrown on all the threads waiting. More... | |
template<typename T2 > | |
void | SetValue (const T2 &value) |
Set the value and notify all waiting threads. More... | |
boost::optional< T > | WaitFor (time_duration timeout) |
Wait until the next value is set. More... | |
Private Attributes | |
std::condition_variable | _cv |
std::map< const char *, mapped_type > | _map |
std::mutex | _mutex |
This class is meant to be used similar to a shared future, but the value can be set any number of times.
Definition at line 43 of file RecurrentSharedFuture.h.
using carla::RecurrentSharedFuture< T >::SharedException = detail::SharedException |
Definition at line 46 of file RecurrentSharedFuture.h.
void carla::RecurrentSharedFuture< T >::SetException | ( | ExceptionT && | exception | ) |
Set a exception, this exception will be thrown on all the threads waiting.
Definition at line 139 of file RecurrentSharedFuture.h.
Referenced by TEST().
void carla::RecurrentSharedFuture< T >::SetValue | ( | const T2 & | value | ) |
Set the value and notify all waiting threads.
Definition at line 128 of file RecurrentSharedFuture.h.
Referenced by TEST().
boost::optional< T > carla::RecurrentSharedFuture< T >::WaitFor | ( | time_duration | timeout | ) |
Wait until the next value is set.
Any number of threads can be waiting simultaneously.
Definition at line 113 of file RecurrentSharedFuture.h.
Referenced by TEST().
|
private |
Definition at line 70 of file RecurrentSharedFuture.h.
|
private |
Definition at line 77 of file RecurrentSharedFuture.h.
|
private |
Definition at line 68 of file RecurrentSharedFuture.h.