Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
async_errors.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <stdexcept>
7#include <string>
8#include <utility>
9
10namespace uni20::async
11{
12
14class async_error : public std::runtime_error {
15 public:
16 explicit async_error(std::string message) : std::runtime_error(std::move(message)) {}
17};
18
21 public:
22 explicit async_state_error(std::string message) : async_error(std::move(message)) {}
23};
24
27 public:
28 async_storage_missing() : async_state_error("Async storage is missing") {}
29};
30
33 public:
34 async_value_uninitialized() : async_state_error("Async value requires initialization before access") {}
35};
36
39 public:
40 explicit async_cancellation(std::string message) : async_error(std::move(message)) {}
41};
42
45 public:
46 task_cancelled() : async_cancellation("AsyncTask was cancelled") {}
47};
48
51 public:
52 explicit buffer_error(std::string message) : async_state_error(std::move(message)) {}
53};
54
57 public:
58 buffer_cancelled() : async_cancellation("ReadBuffer was cancelled: no value written") {}
59};
60
63 public:
64 explicit buffer_uninitialized(std::string message) : buffer_error(std::move(message)) {}
65};
66
69 public:
70 buffer_read_uninitialized() : buffer_uninitialized("Attempt to read from a buffer that has not been initialized") {}
71};
72
75 public:
77 : buffer_uninitialized("Attempt to write via mutable reference to an uninitialized buffer; use emplace()")
78 {}
79};
80
81} // namespace uni20::async
Base class for cancellation-related async exceptions.
Definition async_errors.hpp:38
async_cancellation(std::string message)
Definition async_errors.hpp:40
Base class for all async subsystem exceptions.
Definition async_errors.hpp:14
async_error(std::string message)
Definition async_errors.hpp:16
Base class for invalid async state transitions or accesses.
Definition async_errors.hpp:20
async_state_error(std::string message)
Definition async_errors.hpp:22
Thrown when Async storage metadata is missing unexpectedly.
Definition async_errors.hpp:26
async_storage_missing()
Definition async_errors.hpp:28
Thrown when an Async value is accessed before initialization.
Definition async_errors.hpp:32
async_value_uninitialized()
Definition async_errors.hpp:34
Raised when a buffer read path is cancelled intentionally.
Definition async_errors.hpp:56
buffer_cancelled()
Definition async_errors.hpp:58
Base class for buffer-related failures.
Definition async_errors.hpp:50
buffer_error(std::string message)
Definition async_errors.hpp:52
Raised when a reader attempts to access an uninitialized buffer.
Definition async_errors.hpp:68
buffer_read_uninitialized()
Definition async_errors.hpp:70
Base class for access to a buffer without a constructed value.
Definition async_errors.hpp:62
buffer_uninitialized(std::string message)
Definition async_errors.hpp:64
Raised when a writer requests a mutable reference before construction.
Definition async_errors.hpp:74
buffer_write_uninitialized()
Definition async_errors.hpp:76
Raised when an AsyncTask is cancelled before completion.
Definition async_errors.hpp:44
task_cancelled()
Definition async_errors.hpp:46
Definition qnum.hpp:403
This represents the reverse-mode adjoint for functions of complex variables, assuming a real-valued s...
Definition async/async.hpp:26