3 #ifndef __FUTURE_OBSERVER_HPP__
4 #define __FUTURE_OBSERVER_HPP__
6 #include "gtest/gtest.h"
37 for (
auto f : futures)
49 std::future<void> &
f()
51 auto *
f =
new std::future<void>;
56 static constexpr
int MILLIS = 50;
59 std::vector<std::future<void> *> futures;
72 : milliseconds(_milliseconds), fn(std::move(_fn))
78 std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
84 std::function<bool()> fn;
Registers asynchronous operations.
Definition: FutureObserverLib.hpp:29
virtual ~FutureObserver()=default
Virtual destructor.
void shutdown()
Finalize all pending tasks and clean queue.
Definition: FutureObserverLib.hpp:35
std::future< void > & f()
Register an asynchronous operation that can be assigned thereafter.
Definition: FutureObserverLib.hpp:49
Functor wait-with-callback class.
Definition: FutureObserverLib.hpp:67
void operator()()
Wait and call stored function.
Definition: FutureObserverLib.hpp:76
observer_timer(int _milliseconds, Fn &&_fn)
Register function object and configure wait time.
Definition: FutureObserverLib.hpp:71
Contains classes related to unit testing.
Definition: groups.dox:10