EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
ErrorResult.hpp
Go to the documentation of this file.
1
9
10#ifndef ECHOMAP_ERRORRESULT_HPP
11#define ECHOMAP_ERRORRESULT_HPP
12
13#include <memory>
14#include <source_location>
15#include <string>
16#include <string_view>
17
18namespace echomap
19{
20
21class ITask;
22class LocatableError;
23
28{
29public:
37 explicit ErrorResult(
38 std::string_view message,
39 std::source_location location,
40 std::unique_ptr<ITask> responsible_task
41 );
42
49 explicit ErrorResult(
50 const LocatableError& exception,
51 std::unique_ptr<ITask> responsible_task
52 );
53
54 ~ErrorResult() noexcept;
55
56 ErrorResult(const ErrorResult&) = delete;
57 ErrorResult& operator=(const ErrorResult&) = delete;
58
59 ErrorResult(ErrorResult&&) noexcept;
60
66 [[nodiscard]] std::string_view what() const noexcept;
67
73 [[nodiscard]] const std::source_location& where() const noexcept;
74
81 [[nodiscard]] const ITask* observe_responsible_task() const noexcept;
82
83private:
84 std::string message;
85 std::source_location location;
86 std::unique_ptr<ITask> responsible_task;
87};
88
89} // namespace echomap
90
91#endif // ECHOMAP_ERRORRESULT_HPP
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.