Now you can download a copy of these docs so you can use them offline! Download now

#include <ErrorBase.h>

Inheritance diagram for ErrorBase:
Collaboration diagram for ErrorBase:

Public Member Functions

virtual ErrorGetError ()
 Retrieve the current error. Get the current error information associated with this sensor.
virtual const ErrorGetError () const
virtual void SetErrnoError (const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable.
virtual void SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const
 Set the current error information associated from the nivision Imaq API.
virtual void SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const
 Set the current error information associated with this sensor.
virtual void SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber) const
 Set the current error information associated with this sensor.
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.

Static Public Member Functions

static void SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber)
static void SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, UINT32 lineNumber)
static ErrorGetGlobalError ()

Protected Member Functions

 ErrorBase ()
 Initialize the instance status to 0 for now.

Protected Attributes

Error m_error

Static Protected Attributes

static SEM_ID _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
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

Definition at line 37 of file ErrorBase.h.

Member Function Documentation

Error & ErrorBase::GetGlobalError ( )
static

Retrieve the current global error.

Definition at line 210 of file ErrorBase.cpp.

void ErrorBase::SetErrnoError ( const char *  contextMessage,
const char *  filename,
const char *  function,
UINT32  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

Definition at line 58 of file ErrorBase.cpp.

void ErrorBase::SetError ( Error::Code  code,
const char *  contextMessage,
const char *  filename,
const char *  function,
UINT32  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

Definition at line 126 of file ErrorBase.cpp.

void ErrorBase::SetImaqError ( int  success,
const char *  contextMessage,
const char *  filename,
const char *  function,
UINT32  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

Definition at line 99 of file ErrorBase.cpp.

void ErrorBase::SetWPIError ( const char *  errorMessage,
const char *  contextMessage,
const char *  filename,
const char *  function,
UINT32  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

Definition at line 151 of file ErrorBase.cpp.

bool ErrorBase::StatusIsFatal ( ) const
virtual

Check if the current error code represents a fatal error.

Returns
true if the current error is fatal.

Definition at line 177 of file ErrorBase.cpp.


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

Generated on Tue Feb 5 2013 00:55:10 for WPILibC++ by doxygen 1.8.1.2