|
CARLA
|
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. | |
| template<typename T2 > | |
| void | SetValue (const T2 &value) |
| Set the value and notify all waiting threads. | |
| std::optional< T > | WaitFor (time_duration timeout) |
| Wait until the next value is set. | |
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().
| std::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.
References carla::detail::thread_tag, carla::throw_exception(), and carla::time_duration::to_chrono().
|
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.