Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Control loop thread. More...
#include <control_loop.h>
Classes | |
class | Tasks |
Subclasses for specific tasks. More... | |
Public Types | |
typedef struct EndpointHandle * | EndpointHandle |
Opaque endpoint handle. More... | |
Public Member Functions | |
ControlLoop (netio::NetworkLoop &network_loop, core::IArena &arena) | |
Initialize. More... | |
bool | is_valid () const |
Check if the object was successfully constructed. More... | |
void | schedule (ControlTask &task, IControlTaskCompleter *completer) |
Enqueue a task for asynchronous execution as soon as possible. completer will be invoked on control thread when the task completes. More... | |
void | schedule_at (ControlTask &task, core::nanoseconds_t deadline, IControlTaskCompleter *completer) |
Enqueue a task for asynchronous execution at given point of time. deadline defines the absolute point of time when to execute the task. completer will be invoked on control thread when the task completes. More... | |
ROC_ATTR_NODISCARD bool | schedule_and_wait (ControlTask &task) |
Enqueue a task for asynchronous execution and wait until it completes. Combines schedule() and wait() calls. More... | |
void | async_cancel (ControlTask &task) |
Try to cancel scheduled task execution, if it's not executed yet. More... | |
void | wait (ControlTask &task) |
Wait until the task is completed. More... | |
Control loop thread.
Definition at line 33 of file control_loop.h.
typedef struct EndpointHandle* roc::ctl::ControlLoop::EndpointHandle |
Opaque endpoint handle.
Definition at line 36 of file control_loop.h.
roc::ctl::ControlLoop::ControlLoop | ( | netio::NetworkLoop & | network_loop, |
core::IArena & | arena | ||
) |
Initialize.
void roc::ctl::ControlLoop::async_cancel | ( | ControlTask & | task | ) |
Try to cancel scheduled task execution, if it's not executed yet.
bool roc::ctl::ControlLoop::is_valid | ( | ) | const |
Check if the object was successfully constructed.
void roc::ctl::ControlLoop::schedule | ( | ControlTask & | task, |
IControlTaskCompleter * | completer | ||
) |
Enqueue a task for asynchronous execution as soon as possible. completer
will be invoked on control thread when the task completes.
ROC_ATTR_NODISCARD bool roc::ctl::ControlLoop::schedule_and_wait | ( | ControlTask & | task | ) |
Enqueue a task for asynchronous execution and wait until it completes. Combines schedule() and wait() calls.
void roc::ctl::ControlLoop::schedule_at | ( | ControlTask & | task, |
core::nanoseconds_t | deadline, | ||
IControlTaskCompleter * | completer | ||
) |
Enqueue a task for asynchronous execution at given point of time. deadline
defines the absolute point of time when to execute the task. completer
will be invoked on control thread when the task completes.
void roc::ctl::ControlLoop::wait | ( | ControlTask & | task | ) |
Wait until the task is completed.