File Coverage

autogen/include/Clownfish/Hash.h
Criterion Covered Total %
statement 2 2 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 2 2 100.0


line stmt bran cond sub pod time code
1            
2            
3            

perltidy

4            
 
5             /* * *********************************************** * * !!!! DO NOT EDIT !!!! * * This file was auto-generated by Build.PL. * * *********************************************** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef H_CLOWNFISH_HASH #define H_CLOWNFISH_HASH 1 #ifdef __cplusplus extern "C" { #endif #include "cfish_parcel.h" /* Include the header for this class's parent. */ #include "Clownfish/Obj.h" /* Define the struct layout for instances of this class. */ #ifdef C_CFISH_HASH extern uint32_t cfish_Hash_IVARS_OFFSET; typedef struct cfish_HashIVARS cfish_HashIVARS; static CFISH_INLINE cfish_HashIVARS* cfish_Hash_IVARS(cfish_Hash *self) { char *ptr = (char*)self + cfish_Hash_IVARS_OFFSET; return (cfish_HashIVARS*)ptr; } #ifdef CFISH_USE_SHORT_NAMES #define HashIVARS cfish_HashIVARS #define Hash_IVARS cfish_Hash_IVARS #endif struct cfish_Hash { CFISH_OBJ_HEAD cfish_Class* klass; void* entries; size_t capacity; size_t size; size_t threshold; }; #endif /* C_CFISH_HASH */ /* Declare this class's inert variables. */ /* Declare both this class's inert functions and the C functions which * implement this class's dynamic methods. */ CFISH_VISIBLE void cfish_Hash_init_class(void); CFISH_VISIBLE cfish_Hash* cfish_Hash_new(size_t capacity); CFISH_VISIBLE cfish_Hash* cfish_Hash_init(cfish_Hash* self, size_t capacity); CFISH_VISIBLE cfish_String* cfish_Hash_get_tombstone(void); void* CFISH_Hash_To_Host_IMP(cfish_Hash* self, void* vcache); void CFISH_Hash_Clear_IMP(cfish_Hash* self); void CFISH_Hash_Store_IMP(cfish_Hash* self, cfish_String* key, cfish_Obj* value); void CFISH_Hash_Store_Utf8_IMP(cfish_Hash* self, const char* utf8, size_t size, cfish_Obj* value); cfish_Obj* CFISH_Hash_Fetch_IMP(cfish_Hash* self, cfish_String* key); cfish_Obj* CFISH_Hash_Fetch_Utf8_IMP(cfish_Hash* self, const char* utf8, size_t size); cfish_Obj* CFISH_Hash_Delete_IMP(cfish_Hash* self, cfish_String* key); cfish_Obj* CFISH_Hash_Delete_Utf8_IMP(cfish_Hash* self, const char* utf8, size_t size); bool CFISH_Hash_Has_Key_IMP(cfish_Hash* self, cfish_String* key); cfish_Vector* CFISH_Hash_Keys_IMP(cfish_Hash* self); cfish_Vector* CFISH_Hash_Values_IMP(cfish_Hash* self); size_t CFISH_Hash_Get_Capacity_IMP(cfish_Hash* self); size_t CFISH_Hash_Get_Size_IMP(cfish_Hash* self); bool CFISH_Hash_Equals_IMP(cfish_Hash* self, cfish_Obj* other); void CFISH_Hash_Destroy_IMP(cfish_Hash* self); /* Define typedefs for each dynamic method, allowing us to cast generic * pointers to the appropriate function pointer type more cleanly. */ typedef void* (*CFISH_Hash_To_Host_t)(cfish_Hash* self, void* vcache); typedef cfish_Obj* (*CFISH_Hash_Clone_t)(cfish_Hash* self); typedef bool (*CFISH_Hash_Equals_t)(cfish_Hash* self, cfish_Obj* other); typedef int32_t (*CFISH_Hash_Compare_To_t)(cfish_Hash* self, cfish_Obj* other); typedef void (*CFISH_Hash_Destroy_t)(cfish_Hash* self); typedef cfish_String* (*CFISH_Hash_To_String_t)(cfish_Hash* self); typedef void (*CFISH_Hash_Clear_t)(cfish_Hash* self); typedef void (*CFISH_Hash_Store_t)(cfish_Hash* self, cfish_String* key, cfish_Obj* value); typedef void (*CFISH_Hash_Store_Utf8_t)(cfish_Hash* self, const char* utf8, size_t size, cfish_Obj* value); typedef cfish_Obj* (*CFISH_Hash_Fetch_t)(cfish_Hash* self, cfish_String* key); typedef cfish_Obj* (*CFISH_Hash_Fetch_Utf8_t)(cfish_Hash* self, const char* utf8, size_t size); typedef cfish_Obj* (*CFISH_Hash_Delete_t)(cfish_Hash* self, cfish_String* key); typedef cfish_Obj* (*CFISH_Hash_Delete_Utf8_t)(cfish_Hash* self, const char* utf8, size_t size); typedef bool (*CFISH_Hash_Has_Key_t)(cfish_Hash* self, cfish_String* key); typedef cfish_Vector* (*CFISH_Hash_Keys_t)(cfish_Hash* self); typedef cfish_Vector* (*CFISH_Hash_Values_t)(cfish_Hash* self); typedef size_t (*CFISH_Hash_Get_Capacity_t)(cfish_Hash* self); typedef size_t (*CFISH_Hash_Get_Size_t)(cfish_Hash* self); /* Define type-safe wrappers for inert functions of Obj. */ static CFISH_INLINE cfish_Class* cfish_Hash_get_class(cfish_Hash *self) { return cfish_Obj_get_class((cfish_Obj*)self); } static CFISH_INLINE cfish_String* cfish_Hash_get_class_name(cfish_Hash *self) { return cfish_Obj_get_class_name((cfish_Obj*)self); } static CFISH_INLINE bool cfish_Hash_is_a(cfish_Hash *self, cfish_Class *ancestor) { return cfish_Obj_is_a((cfish_Obj*)self, ancestor); } /* Define the inline functions which implement this class's virtual methods. */ extern CFISH_VISIBLE uint32_t CFISH_Hash_To_Host_OFFSET; static CFISH_INLINE void* CFISH_Hash_To_Host(cfish_Hash* self, void* vcache) { #ifdef CFP_CFISH return CFISH_Hash_To_Host_IMP(self, vcache); #else const CFISH_Hash_To_Host_t method = (CFISH_Hash_To_Host_t)cfish_obj_method(self, CFISH_Hash_To_Host_OFFSET); return method(self, vcache); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Clone_OFFSET; static CFISH_INLINE cfish_Obj* CFISH_Hash_Clone(cfish_Hash* self) { #ifdef CFP_CFISH return CFISH_Obj_Clone_IMP((cfish_Obj*)self); #else const CFISH_Hash_Clone_t method = (CFISH_Hash_Clone_t)cfish_obj_method(self, CFISH_Hash_Clone_OFFSET); return method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Equals_OFFSET; static CFISH_INLINE bool CFISH_Hash_Equals(cfish_Hash* self, cfish_Obj* other) { #ifdef CFP_CFISH return CFISH_Hash_Equals_IMP(self, other); #else const CFISH_Hash_Equals_t method = (CFISH_Hash_Equals_t)cfish_obj_method(self, CFISH_Hash_Equals_OFFSET); return method(self, other); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Compare_To_OFFSET; static CFISH_INLINE int32_t CFISH_Hash_Compare_To(cfish_Hash* self, cfish_Obj* other) { #ifdef CFP_CFISH return CFISH_Obj_Compare_To_IMP((cfish_Obj*)self, other); #else const CFISH_Hash_Compare_To_t method = (CFISH_Hash_Compare_To_t)cfish_obj_method(self, CFISH_Hash_Compare_To_OFFSET); return method(self, other); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Destroy_OFFSET; static CFISH_INLINE void CFISH_Hash_Destroy(cfish_Hash* self) { #ifdef CFP_CFISH CFISH_Hash_Destroy_IMP(self); #else const CFISH_Hash_Destroy_t method = (CFISH_Hash_Destroy_t)cfish_obj_method(self, CFISH_Hash_Destroy_OFFSET); method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_To_String_OFFSET; static CFISH_INLINE cfish_String* CFISH_Hash_To_String(cfish_Hash* self) { #ifdef CFP_CFISH return CFISH_Obj_To_String_IMP((cfish_Obj*)self); #else const CFISH_Hash_To_String_t method = (CFISH_Hash_To_String_t)cfish_obj_method(self, CFISH_Hash_To_String_OFFSET); return method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Clear_OFFSET; static CFISH_INLINE void CFISH_Hash_Clear(cfish_Hash* self) { #ifdef CFP_CFISH CFISH_Hash_Clear_IMP(self); #else const CFISH_Hash_Clear_t method = (CFISH_Hash_Clear_t)cfish_obj_method(self, CFISH_Hash_Clear_OFFSET); method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Store_OFFSET; static CFISH_INLINE void CFISH_Hash_Store(cfish_Hash* self, cfish_String* key, cfish_Obj* value) { #ifdef CFP_CFISH CFISH_Hash_Store_IMP(self, key, value); #else const CFISH_Hash_Store_t method = (CFISH_Hash_Store_t)cfish_obj_method(self, CFISH_Hash_Store_OFFSET); method(self, key, value); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Store_Utf8_OFFSET; static CFISH_INLINE void CFISH_Hash_Store_Utf8(cfish_Hash* self, const char* utf8, size_t size, cfish_Obj* value) { #ifdef CFP_CFISH CFISH_Hash_Store_Utf8_IMP(self, utf8, size, value); #else const CFISH_Hash_Store_Utf8_t method = (CFISH_Hash_Store_Utf8_t)cfish_obj_method(self, CFISH_Hash_Store_Utf8_OFFSET); method(self, utf8, size, value); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Fetch_OFFSET; static CFISH_INLINE cfish_Obj* CFISH_Hash_Fetch(cfish_Hash* self, cfish_String* key) { #ifdef CFP_CFISH return CFISH_Hash_Fetch_IMP(self, key); #else const CFISH_Hash_Fetch_t method = (CFISH_Hash_Fetch_t)cfish_obj_method(self, CFISH_Hash_Fetch_OFFSET); return method(self, key); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Fetch_Utf8_OFFSET; static CFISH_INLINE cfish_Obj* CFISH_Hash_Fetch_Utf8(cfish_Hash* self, const char* utf8, size_t size) { #ifdef CFP_CFISH return CFISH_Hash_Fetch_Utf8_IMP(self, utf8, size); #else const CFISH_Hash_Fetch_Utf8_t method = (CFISH_Hash_Fetch_Utf8_t)cfish_obj_method(self, CFISH_Hash_Fetch_Utf8_OFFSET); return method(self, utf8, size); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Delete_OFFSET; static CFISH_INLINE cfish_Obj* CFISH_Hash_Delete(cfish_Hash* self, cfish_String* key) { #ifdef CFP_CFISH return CFISH_Hash_Delete_IMP(self, key); #else const CFISH_Hash_Delete_t method = (CFISH_Hash_Delete_t)cfish_obj_method(self, CFISH_Hash_Delete_OFFSET); return method(self, key); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Delete_Utf8_OFFSET; static CFISH_INLINE cfish_Obj* CFISH_Hash_Delete_Utf8(cfish_Hash* self, const char* utf8, size_t size) { #ifdef CFP_CFISH return CFISH_Hash_Delete_Utf8_IMP(self, utf8, size); #else const CFISH_Hash_Delete_Utf8_t method = (CFISH_Hash_Delete_Utf8_t)cfish_obj_method(self, CFISH_Hash_Delete_Utf8_OFFSET); return method(self, utf8, size); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Has_Key_OFFSET; static CFISH_INLINE bool CFISH_Hash_Has_Key(cfish_Hash* self, cfish_String* key) { #ifdef CFP_CFISH return CFISH_Hash_Has_Key_IMP(self, key); #else const CFISH_Hash_Has_Key_t method = (CFISH_Hash_Has_Key_t)cfish_obj_method(self, CFISH_Hash_Has_Key_OFFSET); return method(self, key); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Keys_OFFSET; static CFISH_INLINE cfish_Vector* CFISH_Hash_Keys(cfish_Hash* self) { #ifdef CFP_CFISH return CFISH_Hash_Keys_IMP(self); #else const CFISH_Hash_Keys_t method = (CFISH_Hash_Keys_t)cfish_obj_method(self, CFISH_Hash_Keys_OFFSET); return method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Values_OFFSET; static CFISH_INLINE cfish_Vector* CFISH_Hash_Values(cfish_Hash* self) { #ifdef CFP_CFISH return CFISH_Hash_Values_IMP(self); #else const CFISH_Hash_Values_t method = (CFISH_Hash_Values_t)cfish_obj_method(self, CFISH_Hash_Values_OFFSET); return method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Get_Capacity_OFFSET; static CFISH_INLINE size_t CFISH_Hash_Get_Capacity(cfish_Hash* self) { #ifdef CFP_CFISH return CFISH_Hash_Get_Capacity_IMP(self); #else const CFISH_Hash_Get_Capacity_t method = (CFISH_Hash_Get_Capacity_t)cfish_obj_method(self, CFISH_Hash_Get_Capacity_OFFSET); return method(self); #endif } extern CFISH_VISIBLE uint32_t CFISH_Hash_Get_Size_OFFSET; static CFISH_INLINE size_t CFISH_Hash_Get_Size(cfish_Hash* self) { #ifdef CFP_CFISH return CFISH_Hash_Get_Size_IMP(self); #else const CFISH_Hash_Get_Size_t method = (CFISH_Hash_Get_Size_t)cfish_obj_method(self, CFISH_Hash_Get_Size_OFFSET); return method(self); #endif } /* Declare callbacks for wrapping host overrides. */ #ifdef CFISH_NO_DYNAMIC_OVERRIDES #else #endif /* Define "short names" for this class's symbols. */ #ifdef CFISH_USE_SHORT_NAMES #define Hash cfish_Hash #define HASH CFISH_HASH #define Hash_init_class cfish_Hash_init_class #define Hash_new cfish_Hash_new #define Hash_init cfish_Hash_init #define Hash_get_tombstone cfish_Hash_get_tombstone #define Hash_get_class cfish_Hash_get_class #define Hash_get_class_name cfish_Hash_get_class_name #define Hash_is_a cfish_Hash_is_a #define Hash_To_Host_IMP CFISH_Hash_To_Host_IMP #define Hash_Clear_IMP CFISH_Hash_Clear_IMP #define Hash_Store_IMP CFISH_Hash_Store_IMP #define Hash_Store_Utf8_IMP CFISH_Hash_Store_Utf8_IMP #define Hash_Fetch_IMP CFISH_Hash_Fetch_IMP #define Hash_Fetch_Utf8_IMP CFISH_Hash_Fetch_Utf8_IMP #define Hash_Delete_IMP CFISH_Hash_Delete_IMP #define Hash_Delete_Utf8_IMP CFISH_Hash_Delete_Utf8_IMP #define Hash_Has_Key_IMP CFISH_Hash_Has_Key_IMP #define Hash_Keys_IMP CFISH_Hash_Keys_IMP #define Hash_Values_IMP CFISH_Hash_Values_IMP #define Hash_Get_Capacity_IMP CFISH_Hash_Get_Capacity_IMP #define Hash_Get_Size_IMP CFISH_Hash_Get_Size_IMP #define Hash_Equals_IMP CFISH_Hash_Equals_IMP #define Hash_Destroy_IMP CFISH_Hash_Destroy_IMP #define Hash_To_Host CFISH_Hash_To_Host #define Hash_To_Host_t CFISH_Hash_To_Host_t #define Hash_Clone CFISH_Hash_Clone #define Hash_Clone_t CFISH_Hash_Clone_t #define Hash_Equals CFISH_Hash_Equals #define Hash_Equals_t CFISH_Hash_Equals_t #define Hash_Compare_To CFISH_Hash_Compare_To #define Hash_Compare_To_t CFISH_Hash_Compare_To_t #define Hash_Destroy CFISH_Hash_Destroy #define Hash_Destroy_t CFISH_Hash_Destroy_t #define Hash_To_String CFISH_Hash_To_String #define Hash_To_String_t CFISH_Hash_To_String_t #define Hash_Clear CFISH_Hash_Clear #define Hash_Clear_t CFISH_Hash_Clear_t #define Hash_Store CFISH_Hash_Store #define Hash_Store_t CFISH_Hash_Store_t #define Hash_Store_Utf8 CFISH_Hash_Store_Utf8 #define Hash_Store_Utf8_t CFISH_Hash_Store_Utf8_t #define Hash_Fetch CFISH_Hash_Fetch #define Hash_Fetch_t CFISH_Hash_Fetch_t #define Hash_Fetch_Utf8 CFISH_Hash_Fetch_Utf8 #define Hash_Fetch_Utf8_t CFISH_Hash_Fetch_Utf8_t #define Hash_Delete CFISH_Hash_Delete #define Hash_Delete_t CFISH_Hash_Delete_t #define Hash_Delete_Utf8 CFISH_Hash_Delete_Utf8 #define Hash_Delete_Utf8_t CFISH_Hash_Delete_Utf8_t #define Hash_Has_Key CFISH_Hash_Has_Key #define Hash_Has_Key_t CFISH_Hash_Has_Key_t #define Hash_Keys CFISH_Hash_Keys #define Hash_Keys_t CFISH_Hash_Keys_t #define Hash_Values CFISH_Hash_Values #define Hash_Values_t CFISH_Hash_Values_t #define Hash_Get_Capacity CFISH_Hash_Get_Capacity #define Hash_Get_Capacity_t CFISH_Hash_Get_Capacity_t #define Hash_Get_Size CFISH_Hash_Get_Size #define Hash_Get_Size_t CFISH_Hash_Get_Size_t #endif /* CFISH_USE_SHORT_NAMES */ #ifdef __cplusplus } #endif #endif /* H_CLOWNFISH_HASH */