autogen/include/Lucy/Document/Doc.h

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 11 / 11 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« autogen/include/Clownfish/TestHarness/TestSuite.h ↑ Summary autogen/include/Lucy/Index/Indexer.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_LUCY_DOCUMENT_DOC
28 #define H_LUCY_DOCUMENT_DOC 1
29  
30  
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34  
35 #include "lucy_parcel.h"
36  
37 /* Include the header for this class's parent.
38 */
39  
40 #include "Clownfish/Obj.h"
41  
42 /* Define the struct layout for instances of this class.
43 */
44  
45 #ifdef C_LUCY_DOC
46 extern uint32_t lucy_Doc_IVARS_OFFSET;
47 typedef struct lucy_DocIVARS lucy_DocIVARS;
48 static CFISH_INLINE lucy_DocIVARS*
49 lucy_Doc_IVARS(lucy_Doc *self) {
50 char *ptr = (char*)self + lucy_Doc_IVARS_OFFSET;
51 return (lucy_DocIVARS*)ptr;
52 }
53 #ifdef LUCY_USE_SHORT_NAMES
54 #define DocIVARS lucy_DocIVARS
55 #define Doc_IVARS lucy_Doc_IVARS
56 #endif
57  
58 struct lucy_DocIVARS {
59 void* fields;
60 int32_t doc_id;
61 };
62  
63 #endif /* C_LUCY_DOC */
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 LUCY_VISIBLE lucy_Doc*
75 lucy_Doc_new(void* fields, int32_t doc_id);
76  
77 LUCY_VISIBLE lucy_Doc*
78 lucy_Doc_init(lucy_Doc* self, void* fields, int32_t doc_id);
79  
80 void
81 LUCY_Doc_Set_Doc_ID_IMP(lucy_Doc* self, int32_t doc_id);
82  
83 int32_t
84 LUCY_Doc_Get_Doc_ID_IMP(lucy_Doc* self);
85  
86 void
87 LUCY_Doc_Store_IMP(lucy_Doc* self, cfish_String* field, cfish_Obj* value);
88  
89 void
90 LUCY_Doc_Set_Fields_IMP(lucy_Doc* self, void* fields);
91  
92 void*
93 LUCY_Doc_Get_Fields_IMP(lucy_Doc* self);
94  
95 uint32_t
96 LUCY_Doc_Get_Size_IMP(lucy_Doc* self);
97  
98 cfish_Obj*
99 LUCY_Doc_Extract_IMP(lucy_Doc* self, cfish_String* field);
100  
101 cfish_Vector*
102 LUCY_Doc_Field_Names_IMP(lucy_Doc* self);
103  
104 bool
105 LUCY_Doc_Equals_IMP(lucy_Doc* self, cfish_Obj* other);
106  
107 void
108 LUCY_Doc_Serialize_IMP(lucy_Doc* self, lucy_OutStream* outstream);
109  
110 lucy_Doc*
111 LUCY_Doc_Deserialize_IMP(lucy_Doc* self, lucy_InStream* instream);
112  
113 cfish_Hash*
114 LUCY_Doc_Dump_IMP(lucy_Doc* self);
115  
116 lucy_Doc*
117 LUCY_Doc_Load_IMP(lucy_Doc* self, cfish_Obj* dump);
118  
119 void
120 LUCY_Doc_Destroy_IMP(lucy_Doc* self);
121  
122  
123  
124 /* Define typedefs for each dynamic method, allowing us to cast generic
125 * pointers to the appropriate function pointer type more cleanly.
126 */
127  
128 typedef void*
129 (*LUCY_Doc_To_Host_t)(lucy_Doc* self, void* vcache);
130  
131 typedef cfish_Obj*
132 (*LUCY_Doc_Clone_t)(lucy_Doc* self);
133  
134 typedef bool
135 (*LUCY_Doc_Equals_t)(lucy_Doc* self, cfish_Obj* other);
136  
137 typedef int32_t
138 (*LUCY_Doc_Compare_To_t)(lucy_Doc* self, cfish_Obj* other);
139  
140 typedef void
141 (*LUCY_Doc_Destroy_t)(lucy_Doc* self);
142  
143 typedef cfish_String*
144 (*LUCY_Doc_To_String_t)(lucy_Doc* self);
145  
146 typedef void
147 (*LUCY_Doc_Set_Doc_ID_t)(lucy_Doc* self, int32_t doc_id);
148  
149 typedef int32_t
150 (*LUCY_Doc_Get_Doc_ID_t)(lucy_Doc* self);
151  
152 typedef void
153 (*LUCY_Doc_Store_t)(lucy_Doc* self, cfish_String* field, cfish_Obj* value);
154  
155 typedef void
156 (*LUCY_Doc_Set_Fields_t)(lucy_Doc* self, void* fields);
157  
158 typedef void*
159 (*LUCY_Doc_Get_Fields_t)(lucy_Doc* self);
160  
161 typedef uint32_t
162 (*LUCY_Doc_Get_Size_t)(lucy_Doc* self);
163  
164 typedef cfish_Obj*
165 (*LUCY_Doc_Extract_t)(lucy_Doc* self, cfish_String* field);
166  
167 typedef cfish_Vector*
168 (*LUCY_Doc_Field_Names_t)(lucy_Doc* self);
169  
170 typedef void
171 (*LUCY_Doc_Serialize_t)(lucy_Doc* self, lucy_OutStream* outstream);
172  
173 typedef lucy_Doc*
174 (*LUCY_Doc_Deserialize_t)(lucy_Doc* self, lucy_InStream* instream);
175  
176 typedef cfish_Hash*
177 (*LUCY_Doc_Dump_t)(lucy_Doc* self);
178  
179 typedef lucy_Doc*
180 (*LUCY_Doc_Load_t)(lucy_Doc* self, cfish_Obj* dump);
181  
182  
183  
184 /* Define type-safe wrappers for inert functions of Obj.
185 */
186  
187 static CFISH_INLINE cfish_Class*
188 lucy_Doc_get_class(lucy_Doc *self) {
189 return cfish_Obj_get_class((cfish_Obj*)self);
190 }
191  
192 static CFISH_INLINE cfish_String*
193 lucy_Doc_get_class_name(lucy_Doc *self) {
194 return cfish_Obj_get_class_name((cfish_Obj*)self);
195 }
196  
197 static CFISH_INLINE bool
198 lucy_Doc_is_a(lucy_Doc *self, cfish_Class *ancestor) {
199 return cfish_Obj_is_a((cfish_Obj*)self, ancestor);
200 }
201  
202  
203 /* Define the inline functions which implement this class's virtual methods.
204 */
205  
206 extern LUCY_VISIBLE uint32_t LUCY_Doc_To_Host_OFFSET;
207 static CFISH_INLINE void*
208 LUCY_Doc_To_Host(lucy_Doc* self, void* vcache) {
209 const LUCY_Doc_To_Host_t method = (LUCY_Doc_To_Host_t)cfish_obj_method(self, LUCY_Doc_To_Host_OFFSET);
210 return method(self, vcache);
211 }
212  
213 extern LUCY_VISIBLE uint32_t LUCY_Doc_Clone_OFFSET;
214 static CFISH_INLINE cfish_Obj*
215 LUCY_Doc_Clone(lucy_Doc* self) {
216 const LUCY_Doc_Clone_t method = (LUCY_Doc_Clone_t)cfish_obj_method(self, LUCY_Doc_Clone_OFFSET);
217 return method(self);
218 }
219  
220 extern LUCY_VISIBLE uint32_t LUCY_Doc_Equals_OFFSET;
221 static CFISH_INLINE bool
222 LUCY_Doc_Equals(lucy_Doc* self, cfish_Obj* other) {
223 const LUCY_Doc_Equals_t method = (LUCY_Doc_Equals_t)cfish_obj_method(self, LUCY_Doc_Equals_OFFSET);
224 return method(self, other);
225 }
226  
227 extern LUCY_VISIBLE uint32_t LUCY_Doc_Compare_To_OFFSET;
228 static CFISH_INLINE int32_t
229 LUCY_Doc_Compare_To(lucy_Doc* self, cfish_Obj* other) {
230 const LUCY_Doc_Compare_To_t method = (LUCY_Doc_Compare_To_t)cfish_obj_method(self, LUCY_Doc_Compare_To_OFFSET);
231 return method(self, other);
232 }
233  
234 extern LUCY_VISIBLE uint32_t LUCY_Doc_Destroy_OFFSET;
235 static CFISH_INLINE void
236 LUCY_Doc_Destroy(lucy_Doc* self) {
237 const LUCY_Doc_Destroy_t method = (LUCY_Doc_Destroy_t)cfish_obj_method(self, LUCY_Doc_Destroy_OFFSET);
238 method(self);
239 }
240  
241 extern LUCY_VISIBLE uint32_t LUCY_Doc_To_String_OFFSET;
242 static CFISH_INLINE cfish_String*
243 LUCY_Doc_To_String(lucy_Doc* self) {
244 const LUCY_Doc_To_String_t method = (LUCY_Doc_To_String_t)cfish_obj_method(self, LUCY_Doc_To_String_OFFSET);
245 return method(self);
246 }
247  
248 extern LUCY_VISIBLE uint32_t LUCY_Doc_Set_Doc_ID_OFFSET;
249 static CFISH_INLINE void
250 LUCY_Doc_Set_Doc_ID(lucy_Doc* self, int32_t doc_id) {
251 const LUCY_Doc_Set_Doc_ID_t method = (LUCY_Doc_Set_Doc_ID_t)cfish_obj_method(self, LUCY_Doc_Set_Doc_ID_OFFSET);
252 method(self, doc_id);
253 }
254  
255 extern LUCY_VISIBLE uint32_t LUCY_Doc_Get_Doc_ID_OFFSET;
256 static CFISH_INLINE int32_t
257 LUCY_Doc_Get_Doc_ID(lucy_Doc* self) {
258 const LUCY_Doc_Get_Doc_ID_t method = (LUCY_Doc_Get_Doc_ID_t)cfish_obj_method(self, LUCY_Doc_Get_Doc_ID_OFFSET);
259 return method(self);
260 }
261  
262 extern LUCY_VISIBLE uint32_t LUCY_Doc_Store_OFFSET;
263 static CFISH_INLINE void
264 1 LUCY_Doc_Store(lucy_Doc* self, cfish_String* field, cfish_Obj* value) {
265 1 const LUCY_Doc_Store_t method = (LUCY_Doc_Store_t)cfish_obj_method(self, LUCY_Doc_Store_OFFSET);
266 1 method(self, field, value);
267 1 }
268  
269 extern LUCY_VISIBLE uint32_t LUCY_Doc_Set_Fields_OFFSET;
270 static CFISH_INLINE void
271 16154 LUCY_Doc_Set_Fields(lucy_Doc* self, void* fields) {
272 16154 const LUCY_Doc_Set_Fields_t method = (LUCY_Doc_Set_Fields_t)cfish_obj_method(self, LUCY_Doc_Set_Fields_OFFSET);
273 16154 method(self, fields);
274 16154 }
275  
276 extern LUCY_VISIBLE uint32_t LUCY_Doc_Get_Fields_OFFSET;
277 static CFISH_INLINE void*
278 383 LUCY_Doc_Get_Fields(lucy_Doc* self) {
279 383 const LUCY_Doc_Get_Fields_t method = (LUCY_Doc_Get_Fields_t)cfish_obj_method(self, LUCY_Doc_Get_Fields_OFFSET);
280 383 return method(self);
281 }
282  
283 extern LUCY_VISIBLE uint32_t LUCY_Doc_Get_Size_OFFSET;
284 static CFISH_INLINE uint32_t
285 LUCY_Doc_Get_Size(lucy_Doc* self) {
286 const LUCY_Doc_Get_Size_t method = (LUCY_Doc_Get_Size_t)cfish_obj_method(self, LUCY_Doc_Get_Size_OFFSET);
287 return method(self);
288 }
289  
290 extern LUCY_VISIBLE uint32_t LUCY_Doc_Extract_OFFSET;
291 static CFISH_INLINE cfish_Obj*
292 LUCY_Doc_Extract(lucy_Doc* self, cfish_String* field) {
293 const LUCY_Doc_Extract_t method = (LUCY_Doc_Extract_t)cfish_obj_method(self, LUCY_Doc_Extract_OFFSET);
294 return method(self, field);
295 }
296  
297 extern LUCY_VISIBLE uint32_t LUCY_Doc_Field_Names_OFFSET;
298 static CFISH_INLINE cfish_Vector*
299 LUCY_Doc_Field_Names(lucy_Doc* self) {
300 const LUCY_Doc_Field_Names_t method = (LUCY_Doc_Field_Names_t)cfish_obj_method(self, LUCY_Doc_Field_Names_OFFSET);
301 return method(self);
302 }
303  
304 extern LUCY_VISIBLE uint32_t LUCY_Doc_Serialize_OFFSET;
305 static CFISH_INLINE void
306 LUCY_Doc_Serialize(lucy_Doc* self, lucy_OutStream* outstream) {
307 const LUCY_Doc_Serialize_t method = (LUCY_Doc_Serialize_t)cfish_obj_method(self, LUCY_Doc_Serialize_OFFSET);
308 method(self, outstream);
309 }
310  
311 extern LUCY_VISIBLE uint32_t LUCY_Doc_Deserialize_OFFSET;
312 static CFISH_INLINE lucy_Doc*
313 LUCY_Doc_Deserialize(lucy_Doc* self, lucy_InStream* instream) {
314 const LUCY_Doc_Deserialize_t method = (LUCY_Doc_Deserialize_t)cfish_obj_method(self, LUCY_Doc_Deserialize_OFFSET);
315 return method(self, instream);
316 }
317  
318 extern LUCY_VISIBLE uint32_t LUCY_Doc_Dump_OFFSET;
319 static CFISH_INLINE cfish_Hash*
320 LUCY_Doc_Dump(lucy_Doc* self) {
321 const LUCY_Doc_Dump_t method = (LUCY_Doc_Dump_t)cfish_obj_method(self, LUCY_Doc_Dump_OFFSET);
322 return method(self);
323 }
324  
325 extern LUCY_VISIBLE uint32_t LUCY_Doc_Load_OFFSET;
326 static CFISH_INLINE lucy_Doc*
327 LUCY_Doc_Load(lucy_Doc* self, cfish_Obj* dump) {
328 const LUCY_Doc_Load_t method = (LUCY_Doc_Load_t)cfish_obj_method(self, LUCY_Doc_Load_OFFSET);
329 return method(self, dump);
330 }
331  
332  
333  
334 /* Declare callbacks for wrapping host overrides.
335 */
336  
337 #ifdef CFISH_NO_DYNAMIC_OVERRIDES
338 #define Lucy_Doc_Set_Doc_ID_OVERRIDE NULL
339 #define Lucy_Doc_Get_Doc_ID_OVERRIDE NULL
340 #define Lucy_Doc_Store_OVERRIDE NULL
341 #define Lucy_Doc_Set_Fields_OVERRIDE NULL
342 #define Lucy_Doc_Get_Fields_OVERRIDE NULL
343 #define Lucy_Doc_Get_Size_OVERRIDE NULL
344 #define Lucy_Doc_Extract_OVERRIDE NULL
345 #define Lucy_Doc_Field_Names_OVERRIDE NULL
346 #define Lucy_Doc_Serialize_OVERRIDE NULL
347 #define Lucy_Doc_Deserialize_OVERRIDE NULL
348 #define Lucy_Doc_Dump_OVERRIDE NULL
349 #define Lucy_Doc_Load_OVERRIDE NULL
350 #else
351 void
352 Lucy_Doc_Set_Doc_ID_OVERRIDE(lucy_Doc* self, int32_t doc_id);
353 int32_t
354 Lucy_Doc_Get_Doc_ID_OVERRIDE(lucy_Doc* self);
355 void
356 Lucy_Doc_Store_OVERRIDE(lucy_Doc* self, cfish_String* field, cfish_Obj* value);
357 void
358 Lucy_Doc_Set_Fields_OVERRIDE(lucy_Doc* self, void* fields);
359 void*
360 Lucy_Doc_Get_Fields_OVERRIDE(lucy_Doc* self);
361 uint32_t
362 Lucy_Doc_Get_Size_OVERRIDE(lucy_Doc* self);
363 cfish_Obj*
364 Lucy_Doc_Extract_OVERRIDE(lucy_Doc* self, cfish_String* field);
365 cfish_Vector*
366 Lucy_Doc_Field_Names_OVERRIDE(lucy_Doc* self);
367 void
368 Lucy_Doc_Serialize_OVERRIDE(lucy_Doc* self, lucy_OutStream* outstream);
369 lucy_Doc*
370 Lucy_Doc_Deserialize_OVERRIDE(lucy_Doc* self, lucy_InStream* instream);
371 cfish_Hash*
372 Lucy_Doc_Dump_OVERRIDE(lucy_Doc* self);
373 lucy_Doc*
374 Lucy_Doc_Load_OVERRIDE(lucy_Doc* self, cfish_Obj* dump);
375 #endif
376  
377  
378 /* Define "short names" for this class's symbols.
379 */
380  
381 #ifdef LUCY_USE_SHORT_NAMES
382 #define Doc lucy_Doc
383 #define DOC LUCY_DOC
384 #define Doc_new lucy_Doc_new
385 #define Doc_init lucy_Doc_init
386 #define Doc_get_class lucy_Doc_get_class
387 #define Doc_get_class_name lucy_Doc_get_class_name
388 #define Doc_is_a lucy_Doc_is_a
389 #define Doc_Set_Doc_ID_IMP LUCY_Doc_Set_Doc_ID_IMP
390 #define Doc_Get_Doc_ID_IMP LUCY_Doc_Get_Doc_ID_IMP
391 #define Doc_Store_IMP LUCY_Doc_Store_IMP
392 #define Doc_Set_Fields_IMP LUCY_Doc_Set_Fields_IMP
393 #define Doc_Get_Fields_IMP LUCY_Doc_Get_Fields_IMP
394 #define Doc_Get_Size_IMP LUCY_Doc_Get_Size_IMP
395 #define Doc_Extract_IMP LUCY_Doc_Extract_IMP
396 #define Doc_Field_Names_IMP LUCY_Doc_Field_Names_IMP
397 #define Doc_Equals_IMP LUCY_Doc_Equals_IMP
398 #define Doc_Serialize_IMP LUCY_Doc_Serialize_IMP
399 #define Doc_Deserialize_IMP LUCY_Doc_Deserialize_IMP
400 #define Doc_Dump_IMP LUCY_Doc_Dump_IMP
401 #define Doc_Load_IMP LUCY_Doc_Load_IMP
402 #define Doc_Destroy_IMP LUCY_Doc_Destroy_IMP
403 #define Doc_To_Host LUCY_Doc_To_Host
404 #define Doc_To_Host_t LUCY_Doc_To_Host_t
405 #define Doc_Clone LUCY_Doc_Clone
406 #define Doc_Clone_t LUCY_Doc_Clone_t
407 #define Doc_Equals LUCY_Doc_Equals
408 #define Doc_Equals_t LUCY_Doc_Equals_t
409 #define Doc_Compare_To LUCY_Doc_Compare_To
410 #define Doc_Compare_To_t LUCY_Doc_Compare_To_t
411 #define Doc_Destroy LUCY_Doc_Destroy
412 #define Doc_Destroy_t LUCY_Doc_Destroy_t
413 #define Doc_To_String LUCY_Doc_To_String
414 #define Doc_To_String_t LUCY_Doc_To_String_t
415 #define Doc_Set_Doc_ID LUCY_Doc_Set_Doc_ID
416 #define Doc_Set_Doc_ID_t LUCY_Doc_Set_Doc_ID_t
417 #define Doc_Get_Doc_ID LUCY_Doc_Get_Doc_ID
418 #define Doc_Get_Doc_ID_t LUCY_Doc_Get_Doc_ID_t
419 #define Doc_Store LUCY_Doc_Store
420 #define Doc_Store_t LUCY_Doc_Store_t
421 #define Doc_Set_Fields LUCY_Doc_Set_Fields
422 #define Doc_Set_Fields_t LUCY_Doc_Set_Fields_t
423 #define Doc_Get_Fields LUCY_Doc_Get_Fields
424 #define Doc_Get_Fields_t LUCY_Doc_Get_Fields_t
425 #define Doc_Get_Size LUCY_Doc_Get_Size
426 #define Doc_Get_Size_t LUCY_Doc_Get_Size_t
427 #define Doc_Extract LUCY_Doc_Extract
428 #define Doc_Extract_t LUCY_Doc_Extract_t
429 #define Doc_Field_Names LUCY_Doc_Field_Names
430 #define Doc_Field_Names_t LUCY_Doc_Field_Names_t
431 #define Doc_Serialize LUCY_Doc_Serialize
432 #define Doc_Serialize_t LUCY_Doc_Serialize_t
433 #define Doc_Deserialize LUCY_Doc_Deserialize
434 #define Doc_Deserialize_t LUCY_Doc_Deserialize_t
435 #define Doc_Dump LUCY_Doc_Dump
436 #define Doc_Dump_t LUCY_Doc_Dump_t
437 #define Doc_Load LUCY_Doc_Load
438 #define Doc_Load_t LUCY_Doc_Load_t
439 #endif /* LUCY_USE_SHORT_NAMES */
440  
441  
442  
443  
444  
445 #ifdef __cplusplus
446 }
447 #endif
448  
449 #endif /* H_LUCY_DOCUMENT_DOC */
450  
451  
452  
453  
« autogen/include/Clownfish/TestHarness/TestSuite.h ↑ Summary autogen/include/Lucy/Index/Indexer.h »