WPILibC++  unspecified
frc::ErrorBase Class Reference

Base class for most objects. More...

#include <ErrorBase.h>

Inheritance diagram for frc::ErrorBase:
Collaboration diagram for frc::ErrorBase:

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 (const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int 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 llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const llvm::Twine &errorMessage, Error::Code code, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int 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, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (const llvm::Twine &errorMessage, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 

Protected Attributes

Error m_error
 

Static Protected Attributes

static wpi::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 ( const llvm::Twine contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
int  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,
const llvm::Twine contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
int  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::SetErrorRange ( Error::Code  code,
int32_t  minRange,
int32_t  maxRange,
int32_t  requestedValue,
const llvm::Twine contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
int  lineNumber 
) const
virtual

Set the current error information associated with this sensor.

Range versions use for initialization code.

Parameters
codeThe error code
minRangeThe minimum allowed allocation range
maxRangeThe maximum allowed allocation range
requestedValueThe requested value to allocate
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,
const llvm::Twine contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
int  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 ( const llvm::Twine errorMessage,
Error::Code  code,
const llvm::Twine contextMessage,
llvm::StringRef  filename,
llvm::StringRef  function,
int  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: