F´ Flight Software - C/C++ Documentation  NASA-v2.0.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Os::Task Class Reference

forward declaration More...

#include <Os/Task.hpp>

Public Types

enum  TaskStatus {
  TASK_OK, TASK_INVALID_PARAMS, TASK_INVALID_STACK, TASK_UNKNOWN_ERROR,
  TASK_INVALID_AFFINITY, TASK_DELAY_ERROR, TASK_JOIN_ERROR
}
 
typedef void(* taskRoutine) (void *ptr)
 prototype for task routine started in task context More...
 

Public Member Functions

 Task ()
 constructor More...
 
virtual ~Task ()
 destructor More...
 
TaskStatus start (const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void *arg, NATIVE_INT_TYPE cpuAffinity=-1)
 start the task More...
 
I32 getIdentifier (void)
 get the identifier for the task More...
 
TaskStatus join (void **value_ptr)
 Wait for task to finish. More...
 
void suspend (bool onPurpose=false)
 suspend task More...
 
void resume (void)
 resume execution of task More...
 
bool wasSuspended (void)
 returns whether or not task was suspended on purpose More...
 
bool isSuspended (void)
 check with OS to see if it is suspended already More...
 
bool isStarted (void)
 check to see if task is started More...
 
void setStarted (bool started)
 set task to started when thread is fully up. Avoids a VxWorks race condition. More...
 
POINTER_CAST getRawHandle ()
 

Static Public Member Functions

static TaskId getOsIdentifier (void)
 
static TaskStatus delay (NATIVE_UINT_TYPE msecs)
 delay the task More...
 
static NATIVE_INT_TYPE getNumTasks (void)
 
static void registerTaskRegistry (TaskRegistry *registry)
 

Detailed Description

forward declaration

Definition at line 15 of file Task.hpp.

Member Typedef Documentation

◆ taskRoutine

typedef void(* Os::Task::taskRoutine) (void *ptr)

prototype for task routine started in task context

Definition at line 28 of file Task.hpp.

Member Enumeration Documentation

◆ TaskStatus

Enumerator
TASK_OK 

message sent/received okay

TASK_INVALID_PARAMS 

started task with invalid parameters

TASK_INVALID_STACK 

started with invalid stack size

TASK_UNKNOWN_ERROR 

unexpected error return value

TASK_INVALID_AFFINITY 

unable to set the task affinity

TASK_DELAY_ERROR 

error trying to delay the task

TASK_JOIN_ERROR 

error trying to join the task

Definition at line 18 of file Task.hpp.

Constructor & Destructor Documentation

◆ Task()

Os::Task::Task ( )

constructor

Definition at line 8 of file Task.cpp.

◆ ~Task()

Os::Task::~Task ( )
virtual

destructor

Definition at line 47 of file Task.cpp.

Member Function Documentation

◆ delay()

Task::TaskStatus Os::Task::delay ( NATIVE_UINT_TYPE  msecs)
static

delay the task

Definition at line 41 of file Task.cpp.

◆ getIdentifier()

I32 Os::Task::getIdentifier ( void  )

get the identifier for the task

Definition at line 15 of file TaskCommon.cpp.

◆ getNumTasks()

NATIVE_INT_TYPE Os::Task::getNumTasks ( void  )
static

Definition at line 10 of file TaskCommon.cpp.

◆ getOsIdentifier()

TaskId Os::Task::getOsIdentifier ( void  )
static

Definition at line 204 of file Task.cpp.

◆ getRawHandle()

POINTER_CAST Os::Task::getRawHandle ( )

Returns the task-handle owned by this task

Definition at line 31 of file TaskCommon.cpp.

◆ isStarted()

bool Os::Task::isStarted ( void  )

check to see if task is started

Definition at line 19 of file TaskCommon.cpp.

◆ isSuspended()

bool Os::Task::isSuspended ( void  )

check with OS to see if it is suspended already

Definition at line 67 of file Task.cpp.

◆ join()

Task::TaskStatus Os::Task::join ( void **  value_ptr)

Wait for task to finish.

Definition at line 72 of file Task.cpp.

◆ registerTaskRegistry()

void Os::Task::registerTaskRegistry ( TaskRegistry registry)
static

Definition at line 35 of file TaskCommon.cpp.

◆ resume()

void Os::Task::resume ( void  )

resume execution of task

Definition at line 62 of file Task.cpp.

◆ setStarted()

void Os::Task::setStarted ( bool  started)

set task to started when thread is fully up. Avoids a VxWorks race condition.

Definition at line 23 of file TaskCommon.cpp.

◆ start()

Task::TaskStatus Os::Task::start ( const Fw::StringBase name,
NATIVE_INT_TYPE  identifier,
NATIVE_INT_TYPE  priority,
NATIVE_INT_TYPE  stackSize,
taskRoutine  routine,
void *  arg,
NATIVE_INT_TYPE  cpuAffinity = -1 
)

start the task

Definition at line 16 of file Task.cpp.

◆ suspend()

void Os::Task::suspend ( bool  onPurpose = false)

suspend task

Definition at line 57 of file Task.cpp.

◆ wasSuspended()

bool Os::Task::wasSuspended ( void  )

returns whether or not task was suspended on purpose

Definition at line 27 of file TaskCommon.cpp.


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