VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex::task Class Reference

Use this class to create and control tasks. More...

#include <vex_task.h>

Public Member Functions

 task (int(*callback)(void))
 Constructs a task with a function callback.
 
 task (int(*callback)(void), uint16_t priority)
 Constructs a task with a function callback and a priority.
 
void stop ()
 Stops the task.
 
void suspend ()
 Suspends the task until the task is told to resume.
 
void resume ()
 Resumes the previously suspended task.
 
int16_t priority ()
 Gets the priority of the task.
 
void setPriority (uint16_t priority)
 Sets the priority of the task.
 
int16_t index (void)
 Gets the task's index.
 

Static Public Member Functions

static void stop (const task &t)
 Stops the specified task.
 
static void suspend (const task &t)
 Suspends the specified task for later use.
 
static void resume (const task &t)
 Resumes a specified task that has been suspended.
 
static int16_t priority (const task &t)
 Gets the priority of a task.
 
static void setPriority (const task &t, uint16_t priority)
 Sets the priority of the specified task.
 
static void sleep (uint32_t time)
 Sets the task to sleep for the specified amount of time (in milliseconds).
 
static void yield ()
 return control to the scheduler and allow other tasks to run.
 
static void dump ()
 , internal use
 
static void stop (int(*callback)(void))
 Stops the task of the passed in function.
 

Static Public Attributes

static const int32_t taskPrioritylow = 1
 
static const int32_t taskPriorityNormal = 7
 
static const int32_t taskPriorityHigh = 15
 

Static Protected Member Functions

static int32_t _index (int(*callback)(void))
 
static void _stopAll ()
 

Detailed Description

Use this class to create and control tasks.

Definition at line 31 of file vex_task.h.

Constructor & Destructor Documentation

◆ task() [1/2]

vex::task::task ( int(* callback )(void))

Constructs a task with a function callback.

Parameters
callbackA reference to a function.

◆ task() [2/2]

vex::task::task ( int(* callback )(void),
uint16_t priority )

Constructs a task with a function callback and a priority.

Parameters
callbackA reference to a function.
prioritySets the priority of the task.

Member Function Documentation

◆ index()

int16_t vex::task::index ( void )

Gets the task's index.

Returns
Returns an integer that represents the index of the task.

◆ priority() [1/2]

int16_t vex::task::priority ( )

Gets the priority of the task.

Returns
Returns an integer that represents the priority of the task.

◆ priority() [2/2]

static int16_t vex::task::priority ( const task & t)
static

Gets the priority of a task.

Returns
Returns an integer that represents the current priority of the specified task.
Parameters
tThe task to get priority of.

◆ resume()

static void vex::task::resume ( const task & t)
static

Resumes a specified task that has been suspended.

Parameters
tThe task to be resumed.

◆ setPriority() [1/2]

static void vex::task::setPriority ( const task & t,
uint16_t priority )
static

Sets the priority of the specified task.

Parameters
tThe task to set the priority on.
priorityThe priority level of a task.

◆ setPriority() [2/2]

void vex::task::setPriority ( uint16_t priority)

Sets the priority of the task.

Parameters
priorityThe priority level of the task.

◆ sleep()

static void vex::task::sleep ( uint32_t time)
static

Sets the task to sleep for the specified amount of time (in milliseconds).

Parameters
timeThe number of milliseconds for the task to sleep.

◆ stop() [1/2]

static void vex::task::stop ( const task & t)
static

Stops the specified task.

Parameters
tThe task to be stopped.

◆ stop() [2/2]

static void vex::task::stop ( int(* callback )(void))
static

Stops the task of the passed in function.

Parameters
callbackA reference to a function.

◆ suspend()

static void vex::task::suspend ( const task & t)
static

Suspends the specified task for later use.

Parameters
tThe task to be suspended.

Member Data Documentation

◆ taskPriorityHigh

const int32_t vex::task::taskPriorityHigh = 15
static

Definition at line 57 of file vex_task.h.

◆ taskPrioritylow

const int32_t vex::task::taskPrioritylow = 1
static

Definition at line 55 of file vex_task.h.

◆ taskPriorityNormal

const int32_t vex::task::taskPriorityNormal = 7
static

Definition at line 56 of file vex_task.h.


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