A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd

Task

The base for tasks controlled by etl::scheduler.

Types

etl::task_priority_t
The type for task priorities.

etl::task


task(task_priority_t priority)
Constructor.
Sets the task priority.

virtual ~task();
Virtual destructor.

virtual uint32_t task_request_work() const = 0;
The derived task must override this.
Should return a value that represents the amount of work to do. This may be the number of items in the tasks message
queue, for example.
Return zero if the task requires no processing time.

virtual void task_process_work() = 0;
The derived task must override this.
The task should process one unit of work.

void set_task_running(bool task_running);
Enables/disables the task from processing work.
Enabled by default.

bool task_is_running() const;
Returns true if the task is in the 'running' state.

etl::task_priority_t get_task_priority() const;
Returns the priority of the task.

task.h