WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Task Class Reference

Wrapper class around std::thread that allows changing thread priority. More...

#include <Task.h>

Inheritance diagram for Task:
ErrorBase

Public Member Functions

 Task (const Task &)=delete
 
Taskoperator= (const Task &)=delete
 
Taskoperator= (Task &&task)
 
template<class Function , class... Args>
 Task (const std::string &name, Function &&function, Args &&...args)
 
bool joinable () const noexcept
 
void join ()
 
void detach ()
 
std::thread::id get_id () const noexcept
 
std::thread::native_handle_type native_handle ()
 
bool Verify ()
 Verifies a task still exists. More...
 
int32_t GetPriority ()
 Gets the priority of a task. More...
 
bool SetPriority (int32_t priority)
 This routine changes a task's priority to a specified priority. More...
 
std::string GetName () const
 Returns the name of the task. More...
 
- Public Member Functions inherited from ErrorBase
 ErrorBase (const ErrorBase &)=delete
 
ErrorBaseoperator= (const ErrorBase &)=delete
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef 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, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (llvm::StringRef errorMessage, Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const 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 Public Attributes

static const uint32_t kDefaultPriority = 60
 

Additional Inherited Members

- Static Public Member Functions inherited from ErrorBase
static void SetGlobalError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber)
 
static void SetGlobalWPIError (llvm::StringRef errorMessage, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, uint32_t lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 
- Protected Attributes inherited from ErrorBase
Error m_error
 
- Static Protected Attributes inherited from ErrorBase
static priority_mutex _globalErrorMutex
 
static Error _globalError
 

Detailed Description

Wrapper class around std::thread that allows changing thread priority.

Member Function Documentation

std::string Task::GetName ( ) const

Returns the name of the task.

Returns
The name of the task.
int32_t Task::GetPriority ( )

Gets the priority of a task.

Returns
task priority or 0 if an error occured
bool Task::SetPriority ( int32_t  priority)

This routine changes a task's priority to a specified priority.

Priorities range from 1, the lowest priority, to 99, the highest priority. Default task priority is 60.

Parameters
priorityThe priority at which the internal thread should run.
Returns
true on success.
bool Task::Verify ( )

Verifies a task still exists.

Returns
true on success.

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