![]() |
ImFusion SDK 4.3
|
#include <RoboticsPlugin/Include/ImFusion/Robotics/Error.h>
An interface for error handling and representation. More...
An interface for error handling and representation.
This interface defines a common interface for all error handling and representation types. Representation of various errors is done via the exposition additional properties: id, message, and domain.
Public Member Functions | |
virtual void | handle () |
Error handling strategy, allows the user to define a task on the constructor of ErrorFrontEnd. | |
virtual std::string | domain () const =0 |
Returns the category to which the custom error implementation belongs. | |
virtual int | id () const =0 |
Retrieves the unique identifier for the error. | |
virtual std::string | message () const =0 |
Retrieves the error message. | |
template<typename T> | |
operator Utils::Expected< T, ErrorFrontEnd > () const & | |
Template method for casting to std::expected<T, ErrorFrontEnd>. | |
std::unique_ptr< ErrorInterface > | clone () const & |
Creates a copy of the current instance. | |
bool | operator== (const ErrorFrontEnd &other) const |
Compares the id and the domain. | |
bool | operator== (const ErrorInterface &other) const |
Compares the id and the domain. | |
virtual ErrorComposition | operator| (const ErrorInterface &input) const |
Composition operator. | |
Protected Member Functions | |
virtual ErrorInterface * | cloneImpl () const =0 |
Clone implementation, used to exploit covariant overriding on the return type to return a pointer to the implementation rather than the interface. | |
|
inlinevirtual |
Error handling strategy, allows the user to define a task on the constructor of ErrorFrontEnd.
Reimplemented in ErrorKDL, and ErrorTracIK.
|
nodiscardpure virtual |
Returns the category to which the custom error implementation belongs.
Implemented in ErrorComposition, ErrorException, ErrorKDL, ErrorTracIK, Optimizer::Error, OptimizerNLopt::Error, RobotSolution, and SimpleErrorMessage.
|
nodiscardpure virtual |
Retrieves the unique identifier for the error.
Implemented in ErrorComposition, ErrorException, ErrorKDL, ErrorTracIK, Optimizer::Error, OptimizerNLopt::Error, RobotSolution, and SimpleErrorMessage.
|
nodiscardpure virtual |
Retrieves the error message.
This method is abstract to force the user to instantiate the error with the correct message.
Implemented in ErrorComposition, ErrorException, ErrorKDL, ErrorTracIK, Optimizer::Error, OptimizerNLopt::Error, RobotSolution, and SimpleErrorMessage.
|
inline |
Template method for casting to std::expected<T, ErrorFrontEnd>.
T | The type of the expected value. |
|
inlinenodiscard |
Creates a copy of the current instance.
This method performs a deep copy of the current instance and returns a new dynamically allocated instance that is a clone of this object.
|
inline |
Compares the id and the domain.
|
inline |
Compares the id and the domain.
|
virtual |
Composition operator.
This operator allows stacking errors to represent a causal relationship. The error passed as argument should have been caused by the errors contained in this composition.
Usage example:
Reimplemented in ErrorComposition.