| 1 | /* oo_DESTROY.h |
| 2 | * |
| 3 | * Copyright (C) 1994-2007,2009-2020,2022-2024,2026 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "oo_undef.h" |
| 20 | |
| 21 | #define oo_SIMPLE(type, storage, x) |
| 22 | |
| 23 | #define oo_SET(type, storage, x, setType) |
| 24 | |
| 25 | #define oo_ANYVEC(type, storage, x, sizeExpression) \ |
| 26 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 27 | our x. reset(); \ |
| 28 | } else { } |
| 29 | |
| 30 | #define oo_ANYMAT(type, storage, x, nrowExpression, ncolExpression) \ |
| 31 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 32 | our x. reset(); \ |
| 33 | } else { } |
| 34 | |
| 35 | #define oo_ANYTEN3(type, storage, x, ndim1Expression, ndim2Expression, ndim3Expression) \ |
| 36 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 37 | our x. reset(); \ |
| 38 | } else { } |
| 39 | |
| 40 | #define oo_ENUMx(kType, storage, x) |
| 41 | |
| 42 | //#define oo_ENUMx_SET(kType, storage, x, setType) |
| 43 | |
| 44 | #define oo_STRINGx(storage, x) \ |
| 45 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 46 | our x. reset(); \ |
| 47 | } else { } |
| 48 | |
| 49 | #define oo_STRINGx_SET(storage, x, setType) \ |
| 50 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 51 | for (int _i = 0; _i <= setType::MAX; _i ++) { \ |
| 52 | our x [_i]. reset(); \ |
| 53 | } \ |
| 54 | } else { } |
| 55 | |
| 56 | #define oo_STRINGx_VECTOR(storage, x, sizeExpression) \ |
| 57 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 58 | our x. reset(); \ |
| 59 | } else { } |
| 60 | |
| 61 | #define oo_STRUCT(Type, x) \ |
| 62 | our x. destroy (); |
| 63 | |
| 64 | #define oo_STRUCT_SET(Type, x, setType) \ |
| 65 | for (int _i = 0; _i <= (int) setType::MAX; _i ++) { \ |
| 66 | our x [_i]. destroy (); \ |
| 67 | } |
| 68 | |
| 69 | #define oo_STRUCTVEC(Type, x, sizeExpression) \ |
| 70 | { \ |
| 71 | for (integer _i = 1; _i <= our x.size; _i ++) { \ |
| 72 | our x [_i]. destroy (); \ |
| 73 | } \ |
| 74 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 75 | our x. reset(); \ |
| 76 | } else { } \ |
| 77 | } |
| 78 | |
| 79 | #define oo_STRUCTMAT(Type, x, nrowExpression, ncolExpression) \ |
| 80 | { \ |
| 81 | for (integer _irow = 1; _irow <= our x.nrow; _irow ++) { \ |
| 82 | for (integer _icol = 1; _icol <= our x.ncol; _icol ++) { \ |
| 83 | our x [_irow] [_icol]. destroy (); \ |
| 84 | } \ |
| 85 | } \ |
| 86 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 87 | our x. reset(); \ |
| 88 | } else { } \ |
| 89 | } |
| 90 | |
| 91 | #define oo_OBJECT(Class, version, x) \ |
| 92 | if (! _thisStructCanAutodestroyItsMembers_) { \ |
| 93 | our x. reset(); \ |
| 94 | } else { } |
| 95 | |
| 96 | #define oo_COLLECTION_OF(Class, x, ItemClass, version) |
| 97 | |
| 98 | #define oo_COLLECTION(Class, x, ItemClass, version) |
| 99 | |
| 100 | #define oo_TRANSIENT_FILE(x) |
| 101 | |
| 102 | #define oo_TRANSIENT_FOLDER(x) |
| 103 | |
| 104 | #define oo_UNSAFE_BORROWED_TRANSIENT_CONST_OBJECT_REFERENCE(Class, x) |
| 105 | |
| 106 | #define oo_UNSAFE_BORROWED_TRANSIENT_MUTABLE_OBJECT_REFERENCE(Class, x) |
| 107 | |
| 108 | #define oo_DEFINE_STRUCT(Struct) \ |
| 109 | void struct##Struct :: destroy () { \ |
| 110 | constexpr bool _thisStructCanAutodestroyItsMembers_ = false; \ |
| 111 | (void) _thisStructCanAutodestroyItsMembers_; |
| 112 | |
| 113 | #define oo_END_STRUCT(Type) \ |
| 114 | } |
| 115 | |
| 116 | #define oo_DEFINE_CLASS(Class, Parent) \ |
| 117 | void struct##Class :: v9_destroy () noexcept { \ |
| 118 | constexpr bool _thisStructCanAutodestroyItsMembers_ = true; \ |
| 119 | (void) _thisStructCanAutodestroyItsMembers_; |
| 120 | |
| 121 | #define oo_END_CLASS(Class) \ |
| 122 | Class##_Parent :: v9_destroy (); \ |
| 123 | } |
| 124 | |
| 125 | #define oo_FROM(from) |
| 126 | |
| 127 | #define oo_ENDFROM |
| 128 | |
| 129 | #define oo_DECLARING 0 |
| 130 | #define oo_DESTROYING 1 |
| 131 | #define oo_COPYING 0 |
| 132 | #define oo_COMPARING 0 |
| 133 | #define oo_VALIDATING_ENCODING 0 |
| 134 | #define oo_READING 0 |
| 135 | #define oo_READING_TEXT 0 |
| 136 | #define oo_READING_BINARY 0 |
| 137 | #define oo_WRITING 0 |
| 138 | #define oo_WRITING_TEXT 0 |
| 139 | #define oo_WRITING_BINARY 0 |
| 140 | #define oo_DESCRIBING 0 |
| 141 | |
| 142 | /* End of file oo_DESTROY.h */ |