Adiar 2.1.0
An External Memory Decision Diagram Library
Loading...
Searching...
No Matches
exception.h
1#ifndef ADIAR_EXCEPTION_H
2#define ADIAR_EXCEPTION_H
3
4// Include exceptions from STD for aliasing
5#include <exception>
6#include <stdexcept>
7#include <system_error>
8
9namespace adiar
10{
11 // TODO: Design custom exceptions for Adiar.
12 //
13 // Notice that common use-cases are:
14 //
15 // - User has provided a list that does not contain a needed element/too
16 // short. This is quite similar to an `out_of_range` error.
17 //
18 // - User has provided a list that does not satisfy the required ordering.
19 // Right now, here we throw an `invalid_argument`.
20 //
21 // - User has provided a label-value that does not fit into the number of
22 // bits. Currently, we here use an `invalid_argument`
23 //
24 // - User has called a function that is not 'available' in the current state.
25 // Right now, we here use `domain_error`.
26 //
27 // - I/O errors from Adiar's files or from TPIE.
28 // Here we currently use `runtime_error` / `system_error`.
29
33 using invalid_argument = std::invalid_argument;
34
38 using domain_error = std::domain_error;
39
43 using out_of_range = std::out_of_range;
44
48 using runtime_error = std::runtime_error;
49
53 using system_error = std::system_error;
54}
55
56#endif // ADIAR_EXCEPTION_H
Core types.
Definition adiar.h:40
std::system_error system_error
System runtime errors with an associated error code.
Definition exception.h:53
std::out_of_range out_of_range
Attempt to access elements outside of the given range.
Definition exception.h:43
std::domain_error domain_error
Inputs for which an operation is undefined.
Definition exception.h:38
std::runtime_error runtime_error
Errors beyond the scope of the program.
Definition exception.h:48
std::invalid_argument invalid_argument
Inputs that are invalid.
Definition exception.h:33