Uniot Core
0.8.1
Loading...
Searching...
No Matches

Main scheduler for managing and executing periodic tasks. More...

Collaboration diagram for Scheduler:

Typedefs

using uniot::TaskScheduler::TaskPtr = SharedPointer<SchedulerTask>
 Shared pointer type for scheduler tasks.
 
using uniot::TaskScheduler::TaskInfoCallback = std::function<void(const char *, bool, uint64_t)>
 Callback signature for task status reporting.
 

Functions

 uniot::TaskScheduler::TaskScheduler ()
 Constructor.
 
static TaskPtr uniot::TaskScheduler::make (SchedulerTask::SchedulerTaskCallback callback)
 Static factory method to create a task with a callback.
 
static TaskPtr uniot::TaskScheduler::make (IExecutor &executor)
 Static factory method to create a task from an IExecutor.
 
TaskScheduleruniot::TaskScheduler::push (const char *name, TaskPtr task)
 Add a named task to the scheduler.
 
TaskScheduleruniot::TaskScheduler::push (ISchedulerConnectionKit &connection)
 Add connection kit components to the scheduler.
 
void uniot::TaskScheduler::loop ()
 Main execution loop for the scheduler.
 
void uniot::TaskScheduler::exportTasksInfo (TaskInfoCallback callback) const
 Report information about all registered tasks.
 
uint64_t uniot::TaskScheduler::getTotalElapsedMs () const
 Get the total execution time of the scheduler in milliseconds.
 

Detailed Description

Main scheduler for managing and executing periodic tasks.

TaskScheduler manages a collection of tasks, executes them according to their timing requirements, and tracks performance metrics.

Typedef Documentation

◆ TaskInfoCallback

using uniot::TaskScheduler::TaskInfoCallback = std::function<void(const char *, bool, uint64_t)>

Callback signature for task status reporting.

Parameters
nameTask name
isAttachedWhether the task is currently attached
elapsedTotal execution time in milliseconds

◆ TaskPtr

Shared pointer type for scheduler tasks.

Function Documentation

◆ exportTasksInfo()

void uniot::TaskScheduler::exportTasksInfo ( TaskInfoCallback callback) const
inline

Report information about all registered tasks.

Parameters
callbackFunction that receives information about each task

◆ getTotalElapsedMs()

uint64_t uniot::TaskScheduler::getTotalElapsedMs ( ) const
inline

Get the total execution time of the scheduler in milliseconds.

Return values
timeTotal elapsed time in milliseconds

◆ loop()

void uniot::TaskScheduler::loop ( )
inline

Main execution loop for the scheduler.

Executes all registered tasks and tracks timing metrics

◆ make() [1/2]

static TaskPtr uniot::TaskScheduler::make ( IExecutor & executor)
inlinestatic

Static factory method to create a task from an IExecutor.

Parameters
executorThe executor to wrap in a task
Return values
TaskPtrThe task pointer

◆ make() [2/2]

static TaskPtr uniot::TaskScheduler::make ( SchedulerTask::SchedulerTaskCallback callback)
inlinestatic

Static factory method to create a task with a callback.

Parameters
callbackFunction to execute when the task runs
Return values
TaskPtrThe task pointer

◆ push() [1/2]

TaskScheduler & uniot::TaskScheduler::push ( const char * name,
TaskPtr task )
inline

Add a named task to the scheduler.

Parameters
nameIdentifier for the task
taskShared pointer to the task
Return values
TaskScheduler&Reference to the current scheduler instance

◆ push() [2/2]

TaskScheduler & uniot::TaskScheduler::push ( ISchedulerConnectionKit & connection)
inline

Add connection kit components to the scheduler.

Parameters
connectionThe connection kit to integrate
Return values
TaskScheduler&Reference to the current scheduler instance

◆ TaskScheduler()

uniot::TaskScheduler::TaskScheduler ( )
inline

Constructor.