EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
echomap::ErrorResult Class Reference

Indicates that an ITask did not successfully complete. More...

#include <ErrorResult.hpp>

Public Member Functions

 ErrorResult (std::string_view message, std::source_location location, std::unique_ptr< ITask > responsible_task)
 Create a new ErrorResult literally specifying the message, location, and the responsible task.
 ErrorResult (const LocatableError &exception, std::unique_ptr< ITask > responsible_task)
 Create a new ErrorResult from a LocatableError and the responsible task.
 ErrorResult (const ErrorResult &)=delete
ErrorResultoperator= (const ErrorResult &)=delete
 ErrorResult (ErrorResult &&) noexcept
std::string_view what () const noexcept
 Observes the human-readable error message.
const std::source_locationwhere () const noexcept
 Observes the location of the error origin.
const ITaskobserve_responsible_task () const noexcept
 Retrieves an observing pointer to the ITask responsible for causing the ErrorResult.

Private Attributes

std::string message
std::source_location location
std::unique_ptr< ITaskresponsible_task

Detailed Description

Indicates that an ITask did not successfully complete.

Definition at line 27 of file ErrorResult.hpp.

Constructor & Destructor Documentation

◆ ErrorResult() [1/2]

echomap::ErrorResult::ErrorResult ( std::string_view message,
std::source_location location,
std::unique_ptr< ITask > responsible_task )
explicit

Create a new ErrorResult literally specifying the message, location, and the responsible task.

Parameters
messageHuman-readable description of the error.
locationMost relevant source location of the error origin.
responsible_taskThe ITask (ownership transferred into the ErrorResult) responsible.

Definition at line 19 of file ErrorResult.cpp.

23 :
24 message(message),
25 location(location),
26 responsible_task(std::move(responsible_task))
27{
28}

◆ ErrorResult() [2/2]

echomap::ErrorResult::ErrorResult ( const LocatableError & exception,
std::unique_ptr< ITask > responsible_task )
explicit

Create a new ErrorResult from a LocatableError and the responsible task.

Parameters
exceptionException thrown from the ITask.
responsible_taskThe ITask (ownership transferred into the ErrorResult) responsible.

Definition at line 30 of file ErrorResult.cpp.

33 :
34 message(exception.what()),
35 location(exception.where()),
36 responsible_task(std::move(responsible_task))
37{
38}

Member Function Documentation

◆ observe_responsible_task()

const ITask * echomap::ErrorResult::observe_responsible_task ( ) const
nodiscardnoexcept

Retrieves an observing pointer to the ITask responsible for causing the ErrorResult.

Returns
An observing pointer to the responsible ITask, or nullptr if the ErrorResult does not relate to a particular ITask.

Definition at line 54 of file ErrorResult.cpp.

55{
56 return responsible_task.get();
57}

◆ what()

std::string_view echomap::ErrorResult::what ( ) const
nodiscardnoexcept

Observes the human-readable error message.

Returns
Description of the ErrorResult.

Definition at line 44 of file ErrorResult.cpp.

45{
46 return message;
47}

◆ where()

const std::source_location & echomap::ErrorResult::where ( ) const
nodiscardnoexcept

Observes the location of the error origin.

Returns
Location of the invoker of the ErrorResult.

Definition at line 49 of file ErrorResult.cpp.

50{
51 return location;
52}

Member Data Documentation

◆ location

std::source_location echomap::ErrorResult::location
private

Definition at line 85 of file ErrorResult.hpp.

◆ message

std::string echomap::ErrorResult::message
private

Definition at line 84 of file ErrorResult.hpp.

◆ responsible_task

std::unique_ptr<ITask> echomap::ErrorResult::responsible_task
private

Definition at line 86 of file ErrorResult.hpp.


The documentation for this class was generated from the following files: