1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
---|
3 | // |
---|
4 | // The contents of this file are covered under the licence agreement in the |
---|
5 | // file "LICENCE" distributed with Cforall. |
---|
6 | // |
---|
7 | // exception.hfa -- User facing tools for working with exceptions. |
---|
8 | // |
---|
9 | // Author : Andrew Beach |
---|
10 | // Created On : Thu Apr 7 10:25:00 2020 |
---|
11 | // Last Modified By : Andrew Beach |
---|
12 | // Last Modified On : Wed May 25 17:20:00 2022 |
---|
13 | // Update Count : 5 |
---|
14 | // |
---|
15 | |
---|
16 | // Everything below this line should be considered a patch while the exception |
---|
17 | // objects themselves are designed and created and should be removed in time. |
---|
18 | // ----------------------------------------------------------------------------------------------- |
---|
19 | |
---|
20 | // EHM_DEFAULT_VTABLE(exception_name, (arguments)) |
---|
21 | // Create a declaration for a (possibly polymorphic) default vtable. |
---|
22 | #define EHM_DEFAULT_VTABLE(exception_name, arguments) \ |
---|
23 | vtable(exception_name arguments) & const _default_vtable |
---|
24 | |
---|
25 | // IS_EXCEPTION(exception_name [, (...parameters)]) |
---|
26 | // IS_RESUMPTION_EXCEPTION(exception_name [, (parameters...)]) |
---|
27 | // IS_TERMINATION_EXCEPTION(exception_name [, (parameters...)]) |
---|
28 | // Create an assertion that exception_name, possibly with the qualifing parameters, is the given |
---|
29 | // kind of exception with the standard vtable with the same parameters if applicable. |
---|
30 | #define IS_EXCEPTION(...) _IS_EXCEPTION(is_exception, __VA_ARGS__, , ~) |
---|
31 | #define IS_RESUMPTION_EXCEPTION(...) _IS_EXCEPTION(is_resumption_exception, __VA_ARGS__, , ~) |
---|
32 | #define IS_TERMINATION_EXCEPTION(...) _IS_EXCEPTION(is_termination_exception, __VA_ARGS__, , ~) |
---|
33 | #define _IS_EXCEPTION(kind, exception_name, parameters, ...) \ |
---|
34 | kind(exception_name parameters, vtable(exception_name parameters)) |
---|