#include <Task.h>
|
| Task (const char *name, FUNCPTR function, int32_t priority=kDefaultPriority, uint32_t stackSize=20000) |
|
bool | Start (uint32_t arg0=0, uint32_t arg1=0, uint32_t arg2=0, uint32_t arg3=0, uint32_t arg4=0, uint32_t arg5=0, uint32_t arg6=0, uint32_t arg7=0, uint32_t arg8=0, uint32_t arg9=0) |
|
bool | Restart () |
|
bool | Stop () |
|
bool | IsReady () |
|
bool | IsSuspended () |
|
bool | Suspend () |
|
bool | Resume () |
|
bool | Verify () |
|
int32_t | GetPriority () |
|
bool | SetPriority (int32_t priority) |
|
const char * | GetName () |
|
int32_t | GetID () |
|
virtual Error & | GetError () |
| Retrieve the current error. Get the current error information associated with this sensor.
|
|
virtual const Error & | GetError () const |
|
virtual void | SetErrnoError (const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
| Set error information associated with a C library call that set an error to the "errno" global variable. More...
|
|
virtual void | SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
| Set the current error information associated from the nivision Imaq API. More...
|
|
virtual void | SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
| Set the current error information associated with this sensor. More...
|
|
virtual void | SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
| Set the current error information associated with this sensor. More...
|
|
virtual void | CloneError (ErrorBase *rhs) const |
|
virtual void | ClearError () const |
| Clear the current error information associated with this sensor.
|
|
virtual bool | StatusIsFatal () const |
| Check if the current error code represents a fatal error. More...
|
|
|
static const uint32_t | kDefaultPriority = 101 |
|
static const int32_t | kInvalidTaskID = -1 |
|
|
static void | SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) |
|
static void | SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) |
|
static Error & | GetGlobalError () |
|
| ErrorBase () |
| Initialize the instance status to 0 for now.
|
|
Error | m_error |
|
static SEM_ID | _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE) |
|
static Error | _globalError |
|
WPI task is a wrapper for the native Task object. All WPILib tasks are managed by a static task manager for simplified cleanup.
Task::Task |
( |
const char * |
name, |
|
|
FUNCPTR |
function, |
|
|
int32_t |
priority = kDefaultPriority , |
|
|
uint32_t |
stackSize = 20000 |
|
) |
| |
Create but don't launch a task.
- Parameters
-
name | The name of the task. "FRC_" will be prepended to the task name. |
function | The address of the function to run as the new task. |
priority | The VxWorks priority for the task. |
stackSize | The size of the stack for the task |
Get the ID of a task
- Returns
- Task ID of this task. Task::kInvalidTaskID (-1) if the task has not been started or has already exited.
const char * Task::GetName |
( |
| ) |
|
Returns the name of the task.
- Returns
- Pointer to the name of the task or NULL if not allocated
int32_t Task::GetPriority |
( |
| ) |
|
Gets the priority of a task.
- Returns
- task priority or 0 if an error occured
Returns true if the task is ready to execute (i.e. not suspended, delayed, or blocked).
- Returns
- true if ready, false if not ready.
bool Task::IsSuspended |
( |
| ) |
|
Returns true if the task was explicitly suspended by calling Suspend()
- Returns
- true if suspended, false if not suspended.
Restarts a running task. If the task isn't started, it starts it.
- Returns
- false if the task is running and we are unable to kill the previous instance
Resumes a paused task. Returns true on success, false if unable to resume or if the task isn't running/paused.
bool Task::SetPriority |
( |
int32_t |
priority | ) |
|
This routine changes a task's priority to a specified priority. Priorities range from 0, the highest priority, to 255, the lowest priority. Default task priority is 100.
- Parameters
-
priority | The priority the task should run at. |
- Returns
- true on success.
bool Task::Start |
( |
uint32_t |
arg0 = 0 , |
|
|
uint32_t |
arg1 = 0 , |
|
|
uint32_t |
arg2 = 0 , |
|
|
uint32_t |
arg3 = 0 , |
|
|
uint32_t |
arg4 = 0 , |
|
|
uint32_t |
arg5 = 0 , |
|
|
uint32_t |
arg6 = 0 , |
|
|
uint32_t |
arg7 = 0 , |
|
|
uint32_t |
arg8 = 0 , |
|
|
uint32_t |
arg9 = 0 |
|
) |
| |
Starts this task. If it is already running or unable to start, it fails and returns false.
Kills the running task.
- Returns
- true on success false if the task doesn't exist or we are unable to kill it.
Pauses a running task. Returns true on success, false if unable to pause or the task isn't running.
Verifies a task still exists.
- Returns
- true on success.
The documentation for this class was generated from the following files: