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

Base class for most objects. More...

#include <ErrorBase.h>

Inheritance diagram for ErrorBase:
AxisCamera CameraServer CANJaguar CANTalon Command ImageBase Joystick MotorSafetyHelper Notifier Preferences Resource RobotDrive Scheduler SensorBase SerialPort Subsystem Task USBCamera

Public Member Functions

 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 Member Functions

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

Error m_error
 

Static Protected Attributes

static priority_mutex _globalErrorMutex
 
static Error _globalError
 

Detailed Description

Base class for most objects.

ErrorBase is the base class for most objects since it holds the generated error for that object. In addition, there is a single instance of a global error object

Member Function Documentation

Error & ErrorBase::GetError ( )
virtual

Retrieve the current error.

Get the current error information associated with this sensor.

void ErrorBase::SetErrnoError ( llvm::StringRef  contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
uint32_t  lineNumber 
) const
virtual

Set error information associated with a C library call that set an error to the "errno" global variable.

Parameters
contextMessageA custom message from the code that set the error.
filenameFilename of the error source
functionFunction of the error source
lineNumberLine number of the error source
void ErrorBase::SetError ( Error::Code  code,
llvm::StringRef  contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
uint32_t  lineNumber 
) const
virtual

Set the current error information associated with this sensor.

Parameters
codeThe error code
contextMessageA custom message from the code that set the error.
filenameFilename of the error source
functionFunction of the error source
lineNumberLine number of the error source
void ErrorBase::SetImaqError ( int  success,
llvm::StringRef  contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
uint32_t  lineNumber 
) const
virtual

Set the current error information associated from the nivision Imaq API.

Parameters
successThe return from the function
contextMessageA custom message from the code that set the error.
filenameFilename of the error source
functionFunction of the error source
lineNumberLine number of the error source
void ErrorBase::SetWPIError ( llvm::StringRef  errorMessage,
Error::Code  code,
llvm::StringRef  contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
uint32_t  lineNumber 
) const
virtual

Set the current error information associated with this sensor.

Parameters
errorMessageThe error message from WPIErrors.h
contextMessageA custom message from the code that set the error.
filenameFilename of the error source
functionFunction of the error source
lineNumberLine number of the error source
bool ErrorBase::StatusIsFatal ( ) const
virtual

Check if the current error code represents a fatal error.

Returns
true if the current error is fatal.

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