ObjFW
 All Classes Functions Variables
OFDictionary_hashtable.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012
3  * Jonathan Schleifer <js@webkeks.org>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFDictionary.h"
18 
19 struct of_dictionary_hashtable_bucket
20 {
21  id key, object;
22  uint32_t hash;
23 };
24 
25 @interface OFDictionary_hashtable: OFDictionary
26 {
27  struct of_dictionary_hashtable_bucket **data;
28  uint32_t size;
29  size_t count;
30 }
31 
32 #if defined(OF_SET_M) || defined(OF_COUNTED_SET_M) || \
33  defined(OF_SET_HASHTABLE_M) || defined(OF_COUNTED_SET_HASHTABLE_M)
34 - OF_initWithDictionary: (OFDictionary*)dictionary
35  copyKeys: (BOOL)copyKeys;
36 #endif
37 @end
38 
39 @interface OFDictionaryEnumerator_hashtable: OFEnumerator
40 {
41  OFDictionary_hashtable *dictionary;
42  struct of_dictionary_hashtable_bucket **data;
43  uint32_t size;
44  unsigned long mutations;
45  unsigned long *mutationsPtr;
46  uint32_t pos;
47 }
48 
49 - initWithDictionary: (OFDictionary_hashtable*)dictionary
50  data: (struct of_dictionary_hashtable_bucket**)data
51  size: (uint32_t)size
52  mutationsPointer: (unsigned long*)mutationsPtr;
53 @end
54 
55 @interface OFDictionaryKeyEnumerator_hashtable: OFDictionaryEnumerator_hashtable
56 @end
57 
58 @interface OFDictionaryObjectEnumerator_hashtable:
59  OFDictionaryEnumerator_hashtable
60 @end
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 extern struct of_dictionary_hashtable_bucket
66  of_dictionary_hashtable_deleted_bucket;
67 #ifdef __cplusplus
68 }
69 #endif