EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
ErrorResult.cpp
Go to the documentation of this file.
1
9
10#include "ErrorResult.hpp"
11
12#include "../../errors/LocatableError.hpp"
14#include "../tasks/ITask.hpp"
15
16namespace echomap
17{
18
20 const std::string_view message,
21 const std::source_location location,
22 std::unique_ptr<ITask> responsible_task
23) :
24 message(message),
25 location(location),
26 responsible_task(std::move(responsible_task))
27{
28}
29
31 const LocatableError& exception,
32 std::unique_ptr<ITask> responsible_task
33) :
34 message(exception.what()),
35 location(exception.where()),
36 responsible_task(std::move(responsible_task))
37{
38}
39
40ErrorResult::~ErrorResult() noexcept = default;
41
42ErrorResult::ErrorResult(ErrorResult&&) noexcept = default;
43
44std::string_view ErrorResult::what() const noexcept
45{
46 return message;
47}
48
50{
51 return location;
52}
53
55{
56 return responsible_task.get();
57}
58
59} // namespace echomap
ErrorResult specification.
Task description interface specification.
Audio signal class specification.
Indicates that an ITask did not successfully complete.
const std::source_location & where() const noexcept
Observes the location of the error origin.
const ITask * observe_responsible_task() const noexcept
Retrieves an observing pointer to the ITask responsible for causing the ErrorResult.
std::string_view what() const noexcept
Observes the human-readable error message.
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.
An ITask represents an invocable piece of work that produces a WorkerResult.
Definition ITask.hpp:23
The main EchoMap outermost namespace for all non-exported symbols.
STL namespace.