11 #include "ChipObject/NiRio.h"
16 #define wpi_setErrnoErrorWithContext(context) (this->SetErrnoError((context), __FILE__, __FUNCTION__, __LINE__))
17 #define wpi_setErrnoError() (wpi_setErrnoErrorWithContext(""))
18 #define wpi_setImaqErrorWithContext(code, context) (this->SetImaqError((code), (context), __FILE__, __FUNCTION__, __LINE__))
19 #define wpi_setErrorWithContext(code, context) (this->SetError((code), (context), __FILE__, __FUNCTION__, __LINE__))
20 #define wpi_setError(code) (wpi_setErrorWithContext(code, ""))
21 #define wpi_setStaticErrorWithContext(object, code, context) (object->SetError((code), (context), __FILE__, __FUNCTION__, __LINE__))
22 #define wpi_setStaticError(object, code) (wpi_setStaticErrorWithContext(object, code, ""))
23 #define wpi_setGlobalErrorWithContext(code, context) (ErrorBase::SetGlobalError((code), (context), __FILE__, __FUNCTION__, __LINE__))
24 #define wpi_setGlobalError(code) (wpi_setGlobalErrorWithContext(code, ""))
25 #define wpi_setWPIErrorWithContext(error, context) (this->SetWPIError((wpi_error_s_##error), (context), __FILE__, __FUNCTION__, __LINE__))
26 #define wpi_setWPIError(error) (wpi_setWPIErrorWithContext(error, ""))
27 #define wpi_setStaticWPIErrorWithContext(object, error, context) (object->SetWPIError((wpi_error_s_##error), (context), __FILE__, __FUNCTION__, __LINE__))
28 #define wpi_setStaticWPIError(object, error) (wpi_setStaticWPIErrorWithContext(object, error, ""))
29 #define wpi_setGlobalWPIErrorWithContext(error, context) (ErrorBase::SetGlobalWPIError((wpi_error_s_##error), (context), __FILE__, __FUNCTION__, __LINE__))
30 #define wpi_setGlobalWPIError(error) (wpi_setGlobalWPIErrorWithContext(error, ""))
45 const char* filename,
const char*
function, uint32_t lineNumber)
const;
46 virtual void SetImaqError(
int success,
const char *contextMessage,
47 const char* filename,
const char*
function, uint32_t lineNumber)
const;
48 virtual void SetError(Error::Code code,
const char *contextMessage,
49 const char* filename,
const char*
function, uint32_t lineNumber)
const;
50 virtual void SetWPIError(
const char *errorMessage,
const char *contextMessage,
51 const char* filename,
const char*
function, uint32_t lineNumber)
const;
52 virtual void CloneError(
ErrorBase *rhs)
const;
55 static void SetGlobalError(Error::Code code,
const char *contextMessage,
56 const char* filename,
const char*
function, uint32_t lineNumber);
57 static void SetGlobalWPIError(
const char *errorMessage,
const char *contextMessage,
58 const char* filename,
const char*
function, uint32_t lineNumber);
61 mutable Error m_error;
63 static SEM_ID _globalErrorMutex;
64 static Error _globalError;
virtual void SetImaqError(int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
Set the current error information associated from the nivision Imaq API.
Definition: ErrorBase.cpp:100
virtual void ClearError() const
Clear the current error information associated with this sensor.
Definition: ErrorBase.cpp:46
virtual void SetError(Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
Set the current error information associated with this sensor.
Definition: ErrorBase.cpp:127
virtual bool StatusIsFatal() const
Check if the current error code represents a fatal error.
Definition: ErrorBase.cpp:178
Definition: ErrorBase.h:37
virtual Error & GetError()
Retrieve the current error. Get the current error information associated with this sensor...
Definition: ErrorBase.cpp:33
virtual void SetWPIError(const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
Set the current error information associated with this sensor.
Definition: ErrorBase.cpp:152
ErrorBase()
Initialize the instance status to 0 for now.
Definition: ErrorBase.cpp:23
virtual void SetErrnoError(const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const
Set error information associated with a C library call that set an error to the "errno" global variab...
Definition: ErrorBase.cpp:59
static Error & GetGlobalError()
Definition: ErrorBase.cpp:211