Joedb 9.1.3
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Posthumous_Thrower.h
Go to the documentation of this file.
1#ifndef joedb_Posthumous_Thrower_declared
2#define joedb_Posthumous_Thrower_declared
3
4namespace joedb
5{
6 class Posthumous_Catcher;
7
8 /// A class that can postpone exceptions from its destructor by sending
9 /// them to a @ref Posthumous_Catcher
10 /// @ingroup error
12 {
13 private:
14 Posthumous_Catcher *catcher = nullptr;
15
16 protected:
17 void postpone_exception(const char *message = nullptr) noexcept;
18
19 public:
20 void set_catcher(Posthumous_Catcher &new_catcher) noexcept
21 {
22 catcher = &new_catcher;
23 }
24 };
25}
26
27#endif
Catch exceptions sent from the destructor of a Posthumous_Thrower.
A class that can postpone exceptions from its destructor by sending them to a Posthumous_Catcher.
void set_catcher(Posthumous_Catcher &new_catcher) noexcept
void postpone_exception(const char *message=nullptr) noexcept
Definition Blob.h:7