autogen/include/Clownfish/Obj.h

filter: Statementstmt 0.0% 0 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 3 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« autogen/include/Clownfish/Class.h ↑ Summary autogen/include/Lucy/Index/SortCache.h »
1 /*
2 * ***********************************************
3 *
4 * !!!! DO NOT EDIT !!!!
5 *
6 * This file was auto-generated by Build.PL.
7 *
8 * ***********************************************
9 *
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed with
12 * this work for additional information regarding copyright ownership.
13 * The ASF licenses this file to You under the Apache License, Version 2.0
14 * (the "License"); you may not use this file except in compliance with
15 * the License. You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 */
25  
26  
27 #ifndef H_CLOWNFISH_OBJ
28 #define H_CLOWNFISH_OBJ 1
29  
30  
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34  
35 #include "cfish_parcel.h"
36  
37 /* Include the header for this class's parent.
38 */
39  
40  
41  
42 /* Define the struct layout for instances of this class.
43 */
44  
45 #ifdef C_CFISH_OBJ
46 extern uint32_t cfish_Obj_IVARS_OFFSET;
47 typedef struct cfish_ObjIVARS cfish_ObjIVARS;
48 static CFISH_INLINE cfish_ObjIVARS*
49 cfish_Obj_IVARS(cfish_Obj *self) {
50 char *ptr = (char*)self + cfish_Obj_IVARS_OFFSET;
51 return (cfish_ObjIVARS*)ptr;
52 }
53 #ifdef CFISH_USE_SHORT_NAMES
54 #define ObjIVARS cfish_ObjIVARS
55 #define Obj_IVARS cfish_Obj_IVARS
56 #endif
57  
58 struct cfish_Obj {
59 CFISH_OBJ_HEAD
60 cfish_Class* klass;
61 };
62  
63 #endif /* C_CFISH_OBJ */
64  
65 /* Declare this class's inert variables.
66 */
67  
68  
69  
70 /* Declare both this class's inert functions and the C functions which
71 * implement this class's dynamic methods.
72 */
73  
74 CFISH_VISIBLE cfish_Obj*
75 cfish_Obj_init(cfish_Obj* self);
76  
77 CFISH_VISIBLE cfish_Class*
78 cfish_Obj_get_class(cfish_Obj* self);
79  
80 CFISH_VISIBLE cfish_String*
81 cfish_Obj_get_class_name(cfish_Obj* self);
82  
83 CFISH_VISIBLE bool
84 cfish_Obj_is_a(cfish_Obj* self, cfish_Class* ancestor);
85  
86 CFISH_VISIBLE cfish_Obj*
87 cfish_Obj_downcast(cfish_Obj* obj, cfish_Class* klass, const char* file, int line, const char* func);
88  
89 CFISH_VISIBLE cfish_Obj*
90 cfish_Obj_certify(cfish_Obj* obj, cfish_Class* klass, const char* file, int line, const char* func);
91  
92 void*
93 CFISH_Obj_To_Host_IMP(cfish_Obj* self, void* vcache);
94  
95 cfish_Obj*
96 CFISH_Obj_Clone_IMP(cfish_Obj* self);
97  
98 bool
99 CFISH_Obj_Equals_IMP(cfish_Obj* self, cfish_Obj* other);
100  
101 int32_t
102 CFISH_Obj_Compare_To_IMP(cfish_Obj* self, cfish_Obj* other);
103  
104 void
105 CFISH_Obj_Destroy_IMP(cfish_Obj* self);
106  
107 cfish_String*
108 CFISH_Obj_To_String_IMP(cfish_Obj* self);
109  
110  
111  
112 /* Define typedefs for each dynamic method, allowing us to cast generic
113 * pointers to the appropriate function pointer type more cleanly.
114 */
115  
116 typedef void*
117 (*CFISH_Obj_To_Host_t)(cfish_Obj* self, void* vcache);
118  
119 typedef cfish_Obj*
120 (*CFISH_Obj_Clone_t)(cfish_Obj* self);
121  
122 typedef bool
123 (*CFISH_Obj_Equals_t)(cfish_Obj* self, cfish_Obj* other);
124  
125 typedef int32_t
126 (*CFISH_Obj_Compare_To_t)(cfish_Obj* self, cfish_Obj* other);
127  
128 typedef void
129 (*CFISH_Obj_Destroy_t)(cfish_Obj* self);
130  
131 typedef cfish_String*
132 (*CFISH_Obj_To_String_t)(cfish_Obj* self);
133  
134  
135  
136 /* Define type-safe wrappers for inert functions of Obj.
137 */
138  
139  
140  
141 /* Define the inline functions which implement this class's virtual methods.
142 */
143  
144 extern CFISH_VISIBLE uint32_t CFISH_Obj_To_Host_OFFSET;
145 static CFISH_INLINE void*
146 0 CFISH_Obj_To_Host(cfish_Obj* self, void* vcache) {
147 0 const CFISH_Obj_To_Host_t method = (CFISH_Obj_To_Host_t)cfish_obj_method(self, CFISH_Obj_To_Host_OFFSET);
148 0 return method(self, vcache);
149 }
150  
151 extern CFISH_VISIBLE uint32_t CFISH_Obj_Clone_OFFSET;
152 static CFISH_INLINE cfish_Obj*
153 CFISH_Obj_Clone(cfish_Obj* self) {
154 const CFISH_Obj_Clone_t method = (CFISH_Obj_Clone_t)cfish_obj_method(self, CFISH_Obj_Clone_OFFSET);
155 return method(self);
156 }
157  
158 extern CFISH_VISIBLE uint32_t CFISH_Obj_Equals_OFFSET;
159 static CFISH_INLINE bool
160 CFISH_Obj_Equals(cfish_Obj* self, cfish_Obj* other) {
161 const CFISH_Obj_Equals_t method = (CFISH_Obj_Equals_t)cfish_obj_method(self, CFISH_Obj_Equals_OFFSET);
162 return method(self, other);
163 }
164  
165 extern CFISH_VISIBLE uint32_t CFISH_Obj_Compare_To_OFFSET;
166 static CFISH_INLINE int32_t
167 CFISH_Obj_Compare_To(cfish_Obj* self, cfish_Obj* other) {
168 const CFISH_Obj_Compare_To_t method = (CFISH_Obj_Compare_To_t)cfish_obj_method(self, CFISH_Obj_Compare_To_OFFSET);
169 return method(self, other);
170 }
171  
172 extern CFISH_VISIBLE uint32_t CFISH_Obj_Destroy_OFFSET;
173 static CFISH_INLINE void
174 CFISH_Obj_Destroy(cfish_Obj* self) {
175 const CFISH_Obj_Destroy_t method = (CFISH_Obj_Destroy_t)cfish_obj_method(self, CFISH_Obj_Destroy_OFFSET);
176 method(self);
177 }
178  
179 extern CFISH_VISIBLE uint32_t CFISH_Obj_To_String_OFFSET;
180 static CFISH_INLINE cfish_String*
181 CFISH_Obj_To_String(cfish_Obj* self) {
182 const CFISH_Obj_To_String_t method = (CFISH_Obj_To_String_t)cfish_obj_method(self, CFISH_Obj_To_String_OFFSET);
183 return method(self);
184 }
185  
186  
187  
188 /* Declare callbacks for wrapping host overrides.
189 */
190  
191 #ifdef CFISH_NO_DYNAMIC_OVERRIDES
192 #define Cfish_Obj_To_Host_OVERRIDE NULL
193 #define Cfish_Obj_Clone_OVERRIDE NULL
194 #define Cfish_Obj_Equals_OVERRIDE NULL
195 #define Cfish_Obj_Compare_To_OVERRIDE NULL
196 #define Cfish_Obj_Destroy_OVERRIDE NULL
197 #define Cfish_Obj_To_String_OVERRIDE NULL
198 #else
199 void*
200 Cfish_Obj_To_Host_OVERRIDE(cfish_Obj* self, void* vcache);
201 cfish_Obj*
202 Cfish_Obj_Clone_OVERRIDE(cfish_Obj* self);
203 bool
204 Cfish_Obj_Equals_OVERRIDE(cfish_Obj* self, cfish_Obj* other);
205 int32_t
206 Cfish_Obj_Compare_To_OVERRIDE(cfish_Obj* self, cfish_Obj* other);
207 void
208 Cfish_Obj_Destroy_OVERRIDE(cfish_Obj* self);
209 cfish_String*
210 Cfish_Obj_To_String_OVERRIDE(cfish_Obj* self);
211 #endif
212  
213  
214 /* Define "short names" for this class's symbols.
215 */
216  
217 #ifdef CFISH_USE_SHORT_NAMES
218 #define Obj cfish_Obj
219 #define OBJ CFISH_OBJ
220 #define Obj_init cfish_Obj_init
221 #define Obj_get_class cfish_Obj_get_class
222 #define Obj_get_class_name cfish_Obj_get_class_name
223 #define Obj_is_a cfish_Obj_is_a
224 #define Obj_downcast cfish_Obj_downcast
225 #define Obj_certify cfish_Obj_certify
226 #define Obj_To_Host_IMP CFISH_Obj_To_Host_IMP
227 #define Obj_Clone_IMP CFISH_Obj_Clone_IMP
228 #define Obj_Equals_IMP CFISH_Obj_Equals_IMP
229 #define Obj_Compare_To_IMP CFISH_Obj_Compare_To_IMP
230 #define Obj_Destroy_IMP CFISH_Obj_Destroy_IMP
231 #define Obj_To_String_IMP CFISH_Obj_To_String_IMP
232 #define Obj_To_Host CFISH_Obj_To_Host
233 #define Obj_To_Host_t CFISH_Obj_To_Host_t
234 #define Obj_Clone CFISH_Obj_Clone
235 #define Obj_Clone_t CFISH_Obj_Clone_t
236 #define Obj_Equals CFISH_Obj_Equals
237 #define Obj_Equals_t CFISH_Obj_Equals_t
238 #define Obj_Compare_To CFISH_Obj_Compare_To
239 #define Obj_Compare_To_t CFISH_Obj_Compare_To_t
240 #define Obj_Destroy CFISH_Obj_Destroy
241 #define Obj_Destroy_t CFISH_Obj_Destroy_t
242 #define Obj_To_String CFISH_Obj_To_String
243 #define Obj_To_String_t CFISH_Obj_To_String_t
244 #endif /* CFISH_USE_SHORT_NAMES */
245  
246  
247  
248 #define CFISH_DOWNCAST(_obj, _class) \
249 cfish_Obj_downcast((cfish_Obj*)(_obj), (_class), \
250 __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
251  
252  
253 #define CFISH_CERTIFY(_obj, _class) \
254 cfish_Obj_certify((cfish_Obj*)(_obj), (_class), \
255 __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
256  
257 #ifdef CFISH_USE_SHORT_NAMES
258 #define DOWNCAST CFISH_DOWNCAST
259 #define CERTIFY CFISH_CERTIFY
260 #endif
261  
262  
263  
264 #ifdef __cplusplus
265 }
266 #endif
267  
268 #endif /* H_CLOWNFISH_OBJ */
269  
270  
271  
272  
« autogen/include/Clownfish/Class.h ↑ Summary autogen/include/Lucy/Index/SortCache.h »