TaskManagerIO
Loading...
Searching...
No Matches
TaskBlock Class Reference

#include <TaskBlock.h>

Public Member Functions

 TaskBlock (taskid_t first_)
bool isTaskContained (taskid_t task) const
TimerTaskgetContainedTask (taskid_t task)
void clearAll ()
taskid_t allocateTask ()
taskid_t lastSlot () const
taskid_t firstSlot () const

Detailed Description

This is an internal class, and users of the library generally don't see it.

Task manager can never deallocate memory that it has already allocated for tasks, this is in order to make thread safety much easier. Given this we allocate tasks in blocks of DEFAULT_TASK_SIZE and each tranche contains it's start and end point in the "array". DEFAULT task size is set to 20 on 32 bit hardware where the size is negligible, 10 on MEGA2560 and all other AVR boards default to 6. We allow up to 8 tranches on AVR and up to 16 on 32 bit boards. This should provide more than enough tasks for most boards.

Member Function Documentation

◆ isTaskContained()

bool TaskBlock::isTaskContained ( taskid_t task) const
inline

Checks if taskId is contained within this block

Parameters
taskthe task ID to check
Returns
true if contained, otherwise false

The documentation for this class was generated from the following file: