12#ifndef ROC_CTL_CONTROL_LOOP_H_
13#define ROC_CTL_CONTROL_LOOP_H_
51 friend class ControlLoop;
65 friend class ControlLoop;
67 enum Phase { Phase_Prologue, Phase_Epilogue };
80 friend class ControlLoop;
82 enum Phase { Phase_Prologue, Phase_Epilogue };
96 friend class ControlLoop;
98 enum Phase { Phase_Prologue, Phase_Epilogue };
114 friend class ControlLoop;
128 friend class ControlLoop;
143 friend class ControlLoop;
157 friend class ControlLoop;
170 friend class ControlLoop;
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Base class for control endpoints.
Intrusive doubly-linked list.
Base class for non-copyable objects.
Shared ownership intrusive pointer.
AttachSink(EndpointHandle endpoint, const address::EndpointUri &uri, pipeline::SenderLoop &sink)
Set task parameters.
AttachSource(EndpointHandle endpoint, const address::EndpointUri &uri, pipeline::ReceiverLoop &source)
Set task parameters.
BindEndpoint(EndpointHandle endpoint, const address::EndpointUri &uri)
Set task parameters.
ConnectEndpoint(EndpointHandle endpoint, const address::EndpointUri &uri)
Set task parameters.
CreateEndpoint(address::Interface iface, address::Protocol proto)
Set task parameters.
EndpointHandle get_handle() const
Get handle of the created endpoint.
DeleteEndpoint(EndpointHandle endpoint)
Set task parameters.
DetachSink(EndpointHandle endpoint, pipeline::SenderLoop &sink)
Set task parameters.
DetachSource(EndpointHandle endpoint, pipeline::ReceiverLoop &source)
Set task parameters.
PipelineProcessing(pipeline::PipelineLoop &pipeline)
Set task parameters.
Subclasses for specific tasks.
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...
ControlLoop(netio::NetworkLoop &network_loop, core::IArena &arena)
Initialize.
ROC_ATTR_NODISCARD bool schedule_and_wait(ControlTask &task)
Enqueue a task for asynchronous execution and wait until it completes. Combines schedule() and wait()...
bool is_valid() const
Check if the object was successfully constructed.
void wait(ControlTask &task)
Wait until the task is completed.
void async_cancel(ControlTask &task)
Try to cancel scheduled task execution, if it's not executed yet.
struct EndpointHandle * EndpointHandle
Opaque endpoint handle.
void schedule(ControlTask &task, IControlTaskCompleter *completer)
Enqueue a task for asynchronous execution as soon as possible. completer will be invoked on control t...
Base class for control tasks.
ControlTask(ControlTaskResult(E::*task_func)(ControlTask &))
Initialize task.
Control task completion handler.
Network event loop thread.
Base class for task-based pipelines.
Intrusive doubly-linked list.
int64_t nanoseconds_t
Nanoseconds.
Control tasks event loop.
ControlTaskResult
Control task execution result.
Sender and receiver processing pipelines.
Network event loop thread.
Base class for pipelines.
Shared ownership intrusive pointer.