Debian Codegraph @

sys/oo_COPY.h

raw symbols SCIP
1 /* oo_COPY.h
2 *
3 * Copyright (C) 1994-2007,2009,2011-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"cxx . . $ `<file>/sys/oo_undef.h`/
20
21 #define oo_SIMPLEcxx . . $ `sys/oo_COPY.h:21:9`!(type, storage, x) \
22 thycxx . . $ `melder/melder.h:45:9`! x = ourcxx . . $ `melder/melder.h:42:9`! x;
23
24 #define oo_SETcxx . . $ `sys/oo_COPY.h:24:9`!(type, storage, x, setType) \
25 for (int _i = 0; _i <= (int) setType::MAX; _i ++) { \
26 thy x [_i] = our x [_i]; \
27 }
28
29 #define oo_ANYVECcxx . . $ `sys/oo_COPY.h:29:9`!(type, storage, x, sizeExpression) \
30 thy x = newvectorcopy (our x.all());
31
32 #define oo_ANYMATcxx . . $ `sys/oo_COPY.h:32:9`!(type, storage, x, nrowExpression, ncolExpression) \
33 thy x = newmatrixcopy (our x.all());
34
35 #define oo_ANYTEN3cxx . . $ `sys/oo_COPY.h:35:9`!(type, storage, x, ndim1Expression, ndim2Expression, ndim3Expression) \
36 thy x = newtensor3copy (our x.get());
37
38 #define oo_ENUMxcxx . . $ `sys/oo_COPY.h:38:9`!(kType, storage, x) \
39 thy x = our x;
40
41 //#define oo_ENUMx_SET(kType, storage, x, setType) \
42 // for (int _i = 0; _i <= (int) setType::MAX; _i ++) \
43 // thy x [_i] = our x [_i];
44
45 #define oo_STRINGxcxx . . $ `sys/oo_COPY.h:45:9`!(storage, x) \
46 if (ourcxx . . $ `melder/melder.h:42:9`! x) \
47 thycxx . . $ `melder/melder.h:45:9`! x = Melder_dup (ourcxx . . $ `melder/melder.h:42:9`! x.get());
48
49 #define oo_STRINGx_SETcxx . . $ `sys/oo_COPY.h:49:9`!(storage, x, setType) \
50 for (int _i = 0; _i <= setType::MAX; _i ++) { \
51 if (our x [_i]) \
52 thy x [_i] = Melder_dup (our x [_i].get()); \
53 }
54
55 #define oo_STRINGx_VECTORcxx . . $ `sys/oo_COPY.h:55:9`!(storage, x, sizeExpression) \
56 { \
57 const integer _size = (sizeExpression); \
58 Melder_assert (_size == our x.size); \
59 if (our x) { \
60 thy x = autoSTRVEC (_size); \
61 for (integer _i = 1; _i <= _size; _i ++) { \
62 if (our x [_i]) \
63 thy x [_i] = Melder_dup (our x [_i].get()); \
64 } \
65 } \
66 }
67
68 #define oo_STRUCTcxx . . $ `sys/oo_COPY.h:68:9`!(Type, x) \
69 our x. copy (& thy x);
70
71 #define oo_STRUCT_SETcxx . . $ `sys/oo_COPY.h:71:9`!(Type, x, setType) \
72 for (int _i = 0; _i <= (int) setType::MAX; _i ++) { \
73 our x [_i]. copy (& thy x [_i]); \
74 }
75
76 #define oo_STRUCTVECcxx . . $ `sys/oo_COPY.h:76:9`!(Type, x, sizeExpression) \
77 { \
78 const integer _size = (sizeExpression); \
79 Melder_assert (_size == our x.size); \
80 if (_size > 0) { \
81 thy x = newvectorzero <struct##Type> (_size); \
82 for (integer _i = 1; _i <= _size; _i ++) { \
83 our x [_i]. copy (& thy x [_i]); \
84 } \
85 } \
86 }
87
88 #define oo_STRUCTMATcxx . . $ `sys/oo_COPY.h:88:9`!(Type, x, nrowExpression, ncolExpression) \
89 { \
90 const integer _nrow = (nrowExpression), _ncol = (nrowExpression); \
91 Melder_assert (_nrow == our x.nrow && _ncol == our x.ncol); \
92 if (_nrow > 0 && _ncol > 0) { \
93 thy x = newmatrixzero <struct##Type> (_nrow, _ncol); \
94 for (integer _irow = 1; _irow <= _nrow; _irow ++) { \
95 for (integer _icol = 1; _icol <= _ncol; _icol ++) { \
96 our x [_irow] [_icol]. copy (& thy x [_irow] [_icol]); \
97 } \
98 } \
99 } \
100 }
101
102 #define oo_OBJECTcxx . . $ `sys/oo_COPY.h:102:9`!(Class, version, x) \
103 if (our x) \
104 thy x = Data_copy (our x.get());
105
106 #define oo_COLLECTION_OFcxx . . $ `sys/oo_COPY.h:106:9`!(Class, x, ItemClass, version) \
107 if (our x._capacity > 0) { \
108 thy x.at._elements = Melder_calloc (ItemClass, our x._capacity); \
109 thy x.at._elements --; \
110 } \
111 thy x.size = our x.size; \
112 thy x._capacity = our x._capacity; \
113 thy x._ownItems = our x._ownItems; \
114 thy x._ownershipInitialized = our x._ownershipInitialized; \
115 for (integer _i = 1; _i <= our x.size; _i ++) { \
116 if (our x.at [_i]) \
117 thy x.at [_i] = Data_copy (our x.at [_i]).releaseToAmbiguousOwner(); \
118 }
119
120 #define oo_COLLECTIONcxx . . $ `sys/oo_COPY.h:120:9`!(Class, x, ItemClass, version) \
121 if (our x) \
122 thy x = Data_copy (our x.get());
123
124 #define oo_TRANSIENT_FILEcxx . . $ `sys/oo_COPY.h:124:9`!(x) \
125 MelderFile_copy (& our x, & thy x);
126
127 #define oo_TRANSIENT_FOLDERcxx . . $ `sys/oo_COPY.h:127:9`!(x) \
128 MelderFolder_copy (& our x, & thy x);
129
130 #define oo_UNSAFE_BORROWED_TRANSIENT_CONST_OBJECT_REFERENCEcxx . . $ `sys/oo_COPY.h:130:9`!(Class, x) \
131 thy x = our x; // reference copy
132
133 #define oo_UNSAFE_BORROWED_TRANSIENT_MUTABLE_OBJECT_REFERENCEcxx . . $ `sys/oo_COPY.h:133:9`!(Class, x) \
134 thy x = our x; // reference copy
135
136 #define oo_DEFINE_STRUCTcxx . . $ `sys/oo_COPY.h:136:9`!(Type) \
137 void struct##Type :: copy (Type thee) const {
138
139 #define oo_END_STRUCTcxx . . $ `sys/oo_COPY.h:139:9`!(Type) \
140 }
141
142 #define oo_DEFINE_CLASScxx . . $ `sys/oo_COPY.h:142:9`!(Class, Parent) \
143 void struct##Class :: v1_copy (Daata _thee_Daata) const { \
144 Class thee = static_cast <Class> (_thee_Daata); \
145 Class##_Parent :: v1_copy (thee);
146
147 #define oo_END_CLASScxx . . $ `sys/oo_COPY.h:147:9`!(Class) \
148 }
149
150 #define oo_FROMcxx . . $ `sys/oo_COPY.h:150:9`!(from)
151
152 #define oo_ENDFROMcxx . . $ `sys/oo_COPY.h:152:9`!
153
154 #define oo_DECLARINGcxx . . $ `sys/oo_COPY.h:154:9`! 0
155 #define oo_DESTROYINGcxx . . $ `sys/oo_COPY.h:155:9`! 0
156 #define oo_COPYINGcxx . . $ `sys/oo_COPY.h:156:9`! 1
157 #define oo_COMPARINGcxx . . $ `sys/oo_COPY.h:157:9`! 0
158 #define oo_VALIDATING_ENCODINGcxx . . $ `sys/oo_COPY.h:158:9`! 0
159 #define oo_READINGcxx . . $ `sys/oo_COPY.h:159:9`! 0
160 #define oo_READING_TEXTcxx . . $ `sys/oo_COPY.h:160:9`! 0
161 #define oo_READING_BINARYcxx . . $ `sys/oo_COPY.h:161:9`! 0
162 #define oo_WRITINGcxx . . $ `sys/oo_COPY.h:162:9`! 0
163 #define oo_WRITING_TEXTcxx . . $ `sys/oo_COPY.h:163:9`! 0
164 #define oo_WRITING_BINARYcxx . . $ `sys/oo_COPY.h:164:9`! 0
165 #define oo_DESCRIBINGcxx . . $ `sys/oo_COPY.h:165:9`! 0
166
167 /* End of file oo_COPY.h */