WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::ErrorBase Class Reference

Base class for most objects. More...

#include <ErrorBase.h>

Inheritance diagram for frc::ErrorBase:
frc::ADXL345_I2C frc::ADXL345_SPI frc::ADXL362 frc::AnalogAccelerometer frc::AnalogInput frc::AnalogOutput frc::AnalogPotentiometer frc::AnalogTrigger frc::BuiltInAccelerometer frc::CAN frc::Command frc::Compressor frc::Counter frc::DigitalGlitchFilter frc::DigitalOutput frc::DriverStation frc::Encoder frc::GenericHID frc::GyroBase frc::I2C frc::InterruptableSensorBase frc::MotorSafety frc::Notifier frc::PowerDistributionPanel frc::Preferences frc::Resource frc::Scheduler frc::SerialPort frc::ShuffleboardContainer frc::SmartDashboard frc::SolenoidBase frc::SPI frc::Subsystem frc::TimedRobot frc::Ultrasonic

Public Member Functions

 ErrorBase (ErrorBase &&)=default
 
ErrorBaseoperator= (ErrorBase &&)=default
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 Retrieve the current error. More...
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual void SetErrnoError (const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::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 wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::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 wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const wpi::Twine &errorMessage, Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
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 wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (const wpi::Twine &errorMessage, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber)
 
static const ErrorGetGlobalError ()
 Retrieve the current global error.
 

Protected Attributes

Error m_error
 

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

virtual Error& frc::ErrorBase::GetError ( )
virtual

Retrieve the current error.

Get the current error information associated with this sensor.

virtual const Error& frc::ErrorBase::GetError ( ) const
virtual

Retrieve the current error.

Get the current error information associated with this sensor.

virtual void frc::ErrorBase::SetErrnoError ( const wpi::Twine contextMessage,
wpi::StringRef  filename,
wpi::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
virtual void frc::ErrorBase::SetError ( Error::Code  code,
const wpi::Twine contextMessage,
wpi::StringRef  filename,
wpi::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
virtual void frc::ErrorBase::SetErrorRange ( Error::Code  code,
int32_t  minRange,
int32_t  maxRange,
int32_t  requestedValue,
const wpi::Twine contextMessage,
wpi::StringRef  filename,
wpi::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
virtual void frc::ErrorBase::SetImaqError ( int  success,
const wpi::Twine contextMessage,
wpi::StringRef  filename,
wpi::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
virtual void frc::ErrorBase::SetWPIError ( const wpi::Twine errorMessage,
Error::Code  code,
const wpi::Twine contextMessage,
wpi::StringRef  filename,
wpi::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
virtual bool frc::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 file: