![]() |
ImFusion SDK 4.3
|
#include <RoboticsPlugin/Include/ImFusion/Robotics/Error.h>
Error class used by our specialization of Utils::Expected. More...
Error class used by our specialization of Utils::Expected.
This class serves as a container for an ErrorInterface, implementing a strategy pattern to dynamically handle and represent user-defined errors. It can contain a stack of accumulated errors. The list of ids, messages and domains can be accessed through the respective methods. The constructor of ErrorFrontEnd calls handle() on the contained object. This will cause the handling strategy to be executed at that time.
Public Member Functions | |
ErrorFrontEnd (std::unique_ptr< ErrorInterface > in) | |
Sets the error handling strategy with optional log. | |
ErrorFrontEnd (const ErrorFrontEnd &) | |
ErrorFrontEnd & | operator= (const ErrorFrontEnd &) |
ErrorFrontEnd & | operator= (ErrorFrontEnd &&) noexcept |
std::string | domain () const |
Returns the category to which the custom error implementation belongs. | |
int | id () const |
Retrieves the unique identifier for the error. | |
std::string | message () const |
Retrieves the error message. | |
std::vector< std::string > | messages () const |
Returns the eventual list. | |
std::vector< int > | ids () const |
Returns the eventual list of ids. | |
std::vector< std::string > | domains () const |
Returns the eventual list of domains. | |
template<typename T> | |
operator Utils::Expected< T, ErrorFrontEnd > () const & | |
Template method for casting to Utils::Expected<T, ErrorFrontEnd>. | |
template<typename T> | |
operator Utils::Expected< T, ErrorFrontEnd > () && | |
Template method for casting to Utils::Expected<T, ErrorFrontEnd>. | |
bool | operator== (const ErrorFrontEnd &other) const |
Compares the id and the domain. | |
bool | operator== (const ErrorInterface &other) const |
Compares the id and the domain. | |
ErrorFrontEnd | operator| (const ErrorInterface &input) const |
Additional Inherited Members | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
ErrorFrontEnd | ( | std::unique_ptr< ErrorInterface > | in | ) |
Sets the error handling strategy with optional log.
strategy A unique pointer to an ErrorInterface implementation
|
nodiscard |
Returns the category to which the custom error implementation belongs.
|
nodiscard |
Retrieves the unique identifier for the error.
|
nodiscard |
Retrieves the error message.
|
inline |
Template method for casting to Utils::Expected<T, ErrorFrontEnd>.
T | The type of the expected value. |
|
inline |
Template method for casting to Utils::Expected<T, ErrorFrontEnd>.
T | The type of the expected value. |
bool operator== | ( | const ErrorFrontEnd & | other | ) | const |
Compares the id and the domain.
bool operator== | ( | const ErrorInterface & | other | ) | const |
Compares the id and the domain.