87 void*
const routine_argument =
nullptr,
168 virtual void resume() = 0;
221 static void run(
void* task_pointer);
244 Task& operator=(const
Task& other) = delete;
276 void* const arg =
nullptr,
386 static
Mutex s_taskMutex;
394 bool m_registered = false;
413 virtual void addTask(
Task* task) = 0;
418 virtual void removeTask(
Task* task) = 0;
error trying to join the task
static Status delay(Fw::TimeInterval interval)
delay the current task
DEPRECATED(Status start(const Fw::ConstStringBase &name, const taskRoutine routine, void *const arg=nullptr, const FwTaskPriorityType priority=TASK_PRIORITY_DEFAULT, const ParamType stackSize=TASK_DEFAULT, const ParamType cpuAffinity=TASK_DEFAULT, const ParamType identifier=TASK_DEFAULT), "Switch to Task::start(Arguments&)")
start this task
virtual ~TaskInterface()=default
default virtual destructor
static constexpr FwSizeType TASK_DEFAULT
PlatformTaskIdType FwTaskIdType
The type of task priorities used.
TaskHandle * getHandle() override
return the underlying task handle (implementation specific)
Task handle representation.
unable to set the task affinity
PlatformSizeType FwSizeType
virtual void resume()=0
resume a suspended task
FwTaskPriorityType getPriority()
get the task priority
static Task & getSingleton()
get a reference to singleton
Task is in an invalid state for the operation.
virtual Status _delay(Fw::TimeInterval interval)=0
delay the currently scheduled task using the given architecture
State getState()
get the task's state
started task with invalid parameters
static void registerTaskRegistry(TaskRegistry *registry)
register a task registry to track Threads
A class to represent a time interval holding two U32 seconds and microseconds values.
started with invalid stack size
permissions error setting-up tasks
Task()
default constructor
Status start(const Arguments &arguments) override
start the task
Status _delay(Fw::TimeInterval interval) override
delay the current task
virtual Status join()=0
block until the task has ended
~Task() final
default virtual destructor
U8 TaskHandleStorage[FW_TASK_HANDLE_MAX_SIZE]
virtual void onStart()=0
perform required task start actions
void * m_user_argument
Argument to user function.
void * m_routine_argument
static constexpr FwTaskPriorityType TASK_PRIORITY_DEFAULT
error trying to delay the task
static TaskInterface * getDelegate(TaskHandleStorage &aligned_placement_new_memory)
provide a pointer to a task delegate object
bool isCooperative() override
determine if the task is cooperative multitasking (implementation specific)
virtual void suspend(SuspensionType suspensionType)=0
suspend the task given the suspension type
unexpected error return value
message sent/received okay
virtual Status start(const Arguments &arguments)=0
start the task
void suspend()
suspend the current task
Status join() override
block until the task has ended
TaskString getName()
get the task name
static FwSizeType getNumTasks()
get the current number of tasks
TaskInterface()=default
default constructor
static void run(void *task_pointer)
run the task routine wrapper
Wrapper for task routine that ensures onStart() is called once the task actually begins.
Task & m_task
Reference to owning task.
const Os::TaskString m_name
FwTaskIdType m_identifier
PlatformTaskPriorityType FwTaskPriorityType
The type of task priorities used.
FwSizeType ParamType
backwards-compatible parameter type
void onStart() override
perform delegate's required task start actions
friend struct Os::Test::Task::Tester
A read-only abstract superclass for StringBase.
TaskRoutineWrapper(Task &self)
void invokeRoutine()
invoke the task's routine
Task feature is not supported.
void resume() override
resume a suspended task
void invoke()
invoke the run method with "self" as argument
unable to allocate more tasks
TaskInterface & operator=(const TaskInterface &other)=delete
assignment operator is forbidden
taskRoutine m_user_function
User function to run once started.
FwTaskPriorityType m_priority
static void init()
initialize singleton
Implementation of malloc based allocator.
virtual TaskHandle * getHandle()=0
return the underlying task handle (implementation specific)
void(* taskRoutine)(void *ptr)
Prototype for task routine started in task context.
Arguments(const Fw::ConstStringBase &name, const taskRoutine routine, void *const routine_argument=nullptr, const FwTaskPriorityType priority=TASK_PRIORITY_DEFAULT, const FwSizeType stackSize=TASK_DEFAULT, const FwSizeType cpuAffinity=TASK_DEFAULT, const FwTaskIdType identifier=static_cast< FwTaskIdType >(TASK_DEFAULT))
construct a set of arguments to start a task
virtual bool isCooperative()
determine if the task requires cooperative multitasking