C++ Actor Framework 0.19
|
Coordinates any number of co-located observables and observers. More...
#include <coordinator.hpp>
Public Types | |
using | steady_time_point = std::chrono::steady_clock::time_point |
A time point of the monotonic clock. | |
Public Member Functions | |
observable_builder | make_observable () |
Returns a factory object for new observable objects on this coordinator. | |
virtual steady_time_point | steady_time ()=0 |
Returns the current time on the monotonic clock of this coordinator. | |
virtual void | delay (action what)=0 |
Delays execution of an action until all pending actions were executed. | |
template<class F > | |
void | delay_fn (F &&what) |
Delays execution of an action until all pending actions were executed. | |
virtual disposable | delay_until (steady_time_point abs_time, action what)=0 |
Delays execution of an action with an absolute timeout. | |
template<class F > | |
disposable | delay_until_fn (steady_time_point abs_time, F &&what) |
Delays execution of an action until all pending actions were executed. | |
disposable | delay_for (timespan rel_time, action what) |
Delays execution of an action with a relative timeout. | |
template<class F > | |
void | delay_for_fn (timespan rel_time, F &&what) |
Delays execution of an action with a relative timeout. | |
![]() | |
virtual void | ref_execution_context () const noexcept=0 |
Increases the reference count of the execution_context. | |
virtual void | deref_execution_context () const noexcept=0 |
Decreases the reference count of the execution context and destroys the object if necessary. | |
virtual void | schedule (action what)=0 |
Schedules what to run on the event loop of the execution context. | |
template<class F > | |
void | schedule_fn (F &&what) |
Schedules what to run on the event loop of the execution context. | |
virtual void | watch (disposable what)=0 |
Asks the coordinator to keep its event loop running until what becomes disposed since it depends on external events or produces events that are visible to outside observers. | |
Related Functions | |
(Note that these are not member functions.) | |
using | coordinator_ptr = intrusive_ptr< coordinator > |
![]() | |
using | execution_context_ptr = intrusive_ptr< execution_context > |
void | intrusive_ptr_add_ref (const execution_context *ptr) noexcept |
void | intrusive_ptr_release (const execution_context *ptr) noexcept |
Coordinates any number of co-located observables and observers.
The co-located objects never need to synchronize calls to other co-located objects since the coordinator guarantees synchronous execution.
|
pure virtual |
Delays execution of an action until all pending actions were executed.
May call schedule
.
what | The action for delayed execution. |
void caf::flow::coordinator::delay_fn | ( | F && | what | ) |
Delays execution of an action until all pending actions were executed.
May call schedule
.
what | The action for delayed execution. |
disposable caf::flow::coordinator::delay_for | ( | timespan | rel_time, |
action | what | ||
) |
Delays execution of an action with a relative timeout.
rel_time | The relative time when this action should take place. |
what | The action for delayed execution. |
void caf::flow::coordinator::delay_for_fn | ( | timespan | rel_time, |
F && | what | ||
) |
Delays execution of an action with a relative timeout.
rel_time | The relative time when this action should take place. |
what | The action for delayed execution. |
|
pure virtual |
Delays execution of an action with an absolute timeout.
abs_time | The absolute time when this action should take place. |
what | The action for delayed execution. |
disposable caf::flow::coordinator::delay_until_fn | ( | steady_time_point | abs_time, |
F && | what | ||
) |
Delays execution of an action until all pending actions were executed.
May call schedule
.
what | The action for delayed execution. |