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