#include <runtime.hpp>
|
using | Callback = std::function< void(Clock::time_point)> |
|
|
virtual void | schedule (Clock::time_point tp, const Callback &cb, const void *scope=nullptr)=0 |
|
virtual void | schedule (Clock::duration d, const Callback &cb, const void *scope=nullptr)=0 |
|
virtual void | cancel (const void *scope)=0 |
|
virtual Clock::time_point | now () const =0 |
|
Runtime provides current time and enables scheduling of tasks for later execution.
All calls to Runtime and objects using the same Runtime have to be invoked from same thread!
Definition at line 15 of file runtime.hpp.
◆ Callback
using vanetza::Runtime::Callback = std::function<void(Clock::time_point)> |
◆ cancel()
virtual void vanetza::Runtime::cancel |
( |
const void * |
scope | ) |
|
|
pure virtual |
Cancel all scheduled invocations assigned to certain scope
- Parameters
-
scope | any pointer used as scope at scheduling (nullptr has no effect) |
Implemented in vanetza::ManualRuntime.
◆ now()
virtual Clock::time_point vanetza::Runtime::now |
( |
| ) |
const |
|
pure virtual |
◆ schedule() [1/2]
virtual void vanetza::Runtime::schedule |
( |
Clock::duration |
d, |
|
|
const Callback & |
cb, |
|
|
const void * |
scope = nullptr |
|
) |
| |
|
pure virtual |
Schedule callback for later invocation
- Parameters
-
d | duration from now until callback invocation |
cb | callback |
scope | associated scope pointer (used only for identification) |
Implemented in vanetza::ManualRuntime.
◆ schedule() [2/2]
virtual void vanetza::Runtime::schedule |
( |
Clock::time_point |
tp, |
|
|
const Callback & |
cb, |
|
|
const void * |
scope = nullptr |
|
) |
| |
|
pure virtual |
Schedule callback for later invocation
- Parameters
-
tp | invoke callback at this time point |
cb | callback |
scope | associated scope pointer (used only for identification) |
Implemented in vanetza::ManualRuntime.
The documentation for this class was generated from the following file: