roo_scheduler
API Documentation for roo_scheduler
Loading...
Searching...
No Matches
roo_scheduler.h File Reference
#include <functional>
#include <memory>
#include <vector>
#include "roo_collections.h"
#include "roo_collections/flat_small_hash_set.h"
#include "roo_threads.h"
#include "roo_threads/condition_variable.h"
#include "roo_threads/mutex.h"
#include "roo_time.h"
Include dependency graph for roo_scheduler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  roo_scheduler::Executable
 Abstract interface for executable tasks in the scheduler queue. More...
 
class  roo_scheduler::Scheduler
 Schedules and dispatches delayed task executions. More...
 
class  roo_scheduler::Task
 Convenience adapter for one-time execution of an arbitrary callable. More...
 
class  roo_scheduler::RepetitiveTask
 Convenience adapter for repetitive callable execution. More...
 
class  roo_scheduler::PeriodicTask
 Convenience adapter for periodic callable execution. More...
 
class  roo_scheduler::SingletonTask
 Convenience adapter for cancelable and replaceable single pending work. More...
 
class  roo_scheduler::IteratingTask
 
class  roo_scheduler::IteratingTask::Iterator
 

Namespaces

namespace  roo_scheduler
 

Macros

#define ROO_SCHEDULER_IGNORE_PRIORITY   0
 Umbrella header for the roo_scheduler module.
 

Typedefs

using roo_scheduler::ExecutionID = int32_t
 Represents a unique task execution identifier.
 
using roo_scheduler::EventID = ExecutionID
 Deprecated alias; prefer ExecutionID.
 

Enumerations

enum class  roo_scheduler::Priority {
  roo_scheduler::kMinimum = 0 , roo_scheduler::kBackground = 1 , roo_scheduler::kReduced = 2 , roo_scheduler::kNormal = 3 ,
  roo_scheduler::kElevated = 4 , roo_scheduler::kSensitive = 5 , roo_scheduler::kCritical = 6 , roo_scheduler::kMaximum = 7
}
 Priority controls dispatch order among eligible tasks. More...
 

Variables

constexpr Priority roo_scheduler::PRIORITY_MINIMUM = Priority::kMinimum
 
constexpr Priority roo_scheduler::PRIORITY_BACKGROUND = Priority::kBackground
 
constexpr Priority roo_scheduler::PRIORITY_REDUCED = Priority::kReduced
 
constexpr Priority roo_scheduler::PRIORITY_NORMAL = Priority::kNormal
 
constexpr Priority roo_scheduler::PRIORITY_ELEVATED = Priority::kElevated
 
constexpr Priority roo_scheduler::PRIORITY_SENSITIVE = Priority::kSensitive
 
constexpr Priority roo_scheduler::PRIORITY_CRITICAL = Priority::kCritical
 
constexpr Priority roo_scheduler::PRIORITY_MAXIMUM = Priority::kMaximum
 

Macro Definition Documentation

◆ ROO_SCHEDULER_IGNORE_PRIORITY

#define ROO_SCHEDULER_IGNORE_PRIORITY   0

Umbrella header for the roo_scheduler module.

Provides task scheduling primitives and adapters. A typical Arduino use case may look like the following:

void foo();
using namespace roo_time;
using namespace roo_scheduler;
Scheduler scheduler;
RepetitiveTask foo_task(scheduler, foo, Seconds(5));
void setup() {
foo_task.start();
}
void loop() {
scheduler.executeEligibleTasks();
// ... other work
}
Convenience adapter for repetitive callable execution.
Schedules and dispatches delayed task executions.
bool executeEligibleTasks(Priority min_priority, int max_count=-1)
Executes up to max_count eligible tasks with at least min_priority.

Definition at line 40 of file roo_scheduler.h.