FastLED 3.9.15
Loading...
Searching...
No Matches
scheduler.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "fl/task/task.h"
7#include "fl/stl/singleton.h"
8#include "fl/stl/atomic.h"
9#include "fl/stl/vector.h"
10#include "fl/stl/noexcept.h"
11
12namespace fl {
13namespace task {
14
15class Scheduler {
16public:
17 static Scheduler& instance();
18
19 int add_task(Handle t);
20 void update();
21
22 // New methods for frame task handling
25
26 // For testing: clear all tasks
27 void clear_all_tasks() { mTasks.clear(); mNextTaskId.store(1); }
28
29private:
30 friend class fl::Singleton<Scheduler>;
32
33 void warn_no_then(int task_id, const fl::string& trace_label);
34 void warn_no_catch(int task_id, const fl::string& trace_label, const Error& error);
35
36 // Helper method for running specific task types
37 void update_tasks_of_type(TaskType task_type);
38
41};
42
43} // namespace task
44} // namespace fl
Task Handle with fluent API (was class fl::task, renamed to avoid namespace collision)
Definition task.h:139
void warn_no_then(int task_id, const fl::string &trace_label)
fl::vector< Handle > mTasks
Definition scheduler.h:39
fl::atomic< int > mNextTaskId
Definition scheduler.h:40
static Scheduler & instance()
void warn_no_catch(int task_id, const fl::string &trace_label, const Error &error)
void update_tasks_of_type(TaskType task_type)
Scheduler() FL_NOEXCEPT
Definition scheduler.h:31
int add_task(Handle t)
TaskType
Definition task.h:116
AtomicFake< T > atomic
Definition atomic.h:26
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT
Error type for promises.
Definition promise.h:39