ImFusion SDK 4.3
ErrorComposition Class Referencefinal

#include <RoboticsPlugin/Include/ImFusion/Robotics/Error.h>

Class to represent a stack of errors. More...

+ Inheritance diagram for ErrorComposition:

Detailed Description

Class to represent a stack of errors.

Errors can be composed into a stack as they are handled in nested function calls to include additional information. The composition of errors will add the new one to the top of the stack. It will hence appear at the back of the vectors returned by id(), message(), and domain().

Public Member Functions

 ErrorComposition (const ErrorInterface &input)
 
 ErrorComposition (const ErrorComposition &input)
 
std::string domain () const override
 
int id () const override
 Retrieves the unique identifier for the outermost error.
 
std::string message () const override
 Retrieves the error message.
 
std::vector< std::stringmessages () const
 Returns the list of messages of all errors.
 
std::vector< int > ids () const
 Returns the list of ids of all errors.
 
std::vector< std::stringdomains () const
 Returns the list of ids.
 
ErrorComposition operator| (const ErrorInterface &input) const override
 Compose the error with another one.
 
- Public Member Functions inherited from ErrorInheritanceHelper< ErrorComposition >
 ~ErrorInheritanceHelper () override=default
 Override destructor.
 
 ErrorInheritanceHelper (const ErrorInterface &ei)
 
std::unique_ptr< ErrorCompositionclone () const &
 Creates a copy of the current instance.
 
- Public Member Functions inherited from ErrorInterface
virtual void handle ()
 Error handling strategy, allows the user to define a task on the constructor of ErrorFrontEnd.
 
template<typename T>
 operator Utils::Expected< T, ErrorFrontEnd > () const &
 Template method for casting to std::expected<T, ErrorFrontEnd>.
 
std::unique_ptr< ErrorInterfaceclone () 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.
 

Additional Inherited Members

- Protected Member Functions inherited from NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
 
NotCopyableoperator= (NotCopyable &&) noexcept=default
 
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 

Member Function Documentation

◆ domain()

std::string domain ( ) const
nodiscardoverridevirtual
Returns
string representing the category of the outermost error.

Implements ErrorInterface.

◆ id()

int id ( ) const
nodiscardoverridevirtual

Retrieves the unique identifier for the outermost error.

Returns
The error ID.

Implements ErrorInterface.

◆ message()

std::string message ( ) const
nodiscardoverridevirtual

Retrieves the error message.

This method is abstract to force the user to instantiate the error with the correct message.

Returns
An error message.

Implements ErrorInterface.

◆ operator|()

ErrorComposition operator| ( const ErrorInterface & input) const
overridevirtual

Compose the error with another one.

The error passed as argument will be interpreted as the outer error, and will be added to the top of the error stack (i.e. the back of the error vector).

Reimplemented from ErrorInterface.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close