| 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_VECTOR | ||
| 28 | #define H_CLOWNFISH_VECTOR 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 | #include "Clownfish/Obj.h" | ||
| 41 | |||
| 42 | /* Define the struct layout for instances of this class. | ||
| 43 | */ | ||
| 44 | |||
| 45 | #ifdef C_CFISH_VECTOR | ||
| 46 | extern uint32_t cfish_Vec_IVARS_OFFSET; | ||
| 47 | typedef struct cfish_VectorIVARS cfish_VectorIVARS; | ||
| 48 | static CFISH_INLINE cfish_VectorIVARS* | ||
| 49 | cfish_Vec_IVARS(cfish_Vector *self) { | ||
| 50 | char *ptr = (char*)self + cfish_Vec_IVARS_OFFSET; | ||
| 51 | return (cfish_VectorIVARS*)ptr; | ||
| 52 | } | ||
| 53 | #ifdef CFISH_USE_SHORT_NAMES | ||
| 54 | #define VectorIVARS cfish_VectorIVARS | ||
| 55 | #define Vec_IVARS cfish_Vec_IVARS | ||
| 56 | #endif | ||
| 57 | |||
| 58 | struct cfish_Vector { | ||
| 59 | CFISH_OBJ_HEAD | ||
| 60 | cfish_Class* klass; | ||
| 61 | cfish_Obj** elems; | ||
| 62 | size_t size; | ||
| 63 | size_t cap; | ||
| 64 | }; | ||
| 65 | |||
| 66 | #endif /* C_CFISH_VECTOR */ | ||
| 67 | |||
| 68 | /* Declare this class's inert variables. | ||
| 69 | */ | ||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | /* Declare both this class's inert functions and the C functions which | ||
| 74 | * implement this class's dynamic methods. | ||
| 75 | */ | ||
| 76 | |||
| 77 | CFISH_VISIBLE cfish_Vector* | ||
| 78 | cfish_Vec_new(size_t capacity); | ||
| 79 | |||
| 80 | CFISH_VISIBLE cfish_Vector* | ||
| 81 | cfish_Vec_init(cfish_Vector* self, size_t capacity); | ||
| 82 | |||
| 83 | void* | ||
| 84 | CFISH_Vec_To_Host_IMP(cfish_Vector* self, void* vcache); | ||
| 85 | |||
| 86 | void | ||
| 87 | CFISH_Vec_Push_IMP(cfish_Vector* self, cfish_Obj* element); | ||
| 88 | |||
| 89 | void | ||
| 90 | CFISH_Vec_Push_All_IMP(cfish_Vector* self, cfish_Vector* other); | ||
| 91 | |||
| 92 | cfish_Obj* | ||
| 93 | CFISH_Vec_Pop_IMP(cfish_Vector* self); | ||
| 94 | |||
| 95 | void | ||
| 96 | CFISH_Vec_Insert_IMP(cfish_Vector* self, size_t tick, cfish_Obj* element); | ||
| 97 | |||
| 98 | void | ||
| 99 | CFISH_Vec_Insert_All_IMP(cfish_Vector* self, size_t tick, cfish_Vector* other); | ||
| 100 | |||
| 101 | void | ||
| 102 | CFISH_Vec_Grow_IMP(cfish_Vector* self, size_t capacity); | ||
| 103 | |||
| 104 | cfish_Obj* | ||
| 105 | CFISH_Vec_Fetch_IMP(cfish_Vector* self, size_t tick); | ||
| 106 | |||
| 107 | void | ||
| 108 | CFISH_Vec_Store_IMP(cfish_Vector* self, size_t tick, cfish_Obj* elem); | ||
| 109 | |||
| 110 | cfish_Obj* | ||
| 111 | CFISH_Vec_Delete_IMP(cfish_Vector* self, size_t tick); | ||
| 112 | |||
| 113 | void | ||
| 114 | CFISH_Vec_Excise_IMP(cfish_Vector* self, size_t offset, size_t length); | ||
| 115 | |||
| 116 | cfish_Vector* | ||
| 117 | CFISH_Vec_Clone_IMP(cfish_Vector* self); | ||
| 118 | |||
| 119 | void | ||
| 120 | CFISH_Vec_Sort_IMP(cfish_Vector* self); | ||
| 121 | |||
| 122 | void | ||
| 123 | CFISH_Vec_Resize_IMP(cfish_Vector* self, size_t size); | ||
| 124 | |||
| 125 | void | ||
| 126 | CFISH_Vec_Clear_IMP(cfish_Vector* self); | ||
| 127 | |||
| 128 | size_t | ||
| 129 | CFISH_Vec_Get_Size_IMP(cfish_Vector* self); | ||
| 130 | |||
| 131 | size_t | ||
| 132 | CFISH_Vec_Get_Capacity_IMP(cfish_Vector* self); | ||
| 133 | |||
| 134 | cfish_Vector* | ||
| 135 | CFISH_Vec_Slice_IMP(cfish_Vector* self, size_t offset, size_t length); | ||
| 136 | |||
| 137 | bool | ||
| 138 | CFISH_Vec_Equals_IMP(cfish_Vector* self, cfish_Obj* other); | ||
| 139 | |||
| 140 | void | ||
| 141 | CFISH_Vec_Destroy_IMP(cfish_Vector* self); | ||
| 142 | |||
| 143 | |||
| 144 | |||
| 145 | /* Define typedefs for each dynamic method, allowing us to cast generic | ||
| 146 | * pointers to the appropriate function pointer type more cleanly. | ||
| 147 | */ | ||
| 148 | |||
| 149 | typedef void* | ||
| 150 | (*CFISH_Vec_To_Host_t)(cfish_Vector* self, void* vcache); | ||
| 151 | |||
| 152 | typedef cfish_Vector* | ||
| 153 | (*CFISH_Vec_Clone_t)(cfish_Vector* self); | ||
| 154 | |||
| 155 | typedef bool | ||
| 156 | (*CFISH_Vec_Equals_t)(cfish_Vector* self, cfish_Obj* other); | ||
| 157 | |||
| 158 | typedef int32_t | ||
| 159 | (*CFISH_Vec_Compare_To_t)(cfish_Vector* self, cfish_Obj* other); | ||
| 160 | |||
| 161 | typedef void | ||
| 162 | (*CFISH_Vec_Destroy_t)(cfish_Vector* self); | ||
| 163 | |||
| 164 | typedef cfish_String* | ||
| 165 | (*CFISH_Vec_To_String_t)(cfish_Vector* self); | ||
| 166 | |||
| 167 | typedef void | ||
| 168 | (*CFISH_Vec_Push_t)(cfish_Vector* self, cfish_Obj* element); | ||
| 169 | |||
| 170 | typedef void | ||
| 171 | (*CFISH_Vec_Push_All_t)(cfish_Vector* self, cfish_Vector* other); | ||
| 172 | |||
| 173 | typedef cfish_Obj* | ||
| 174 | (*CFISH_Vec_Pop_t)(cfish_Vector* self); | ||
| 175 | |||
| 176 | typedef void | ||
| 177 | (*CFISH_Vec_Insert_t)(cfish_Vector* self, size_t tick, cfish_Obj* element); | ||
| 178 | |||
| 179 | typedef void | ||
| 180 | (*CFISH_Vec_Insert_All_t)(cfish_Vector* self, size_t tick, cfish_Vector* other); | ||
| 181 | |||
| 182 | typedef void | ||
| 183 | (*CFISH_Vec_Grow_t)(cfish_Vector* self, size_t capacity); | ||
| 184 | |||
| 185 | typedef cfish_Obj* | ||
| 186 | (*CFISH_Vec_Fetch_t)(cfish_Vector* self, size_t tick); | ||
| 187 | |||
| 188 | typedef void | ||
| 189 | (*CFISH_Vec_Store_t)(cfish_Vector* self, size_t tick, cfish_Obj* elem); | ||
| 190 | |||
| 191 | typedef cfish_Obj* | ||
| 192 | (*CFISH_Vec_Delete_t)(cfish_Vector* self, size_t tick); | ||
| 193 | |||
| 194 | typedef void | ||
| 195 | (*CFISH_Vec_Excise_t)(cfish_Vector* self, size_t offset, size_t length); | ||
| 196 | |||
| 197 | typedef void | ||
| 198 | (*CFISH_Vec_Sort_t)(cfish_Vector* self); | ||
| 199 | |||
| 200 | typedef void | ||
| 201 | (*CFISH_Vec_Resize_t)(cfish_Vector* self, size_t size); | ||
| 202 | |||
| 203 | typedef void | ||
| 204 | (*CFISH_Vec_Clear_t)(cfish_Vector* self); | ||
| 205 | |||
| 206 | typedef size_t | ||
| 207 | (*CFISH_Vec_Get_Size_t)(cfish_Vector* self); | ||
| 208 | |||
| 209 | typedef size_t | ||
| 210 | (*CFISH_Vec_Get_Capacity_t)(cfish_Vector* self); | ||
| 211 | |||
| 212 | typedef cfish_Vector* | ||
| 213 | (*CFISH_Vec_Slice_t)(cfish_Vector* self, size_t offset, size_t length); | ||
| 214 | |||
| 215 | |||
| 216 | |||
| 217 | /* Define type-safe wrappers for inert functions of Obj. | ||
| 218 | */ | ||
| 219 | |||
| 220 | static CFISH_INLINE cfish_Class* | ||
| 221 | cfish_Vec_get_class(cfish_Vector *self) { | ||
| 222 | return cfish_Obj_get_class((cfish_Obj*)self); | ||
| 223 | } | ||
| 224 | |||
| 225 | static CFISH_INLINE cfish_String* | ||
| 226 | cfish_Vec_get_class_name(cfish_Vector *self) { | ||
| 227 | return cfish_Obj_get_class_name((cfish_Obj*)self); | ||
| 228 | } | ||
| 229 | |||
| 230 | static CFISH_INLINE bool | ||
| 231 | cfish_Vec_is_a(cfish_Vector *self, cfish_Class *ancestor) { | ||
| 232 | return cfish_Obj_is_a((cfish_Obj*)self, ancestor); | ||
| 233 | } | ||
| 234 | |||
| 235 | |||
| 236 | /* Define the inline functions which implement this class's virtual methods. | ||
| 237 | */ | ||
| 238 | |||
| 239 | extern CFISH_VISIBLE uint32_t CFISH_Vec_To_Host_OFFSET; | ||
| 240 | static CFISH_INLINE void* | ||
| 241 | CFISH_Vec_To_Host(cfish_Vector* self, void* vcache) { | ||
| 242 | #ifdef CFP_CFISH | ||
| 243 | return CFISH_Vec_To_Host_IMP(self, vcache); | ||
| 244 | #else | ||
| 245 | const CFISH_Vec_To_Host_t method = (CFISH_Vec_To_Host_t)cfish_obj_method(self, CFISH_Vec_To_Host_OFFSET); | ||
| 246 | return method(self, vcache); | ||
| 247 | #endif | ||
| 248 | } | ||
| 249 | |||
| 250 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Clone_OFFSET; | ||
| 251 | static CFISH_INLINE cfish_Vector* | ||
| 252 | CFISH_Vec_Clone(cfish_Vector* self) { | ||
| 253 | #ifdef CFP_CFISH | ||
| 254 | return CFISH_Vec_Clone_IMP(self); | ||
| 255 | #else | ||
| 256 | const CFISH_Vec_Clone_t method = (CFISH_Vec_Clone_t)cfish_obj_method(self, CFISH_Vec_Clone_OFFSET); | ||
| 257 | return method(self); | ||
| 258 | #endif | ||
| 259 | } | ||
| 260 | |||
| 261 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Equals_OFFSET; | ||
| 262 | static CFISH_INLINE bool | ||
| 263 | CFISH_Vec_Equals(cfish_Vector* self, cfish_Obj* other) { | ||
| 264 | #ifdef CFP_CFISH | ||
| 265 | return CFISH_Vec_Equals_IMP(self, other); | ||
| 266 | #else | ||
| 267 | const CFISH_Vec_Equals_t method = (CFISH_Vec_Equals_t)cfish_obj_method(self, CFISH_Vec_Equals_OFFSET); | ||
| 268 | return method(self, other); | ||
| 269 | #endif | ||
| 270 | } | ||
| 271 | |||
| 272 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Compare_To_OFFSET; | ||
| 273 | static CFISH_INLINE int32_t | ||
| 274 | CFISH_Vec_Compare_To(cfish_Vector* self, cfish_Obj* other) { | ||
| 275 | #ifdef CFP_CFISH | ||
| 276 | return CFISH_Obj_Compare_To_IMP((cfish_Obj*)self, other); | ||
| 277 | #else | ||
| 278 | const CFISH_Vec_Compare_To_t method = (CFISH_Vec_Compare_To_t)cfish_obj_method(self, CFISH_Vec_Compare_To_OFFSET); | ||
| 279 | return method(self, other); | ||
| 280 | #endif | ||
| 281 | } | ||
| 282 | |||
| 283 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Destroy_OFFSET; | ||
| 284 | static CFISH_INLINE void | ||
| 285 | CFISH_Vec_Destroy(cfish_Vector* self) { | ||
| 286 | #ifdef CFP_CFISH | ||
| 287 | CFISH_Vec_Destroy_IMP(self); | ||
| 288 | #else | ||
| 289 | const CFISH_Vec_Destroy_t method = (CFISH_Vec_Destroy_t)cfish_obj_method(self, CFISH_Vec_Destroy_OFFSET); | ||
| 290 | method(self); | ||
| 291 | #endif | ||
| 292 | } | ||
| 293 | |||
| 294 | extern CFISH_VISIBLE uint32_t CFISH_Vec_To_String_OFFSET; | ||
| 295 | static CFISH_INLINE cfish_String* | ||
| 296 | CFISH_Vec_To_String(cfish_Vector* self) { | ||
| 297 | #ifdef CFP_CFISH | ||
| 298 | return CFISH_Obj_To_String_IMP((cfish_Obj*)self); | ||
| 299 | #else | ||
| 300 | const CFISH_Vec_To_String_t method = (CFISH_Vec_To_String_t)cfish_obj_method(self, CFISH_Vec_To_String_OFFSET); | ||
| 301 | return method(self); | ||
| 302 | #endif | ||
| 303 | } | ||
| 304 | |||
| 305 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Push_OFFSET; | ||
| 306 | static CFISH_INLINE void | ||
| 307 | CFISH_Vec_Push(cfish_Vector* self, cfish_Obj* element) { | ||
| 308 | #ifdef CFP_CFISH | ||
| 309 | CFISH_Vec_Push_IMP(self, element); | ||
| 310 | #else | ||
| 311 | const CFISH_Vec_Push_t method = (CFISH_Vec_Push_t)cfish_obj_method(self, CFISH_Vec_Push_OFFSET); | ||
| 312 | method(self, element); | ||
| 313 | #endif | ||
| 314 | } | ||
| 315 | |||
| 316 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Push_All_OFFSET; | ||
| 317 | static CFISH_INLINE void | ||
| 318 | CFISH_Vec_Push_All(cfish_Vector* self, cfish_Vector* other) { | ||
| 319 | #ifdef CFP_CFISH | ||
| 320 | CFISH_Vec_Push_All_IMP(self, other); | ||
| 321 | #else | ||
| 322 | const CFISH_Vec_Push_All_t method = (CFISH_Vec_Push_All_t)cfish_obj_method(self, CFISH_Vec_Push_All_OFFSET); | ||
| 323 | method(self, other); | ||
| 324 | #endif | ||
| 325 | } | ||
| 326 | |||
| 327 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Pop_OFFSET; | ||
| 328 | static CFISH_INLINE cfish_Obj* | ||
| 329 | 0 | CFISH_Vec_Pop(cfish_Vector* self) { | |
| 330 | #ifdef CFP_CFISH | ||
| 331 | 0 | return CFISH_Vec_Pop_IMP(self); | |
| 332 | #else | ||
| 333 | const CFISH_Vec_Pop_t method = (CFISH_Vec_Pop_t)cfish_obj_method(self, CFISH_Vec_Pop_OFFSET); | ||
| 334 | return method(self); | ||
| 335 | #endif | ||
| 336 | } | ||
| 337 | |||
| 338 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Insert_OFFSET; | ||
| 339 | static CFISH_INLINE void | ||
| 340 | CFISH_Vec_Insert(cfish_Vector* self, size_t tick, cfish_Obj* element) { | ||
| 341 | #ifdef CFP_CFISH | ||
| 342 | CFISH_Vec_Insert_IMP(self, tick, element); | ||
| 343 | #else | ||
| 344 | const CFISH_Vec_Insert_t method = (CFISH_Vec_Insert_t)cfish_obj_method(self, CFISH_Vec_Insert_OFFSET); | ||
| 345 | method(self, tick, element); | ||
| 346 | #endif | ||
| 347 | } | ||
| 348 | |||
| 349 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Insert_All_OFFSET; | ||
| 350 | static CFISH_INLINE void | ||
| 351 | CFISH_Vec_Insert_All(cfish_Vector* self, size_t tick, cfish_Vector* other) { | ||
| 352 | #ifdef CFP_CFISH | ||
| 353 | CFISH_Vec_Insert_All_IMP(self, tick, other); | ||
| 354 | #else | ||
| 355 | const CFISH_Vec_Insert_All_t method = (CFISH_Vec_Insert_All_t)cfish_obj_method(self, CFISH_Vec_Insert_All_OFFSET); | ||
| 356 | method(self, tick, other); | ||
| 357 | #endif | ||
| 358 | } | ||
| 359 | |||
| 360 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Grow_OFFSET; | ||
| 361 | static CFISH_INLINE void | ||
| 362 | CFISH_Vec_Grow(cfish_Vector* self, size_t capacity) { | ||
| 363 | #ifdef CFP_CFISH | ||
| 364 | CFISH_Vec_Grow_IMP(self, capacity); | ||
| 365 | #else | ||
| 366 | const CFISH_Vec_Grow_t method = (CFISH_Vec_Grow_t)cfish_obj_method(self, CFISH_Vec_Grow_OFFSET); | ||
| 367 | method(self, capacity); | ||
| 368 | #endif | ||
| 369 | } | ||
| 370 | |||
| 371 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Fetch_OFFSET; | ||
| 372 | static CFISH_INLINE cfish_Obj* | ||
| 373 | 5 | CFISH_Vec_Fetch(cfish_Vector* self, size_t tick) { | |
| 374 | #ifdef CFP_CFISH | ||
| 375 | 5 | return CFISH_Vec_Fetch_IMP(self, tick); | |
| 376 | #else | ||
| 377 | const CFISH_Vec_Fetch_t method = (CFISH_Vec_Fetch_t)cfish_obj_method(self, CFISH_Vec_Fetch_OFFSET); | ||
| 378 | return method(self, tick); | ||
| 379 | #endif | ||
| 380 | } | ||
| 381 | |||
| 382 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Store_OFFSET; | ||
| 383 | static CFISH_INLINE void | ||
| 384 | 0 | CFISH_Vec_Store(cfish_Vector* self, size_t tick, cfish_Obj* elem) { | |
| 385 | #ifdef CFP_CFISH | ||
| 386 | 0 | CFISH_Vec_Store_IMP(self, tick, elem); | |
| 387 | #else | ||
| 388 | const CFISH_Vec_Store_t method = (CFISH_Vec_Store_t)cfish_obj_method(self, CFISH_Vec_Store_OFFSET); | ||
| 389 | method(self, tick, elem); | ||
| 390 | #endif | ||
| 391 | 0 | } | |
| 392 | |||
| 393 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Delete_OFFSET; | ||
| 394 | static CFISH_INLINE cfish_Obj* | ||
| 395 | 0 | CFISH_Vec_Delete(cfish_Vector* self, size_t tick) { | |
| 396 | #ifdef CFP_CFISH | ||
| 397 | 0 | return CFISH_Vec_Delete_IMP(self, tick); | |
| 398 | #else | ||
| 399 | const CFISH_Vec_Delete_t method = (CFISH_Vec_Delete_t)cfish_obj_method(self, CFISH_Vec_Delete_OFFSET); | ||
| 400 | return method(self, tick); | ||
| 401 | #endif | ||
| 402 | } | ||
| 403 | |||
| 404 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Excise_OFFSET; | ||
| 405 | static CFISH_INLINE void | ||
| 406 | CFISH_Vec_Excise(cfish_Vector* self, size_t offset, size_t length) { | ||
| 407 | #ifdef CFP_CFISH | ||
| 408 | CFISH_Vec_Excise_IMP(self, offset, length); | ||
| 409 | #else | ||
| 410 | const CFISH_Vec_Excise_t method = (CFISH_Vec_Excise_t)cfish_obj_method(self, CFISH_Vec_Excise_OFFSET); | ||
| 411 | method(self, offset, length); | ||
| 412 | #endif | ||
| 413 | } | ||
| 414 | |||
| 415 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Sort_OFFSET; | ||
| 416 | static CFISH_INLINE void | ||
| 417 | CFISH_Vec_Sort(cfish_Vector* self) { | ||
| 418 | #ifdef CFP_CFISH | ||
| 419 | CFISH_Vec_Sort_IMP(self); | ||
| 420 | #else | ||
| 421 | const CFISH_Vec_Sort_t method = (CFISH_Vec_Sort_t)cfish_obj_method(self, CFISH_Vec_Sort_OFFSET); | ||
| 422 | method(self); | ||
| 423 | #endif | ||
| 424 | } | ||
| 425 | |||
| 426 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Resize_OFFSET; | ||
| 427 | static CFISH_INLINE void | ||
| 428 | CFISH_Vec_Resize(cfish_Vector* self, size_t size) { | ||
| 429 | #ifdef CFP_CFISH | ||
| 430 | CFISH_Vec_Resize_IMP(self, size); | ||
| 431 | #else | ||
| 432 | const CFISH_Vec_Resize_t method = (CFISH_Vec_Resize_t)cfish_obj_method(self, CFISH_Vec_Resize_OFFSET); | ||
| 433 | method(self, size); | ||
| 434 | #endif | ||
| 435 | } | ||
| 436 | |||
| 437 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Clear_OFFSET; | ||
| 438 | static CFISH_INLINE void | ||
| 439 | CFISH_Vec_Clear(cfish_Vector* self) { | ||
| 440 | #ifdef CFP_CFISH | ||
| 441 | CFISH_Vec_Clear_IMP(self); | ||
| 442 | #else | ||
| 443 | const CFISH_Vec_Clear_t method = (CFISH_Vec_Clear_t)cfish_obj_method(self, CFISH_Vec_Clear_OFFSET); | ||
| 444 | method(self); | ||
| 445 | #endif | ||
| 446 | } | ||
| 447 | |||
| 448 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Get_Size_OFFSET; | ||
| 449 | static CFISH_INLINE size_t | ||
| 450 | CFISH_Vec_Get_Size(cfish_Vector* self) { | ||
| 451 | #ifdef CFP_CFISH | ||
| 452 | return CFISH_Vec_Get_Size_IMP(self); | ||
| 453 | #else | ||
| 454 | const CFISH_Vec_Get_Size_t method = (CFISH_Vec_Get_Size_t)cfish_obj_method(self, CFISH_Vec_Get_Size_OFFSET); | ||
| 455 | return method(self); | ||
| 456 | #endif | ||
| 457 | } | ||
| 458 | |||
| 459 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Get_Capacity_OFFSET; | ||
| 460 | static CFISH_INLINE size_t | ||
| 461 | CFISH_Vec_Get_Capacity(cfish_Vector* self) { | ||
| 462 | #ifdef CFP_CFISH | ||
| 463 | return CFISH_Vec_Get_Capacity_IMP(self); | ||
| 464 | #else | ||
| 465 | const CFISH_Vec_Get_Capacity_t method = (CFISH_Vec_Get_Capacity_t)cfish_obj_method(self, CFISH_Vec_Get_Capacity_OFFSET); | ||
| 466 | return method(self); | ||
| 467 | #endif | ||
| 468 | } | ||
| 469 | |||
| 470 | extern CFISH_VISIBLE uint32_t CFISH_Vec_Slice_OFFSET; | ||
| 471 | static CFISH_INLINE cfish_Vector* | ||
| 472 | CFISH_Vec_Slice(cfish_Vector* self, size_t offset, size_t length) { | ||
| 473 | #ifdef CFP_CFISH | ||
| 474 | return CFISH_Vec_Slice_IMP(self, offset, length); | ||
| 475 | #else | ||
| 476 | const CFISH_Vec_Slice_t method = (CFISH_Vec_Slice_t)cfish_obj_method(self, CFISH_Vec_Slice_OFFSET); | ||
| 477 | return method(self, offset, length); | ||
| 478 | #endif | ||
| 479 | } | ||
| 480 | |||
| 481 | |||
| 482 | |||
| 483 | /* Declare callbacks for wrapping host overrides. | ||
| 484 | */ | ||
| 485 | |||
| 486 | #ifdef CFISH_NO_DYNAMIC_OVERRIDES | ||
| 487 | #else | ||
| 488 | #endif | ||
| 489 | |||
| 490 | |||
| 491 | /* Define "short names" for this class's symbols. | ||
| 492 | */ | ||
| 493 | |||
| 494 | #ifdef CFISH_USE_SHORT_NAMES | ||
| 495 | #define Vector cfish_Vector | ||
| 496 | #define VECTOR CFISH_VECTOR | ||
| 497 | #define Vec_new cfish_Vec_new | ||
| 498 | #define Vec_init cfish_Vec_init | ||
| 499 | #define Vec_get_class cfish_Vec_get_class | ||
| 500 | #define Vec_get_class_name cfish_Vec_get_class_name | ||
| 501 | #define Vec_is_a cfish_Vec_is_a | ||
| 502 | #define Vec_To_Host_IMP CFISH_Vec_To_Host_IMP | ||
| 503 | #define Vec_Push_IMP CFISH_Vec_Push_IMP | ||
| 504 | #define Vec_Push_All_IMP CFISH_Vec_Push_All_IMP | ||
| 505 | #define Vec_Pop_IMP CFISH_Vec_Pop_IMP | ||
| 506 | #define Vec_Insert_IMP CFISH_Vec_Insert_IMP | ||
| 507 | #define Vec_Insert_All_IMP CFISH_Vec_Insert_All_IMP | ||
| 508 | #define Vec_Grow_IMP CFISH_Vec_Grow_IMP | ||
| 509 | #define Vec_Fetch_IMP CFISH_Vec_Fetch_IMP | ||
| 510 | #define Vec_Store_IMP CFISH_Vec_Store_IMP | ||
| 511 | #define Vec_Delete_IMP CFISH_Vec_Delete_IMP | ||
| 512 | #define Vec_Excise_IMP CFISH_Vec_Excise_IMP | ||
| 513 | #define Vec_Clone_IMP CFISH_Vec_Clone_IMP | ||
| 514 | #define Vec_Sort_IMP CFISH_Vec_Sort_IMP | ||
| 515 | #define Vec_Resize_IMP CFISH_Vec_Resize_IMP | ||
| 516 | #define Vec_Clear_IMP CFISH_Vec_Clear_IMP | ||
| 517 | #define Vec_Get_Size_IMP CFISH_Vec_Get_Size_IMP | ||
| 518 | #define Vec_Get_Capacity_IMP CFISH_Vec_Get_Capacity_IMP | ||
| 519 | #define Vec_Slice_IMP CFISH_Vec_Slice_IMP | ||
| 520 | #define Vec_Equals_IMP CFISH_Vec_Equals_IMP | ||
| 521 | #define Vec_Destroy_IMP CFISH_Vec_Destroy_IMP | ||
| 522 | #define Vec_To_Host CFISH_Vec_To_Host | ||
| 523 | #define Vec_To_Host_t CFISH_Vec_To_Host_t | ||
| 524 | #define Vec_Clone CFISH_Vec_Clone | ||
| 525 | #define Vec_Clone_t CFISH_Vec_Clone_t | ||
| 526 | #define Vec_Equals CFISH_Vec_Equals | ||
| 527 | #define Vec_Equals_t CFISH_Vec_Equals_t | ||
| 528 | #define Vec_Compare_To CFISH_Vec_Compare_To | ||
| 529 | #define Vec_Compare_To_t CFISH_Vec_Compare_To_t | ||
| 530 | #define Vec_Destroy CFISH_Vec_Destroy | ||
| 531 | #define Vec_Destroy_t CFISH_Vec_Destroy_t | ||
| 532 | #define Vec_To_String CFISH_Vec_To_String | ||
| 533 | #define Vec_To_String_t CFISH_Vec_To_String_t | ||
| 534 | #define Vec_Push CFISH_Vec_Push | ||
| 535 | #define Vec_Push_t CFISH_Vec_Push_t | ||
| 536 | #define Vec_Push_All CFISH_Vec_Push_All | ||
| 537 | #define Vec_Push_All_t CFISH_Vec_Push_All_t | ||
| 538 | #define Vec_Pop CFISH_Vec_Pop | ||
| 539 | #define Vec_Pop_t CFISH_Vec_Pop_t | ||
| 540 | #define Vec_Insert CFISH_Vec_Insert | ||
| 541 | #define Vec_Insert_t CFISH_Vec_Insert_t | ||
| 542 | #define Vec_Insert_All CFISH_Vec_Insert_All | ||
| 543 | #define Vec_Insert_All_t CFISH_Vec_Insert_All_t | ||
| 544 | #define Vec_Grow CFISH_Vec_Grow | ||
| 545 | #define Vec_Grow_t CFISH_Vec_Grow_t | ||
| 546 | #define Vec_Fetch CFISH_Vec_Fetch | ||
| 547 | #define Vec_Fetch_t CFISH_Vec_Fetch_t | ||
| 548 | #define Vec_Store CFISH_Vec_Store | ||
| 549 | #define Vec_Store_t CFISH_Vec_Store_t | ||
| 550 | #define Vec_Delete CFISH_Vec_Delete | ||
| 551 | #define Vec_Delete_t CFISH_Vec_Delete_t | ||
| 552 | #define Vec_Excise CFISH_Vec_Excise | ||
| 553 | #define Vec_Excise_t CFISH_Vec_Excise_t | ||
| 554 | #define Vec_Sort CFISH_Vec_Sort | ||
| 555 | #define Vec_Sort_t CFISH_Vec_Sort_t | ||
| 556 | #define Vec_Resize CFISH_Vec_Resize | ||
| 557 | #define Vec_Resize_t CFISH_Vec_Resize_t | ||
| 558 | #define Vec_Clear CFISH_Vec_Clear | ||
| 559 | #define Vec_Clear_t CFISH_Vec_Clear_t | ||
| 560 | #define Vec_Get_Size CFISH_Vec_Get_Size | ||
| 561 | #define Vec_Get_Size_t CFISH_Vec_Get_Size_t | ||
| 562 | #define Vec_Get_Capacity CFISH_Vec_Get_Capacity | ||
| 563 | #define Vec_Get_Capacity_t CFISH_Vec_Get_Capacity_t | ||
| 564 | #define Vec_Slice CFISH_Vec_Slice | ||
| 565 | #define Vec_Slice_t CFISH_Vec_Slice_t | ||
| 566 | #endif /* CFISH_USE_SHORT_NAMES */ | ||
| 567 | |||
| 568 | |||
| 569 | |||
| 570 | |||
| 571 | |||
| 572 | #ifdef __cplusplus | ||
| 573 | } | ||
| 574 | #endif | ||
| 575 | |||
| 576 | #endif /* H_CLOWNFISH_VECTOR */ | ||
| 577 | |||
| 578 | |||
| 579 | |||
| 580 |