VLink  2.0.0
A high-performance communication middleware
vlink::Schedule Struct Referencefinal

Non-instantiable container for task-scheduling types and the process() entry points. More...

#include <schedule.h>

Collaboration diagram for vlink::Schedule:

Classes

struct  Config
 Scheduling parameters captured at the call to exec_task(). More...
 
class  RetStatus
 RAII handle returned by exec_task() when the wrapped callback returns bool. More...
 
class  Status
 RAII handle returned by exec_task() when the wrapped callback returns void. More...
 

Public Types

using Callback = MoveFunction< void()>
 Callback signature for void tasks and lifecycle hooks. More...
 
using RetCallback = MoveFunction< bool()>
 Callback signature for tasks that return a boolean indicating success. More...
 
using CatchCallback = MoveFunction< void(std::exception &)>
 Callback signature for exception handlers attached via on_catch(). More...
 

Public Member Functions

 Schedule ()=delete
 
 Schedule (const Schedule &)=delete
 
Scheduleoperator= (const Schedule &)=delete
 
 Schedule (Schedule &&)=delete
 
Scheduleoperator= (Schedule &&)=delete
 

Static Public Member Functions

static Status process (const Config &config, Callback &&callback, Callback &wrapper_callback)
 Wraps a void callback in a Config envelope and produces the task wrapper for the dispatcher. More...
 
static RetStatus process_with_ret (const Config &config, RetCallback &&callback, Callback &wrapper_callback)
 Wraps a bool-returning callback in a Config envelope and produces the task wrapper for the dispatcher. More...
 

Detailed Description

Non-instantiable container for task-scheduling types and the process() entry points.

Provides the Config envelope, the Status / RetStatus handles, and the process / process_with_ret static functions used by MessageLoop::exec_task().

Member Typedef Documentation

◆ Callback

Callback signature for void tasks and lifecycle hooks.

◆ CatchCallback

using vlink::Schedule::CatchCallback = MoveFunction<void(std::exception&)>

Callback signature for exception handlers attached via on_catch().

◆ RetCallback

Callback signature for tasks that return a boolean indicating success.

Constructor & Destructor Documentation

◆ Schedule() [1/3]

vlink::Schedule::Schedule ( )
delete

◆ Schedule() [2/3]

vlink::Schedule::Schedule ( const Schedule )
delete

◆ Schedule() [3/3]

vlink::Schedule::Schedule ( Schedule &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

Schedule& vlink::Schedule::operator= ( const Schedule )
delete

◆ operator=() [2/2]

Schedule& vlink::Schedule::operator= ( Schedule &&  )
delete

◆ process()

static Status vlink::Schedule::process ( const Config config,
Callback &&  callback,
Callback wrapper_callback 
)
static

Wraps a void callback in a Config envelope and produces the task wrapper for the dispatcher.

Called internally by MessageLoop::exec_task(). Allocates the Status state and fills wrapper_callback with the closure that the dispatcher will eventually run.

Parameters
configScheduling configuration.
callbackVoid callable to execute.
wrapper_callbackOut parameter receiving the dispatcher-ready wrapper.
Returns
Fresh Status handle for fluent chaining.
Here is the caller graph for this function:

◆ process_with_ret()

static RetStatus vlink::Schedule::process_with_ret ( const Config config,
RetCallback &&  callback,
Callback wrapper_callback 
)
static

Wraps a bool-returning callback in a Config envelope and produces the task wrapper for the dispatcher.

Called internally by MessageLoop::exec_task(). Allocates the RetStatus state and fills wrapper_callback with the closure that the dispatcher will eventually run.

Parameters
configScheduling configuration.
callbackBool-returning callable to execute.
wrapper_callbackOut parameter receiving the dispatcher-ready wrapper.
Returns
Fresh RetStatus handle for fluent chaining.
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: