1 /*
2  *  PointerHash.h
3  *  CuckooHashTable
4  *
5  *  Created by Steve Dekorte on 2009 04 28.
6  *  Copyright 2009 __MyCompanyName__. All rights reserved.
7  *
8  */
9 
10 #ifndef POINTERHASH_DEFINED
11 #define POINTERHASH_DEFINED 1
12 
13 #include "Common.h"
14 #include <stddef.h>
15 #include "PortableStdint.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #define POINTERHASH_MAXLOOP 10
22 
23 #include "PointerHash_struct.h"
24 
25 BASEKIT_API PointerHash *PointerHash_new(void);
26 BASEKIT_API void PointerHash_copy_(PointerHash *self, const PointerHash *other);
27 BASEKIT_API PointerHash *PointerHash_clone(PointerHash *self);
28 BASEKIT_API void PointerHash_free(PointerHash *self);
29 
30 //BASEKIT_API void PointerHash_at_put_(PointerHash *self, void *k, void *v);
31 BASEKIT_API void PointerHash_removeKey_(PointerHash *self, void *k);
32 BASEKIT_API size_t PointerHash_size(PointerHash *self); // actually the keyCount
33 
34 BASEKIT_API size_t PointerHash_memorySize(PointerHash *self);
35 BASEKIT_API void PointerHash_compact(PointerHash *self);
36 
37 // --- private methods ----------------------------------------
38 
39 BASEKIT_API void PointerHash_setSize_(PointerHash *self, size_t size);
40 BASEKIT_API void PointerHash_insert_(PointerHash *self, PointerHashRecord *x);
41 BASEKIT_API void PointerHash_grow(PointerHash *self);
42 //BASEKIT_API void PointerHash_shrinkIfNeeded(PointerHash *self);
43 BASEKIT_API void PointerHash_shrink(PointerHash *self);
44 BASEKIT_API void PointerHash_show(PointerHash *self);
45 BASEKIT_API void PointerHash_updateMask(PointerHash *self);
46 
47 #include "PointerHash_inline.h"
48 
49 #define PointerHash_cleanSlots(self)
50 #define PointerHash_hasDirtyKey_(self, k) 0
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif
56