mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Replace globalError in ErrorBase with a global set of all errors (#615)
This commit is contained in:
committed by
Peter Johnson
parent
2faba39b58
commit
212f378d08
@@ -34,11 +34,12 @@ class Error {
|
||||
typedef int Code;
|
||||
|
||||
Error() = default;
|
||||
Error(Code code, const wpi::Twine& contextMessage, wpi::StringRef filename,
|
||||
wpi::StringRef function, int lineNumber,
|
||||
const ErrorBase* originatingObject);
|
||||
|
||||
Error(const Error&) = delete;
|
||||
Error& operator=(const Error&) = delete;
|
||||
bool operator<(const Error& rhs) const;
|
||||
|
||||
void Clone(const Error& error);
|
||||
Code GetCode() const;
|
||||
std::string GetMessage() const;
|
||||
std::string GetFilename() const;
|
||||
|
||||
@@ -193,14 +193,10 @@ class ErrorBase {
|
||||
/**
|
||||
* Retrieve the current global error.
|
||||
*/
|
||||
static Error& GetGlobalError();
|
||||
static const Error& GetGlobalError();
|
||||
|
||||
protected:
|
||||
mutable Error m_error;
|
||||
|
||||
// TODO: Replace globalError with a global list of all errors.
|
||||
static wpi::mutex _globalErrorMutex;
|
||||
static Error _globalError;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user