Update libgee to 0.9.92 (3462b25)
[profile/ivi/libgee.git] / gee / hashset.c
1 /* hashset.c generated by valac 0.18.0, the Vala compiler
2  * generated from hashset.vala, do not modify */
3
4 /* hashset.vala
5  *
6  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
7  * Copyright (C) 1997-2000  GLib Team and others
8  * Copyright (C) 2007-2009  Jürg Billeter
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
23  *
24  * Author:
25  *      Jürg Billeter <j@bitron.ch>
26  */
27
28 #include <glib.h>
29 #include <glib-object.h>
30
31
32 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
33 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
34 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
35 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
36
37 typedef struct _GeeTraversable GeeTraversable;
38 typedef struct _GeeTraversableIface GeeTraversableIface;
39
40 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
41
42 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
43 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
44 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
45 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
46 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
47 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
48
49 typedef struct _GeeLazy GeeLazy;
50 typedef struct _GeeLazyClass GeeLazyClass;
51
52 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
53 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
54 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
55 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
56
57 typedef struct _GeeIterator GeeIterator;
58 typedef struct _GeeIteratorIface GeeIteratorIface;
59
60 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
61 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
62 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
63 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
64
65 typedef struct _GeeIterable GeeIterable;
66 typedef struct _GeeIterableIface GeeIterableIface;
67
68 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
69 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
70 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
71 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
72
73 typedef struct _GeeCollection GeeCollection;
74 typedef struct _GeeCollectionIface GeeCollectionIface;
75
76 #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ())
77 #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection))
78 #define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
79 #define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION))
80 #define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION))
81 #define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
82
83 typedef struct _GeeAbstractCollection GeeAbstractCollection;
84 typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass;
85 typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate;
86
87 #define GEE_TYPE_SET (gee_set_get_type ())
88 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
89 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
90 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
91
92 typedef struct _GeeSet GeeSet;
93 typedef struct _GeeSetIface GeeSetIface;
94
95 #define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ())
96 #define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet))
97 #define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
98 #define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET))
99 #define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET))
100 #define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
101
102 typedef struct _GeeAbstractSet GeeAbstractSet;
103 typedef struct _GeeAbstractSetClass GeeAbstractSetClass;
104 typedef struct _GeeAbstractSetPrivate GeeAbstractSetPrivate;
105
106 #define GEE_TYPE_HASH_SET (gee_hash_set_get_type ())
107 #define GEE_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_SET, GeeHashSet))
108 #define GEE_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_SET, GeeHashSetClass))
109 #define GEE_IS_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_SET))
110 #define GEE_IS_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_SET))
111 #define GEE_HASH_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_SET, GeeHashSetClass))
112
113 typedef struct _GeeHashSet GeeHashSet;
114 typedef struct _GeeHashSetClass GeeHashSetClass;
115 typedef struct _GeeHashSetPrivate GeeHashSetPrivate;
116 typedef struct _GeeHashSetNode GeeHashSetNode;
117
118 #define GEE_HASH_SET_TYPE_ITERATOR (gee_hash_set_iterator_get_type ())
119 #define GEE_HASH_SET_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator))
120 #define GEE_HASH_SET_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIteratorClass))
121 #define GEE_HASH_SET_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_HASH_SET_TYPE_ITERATOR))
122 #define GEE_HASH_SET_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_HASH_SET_TYPE_ITERATOR))
123 #define GEE_HASH_SET_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIteratorClass))
124
125 typedef struct _GeeHashSetIterator GeeHashSetIterator;
126 typedef struct _GeeHashSetIteratorClass GeeHashSetIteratorClass;
127 #define _gee_hash_set_node_free0(var) ((var == NULL) ? NULL : (var = (gee_hash_set_node_free (var), NULL)))
128 typedef struct _GeeHashSetIteratorPrivate GeeHashSetIteratorPrivate;
129 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
130 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
131
132 typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data);
133 typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data);
134 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
135 typedef enum  {
136         GEE_TRAVERSABLE_STREAM_YIELD,
137         GEE_TRAVERSABLE_STREAM_CONTINUE,
138         GEE_TRAVERSABLE_STREAM_END
139 } GeeTraversableStream;
140
141 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
142 struct _GeeIteratorIface {
143         GTypeInterface parent_iface;
144         gboolean (*next) (GeeIterator* self);
145         gboolean (*has_next) (GeeIterator* self);
146         gpointer (*get) (GeeIterator* self);
147         void (*remove) (GeeIterator* self);
148         gboolean (*get_valid) (GeeIterator* self);
149         gboolean (*get_read_only) (GeeIterator* self);
150 };
151
152 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
153 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
154 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
155 struct _GeeTraversableIface {
156         GTypeInterface parent_iface;
157         GType (*get_g_type) (GeeTraversable* self);
158         GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
159         GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
160         gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
161         GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
162         gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
163         GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
164         GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
165         GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
166         GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
167         GType (*get_element_type) (GeeTraversable* self);
168 };
169
170 struct _GeeIterableIface {
171         GTypeInterface parent_iface;
172         GType (*get_g_type) (GeeIterable* self);
173         GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
174         GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
175         GeeIterator* (*iterator) (GeeIterable* self);
176 };
177
178 struct _GeeCollectionIface {
179         GTypeInterface parent_iface;
180         GType (*get_g_type) (GeeCollection* self);
181         GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
182         GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
183         gboolean (*contains) (GeeCollection* self, gconstpointer item);
184         gboolean (*add) (GeeCollection* self, gconstpointer item);
185         gboolean (*remove) (GeeCollection* self, gconstpointer item);
186         void (*clear) (GeeCollection* self);
187         gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
188         gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
189         gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
190         gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
191         gpointer* (*to_array) (GeeCollection* self, int* result_length1);
192         gint (*get_size) (GeeCollection* self);
193         gboolean (*get_is_empty) (GeeCollection* self);
194         gboolean (*get_read_only) (GeeCollection* self);
195         GeeCollection* (*get_read_only_view) (GeeCollection* self);
196 };
197
198 struct _GeeAbstractCollection {
199         GObject parent_instance;
200         GeeAbstractCollectionPrivate * priv;
201 };
202
203 struct _GeeAbstractCollectionClass {
204         GObjectClass parent_class;
205         gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item);
206         gboolean (*add) (GeeAbstractCollection* self, gconstpointer item);
207         gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item);
208         void (*clear) (GeeAbstractCollection* self);
209         GeeIterator* (*iterator) (GeeAbstractCollection* self);
210         gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target);
211         void (*reserved0) (GeeAbstractCollection* self);
212         void (*reserved1) (GeeAbstractCollection* self);
213         void (*reserved2) (GeeAbstractCollection* self);
214         void (*reserved3) (GeeAbstractCollection* self);
215         void (*reserved4) (GeeAbstractCollection* self);
216         void (*reserved5) (GeeAbstractCollection* self);
217         void (*reserved6) (GeeAbstractCollection* self);
218         void (*reserved7) (GeeAbstractCollection* self);
219         void (*reserved8) (GeeAbstractCollection* self);
220         void (*reserved9) (GeeAbstractCollection* self);
221         gint (*get_size) (GeeAbstractCollection* self);
222         gboolean (*get_read_only) (GeeAbstractCollection* self);
223         GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self);
224 };
225
226 struct _GeeSetIface {
227         GTypeInterface parent_iface;
228         GType (*get_g_type) (GeeSet* self);
229         GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
230         GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
231         GeeSet* (*get_read_only_view) (GeeSet* self);
232 };
233
234 struct _GeeAbstractSet {
235         GeeAbstractCollection parent_instance;
236         GeeAbstractSetPrivate * priv;
237 };
238
239 struct _GeeAbstractSetClass {
240         GeeAbstractCollectionClass parent_class;
241         void (*reserved0) (GeeAbstractSet* self);
242         void (*reserved1) (GeeAbstractSet* self);
243         void (*reserved2) (GeeAbstractSet* self);
244         void (*reserved3) (GeeAbstractSet* self);
245         void (*reserved4) (GeeAbstractSet* self);
246         void (*reserved5) (GeeAbstractSet* self);
247         void (*reserved6) (GeeAbstractSet* self);
248         void (*reserved7) (GeeAbstractSet* self);
249         void (*reserved8) (GeeAbstractSet* self);
250         void (*reserved9) (GeeAbstractSet* self);
251         GeeSet* (*get_read_only_view) (GeeAbstractSet* self);
252 };
253
254 struct _GeeHashSet {
255         GeeAbstractSet parent_instance;
256         GeeHashSetPrivate * priv;
257 };
258
259 struct _GeeHashSetClass {
260         GeeAbstractSetClass parent_class;
261 };
262
263 struct _GeeHashSetPrivate {
264         GType g_type;
265         GBoxedCopyFunc g_dup_func;
266         GDestroyNotify g_destroy_func;
267         GeeHashDataFunc _hash_func;
268         gpointer _hash_func_target;
269         GDestroyNotify _hash_func_target_destroy_notify;
270         GeeEqualDataFunc _equal_func;
271         gpointer _equal_func_target;
272         GDestroyNotify _equal_func_target_destroy_notify;
273         gint _array_size;
274         gint _nnodes;
275         GeeHashSetNode** _nodes;
276         gint _nodes_length1;
277         gint __nodes_size_;
278         gint _stamp;
279 };
280
281 struct _GeeHashSetNode {
282         gpointer key;
283         GeeHashSetNode* next;
284         guint key_hash;
285 };
286
287 struct _GeeHashSetIterator {
288         GObject parent_instance;
289         GeeHashSetIteratorPrivate * priv;
290 };
291
292 struct _GeeHashSetIteratorClass {
293         GObjectClass parent_class;
294 };
295
296 struct _GeeHashSetIteratorPrivate {
297         GType g_type;
298         GBoxedCopyFunc g_dup_func;
299         GDestroyNotify g_destroy_func;
300         GeeHashSet* _set;
301         gint _index;
302         GeeHashSetNode* _node;
303         GeeHashSetNode* _next;
304         gint _stamp;
305 };
306
307
308 static gpointer gee_hash_set_parent_class = NULL;
309 static gpointer gee_hash_set_iterator_parent_class = NULL;
310 static GeeTraversableIface* gee_hash_set_iterator_gee_traversable_parent_iface = NULL;
311 static GeeIteratorIface* gee_hash_set_iterator_gee_iterator_parent_iface = NULL;
312
313 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
314 gpointer gee_lazy_ref (gpointer instance);
315 void gee_lazy_unref (gpointer instance);
316 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
317 void gee_value_set_lazy (GValue* value, gpointer v_object);
318 void gee_value_take_lazy (GValue* value, gpointer v_object);
319 gpointer gee_value_get_lazy (const GValue* value);
320 GType gee_lazy_get_type (void) G_GNUC_CONST;
321 GType gee_iterator_get_type (void) G_GNUC_CONST;
322 GType gee_traversable_get_type (void) G_GNUC_CONST;
323 GType gee_iterable_get_type (void) G_GNUC_CONST;
324 GType gee_collection_get_type (void) G_GNUC_CONST;
325 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
326 GType gee_set_get_type (void) G_GNUC_CONST;
327 GType gee_abstract_set_get_type (void) G_GNUC_CONST;
328 GType gee_hash_set_get_type (void) G_GNUC_CONST;
329 static void gee_hash_set_node_free (GeeHashSetNode* self);
330 #define GEE_HASH_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_HASH_SET, GeeHashSetPrivate))
331 enum  {
332         GEE_HASH_SET_DUMMY_PROPERTY,
333         GEE_HASH_SET_G_TYPE,
334         GEE_HASH_SET_G_DUP_FUNC,
335         GEE_HASH_SET_G_DESTROY_FUNC,
336         GEE_HASH_SET_SIZE,
337         GEE_HASH_SET_READ_ONLY
338 };
339 void gee_abstract_collection_clear (GeeAbstractCollection* self);
340 #define GEE_HASH_SET_MIN_SIZE 11
341 #define GEE_HASH_SET_MAX_SIZE 13845163
342 GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
343 GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
344 GeeAbstractSet* gee_abstract_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
345 GeeHashDataFunc gee_functions_get_hash_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
346 GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
347 static void gee_hash_set_set_hash_func (GeeHashSet* self, GeeHashDataFunc value, gpointer value_target);
348 static void gee_hash_set_set_equal_func (GeeHashSet* self, GeeEqualDataFunc value, gpointer value_target);
349 static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self, gconstpointer key);
350 GeeHashDataFunc gee_hash_set_get_hash_func (GeeHashSet* self, gpointer* result_target);
351 GeeEqualDataFunc gee_hash_set_get_equal_func (GeeHashSet* self, gpointer* result_target);
352 static gboolean gee_hash_set_real_contains (GeeAbstractCollection* base, gconstpointer key);
353 static GeeIterator* gee_hash_set_real_iterator (GeeAbstractCollection* base);
354 static GeeHashSetIterator* gee_hash_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashSet* set);
355 static GeeHashSetIterator* gee_hash_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashSet* set);
356 static GType gee_hash_set_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
357 static gboolean gee_hash_set_real_add (GeeAbstractCollection* base, gconstpointer key);
358 static GeeHashSetNode* gee_hash_set_node_new (gpointer k, guint hash);
359 static GeeHashSetNode* gee_hash_set_node_new (gpointer k, guint hash);
360 static void gee_hash_set_resize (GeeHashSet* self);
361 static gboolean gee_hash_set_real_remove (GeeAbstractCollection* base, gconstpointer key);
362 static inline gboolean gee_hash_set_remove_helper (GeeHashSet* self, gconstpointer key);
363 static void gee_hash_set_real_clear (GeeAbstractCollection* base);
364 static void gee_hash_set_node_instance_init (GeeHashSetNode * self);
365 #define GEE_HASH_SET_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIteratorPrivate))
366 enum  {
367         GEE_HASH_SET_ITERATOR_DUMMY_PROPERTY,
368         GEE_HASH_SET_ITERATOR_G_TYPE,
369         GEE_HASH_SET_ITERATOR_G_DUP_FUNC,
370         GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC,
371         GEE_HASH_SET_ITERATOR_READ_ONLY,
372         GEE_HASH_SET_ITERATOR_VALID
373 };
374 static gboolean gee_hash_set_iterator_real_next (GeeIterator* base);
375 gboolean gee_iterator_has_next (GeeIterator* self);
376 static gboolean gee_hash_set_iterator_real_has_next (GeeIterator* base);
377 static gpointer gee_hash_set_iterator_real_get (GeeIterator* base);
378 static void gee_hash_set_iterator_real_remove (GeeIterator* base);
379 static gboolean gee_hash_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
380 static void gee_hash_set_iterator_finalize (GObject* obj);
381 gboolean gee_iterator_get_read_only (GeeIterator* self);
382 gboolean gee_iterator_get_valid (GeeIterator* self);
383 static void _vala_gee_hash_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
384 static void _vala_gee_hash_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
385 static void gee_hash_set_finalize (GObject* obj);
386 gint gee_abstract_collection_get_size (GeeAbstractCollection* self);
387 gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self);
388 static void _vala_gee_hash_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
389 static void _vala_gee_hash_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
390 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
391 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
392
393
394 /**
395  * Constructs a new, empty hash set.
396  *
397  * If not provided, the functions parameters are requested to the
398  * {@link Functions} function factory methods.
399  *
400  * @param hash_func an optional hash function
401  * @param equal_func an optional equality testing function
402  */
403 GeeHashSet* gee_hash_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
404         GeeHashSet * self = NULL;
405         GeeHashDataFunc _tmp0_;
406         void* _tmp0__target;
407         GeeEqualDataFunc _tmp4_;
408         void* _tmp4__target;
409         GeeHashDataFunc _tmp8_;
410         void* _tmp8__target;
411         GeeEqualDataFunc _tmp9_;
412         void* _tmp9__target;
413         gint _tmp10_;
414         GeeHashSetNode** _tmp11_ = NULL;
415         self = (GeeHashSet*) gee_abstract_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
416         self->priv->g_type = g_type;
417         self->priv->g_dup_func = g_dup_func;
418         self->priv->g_destroy_func = g_destroy_func;
419         _tmp0_ = hash_func;
420         _tmp0__target = hash_func_target;
421         if (_tmp0_ == NULL) {
422                 void* _tmp1_ = NULL;
423                 GDestroyNotify _tmp2_ = NULL;
424                 GeeHashDataFunc _tmp3_ = NULL;
425                 _tmp3_ = gee_functions_get_hash_func_for (g_type, &_tmp1_, &_tmp2_);
426                 (hash_func_target_destroy_notify == NULL) ? NULL : (hash_func_target_destroy_notify (hash_func_target), NULL);
427                 hash_func = NULL;
428                 hash_func_target = NULL;
429                 hash_func_target_destroy_notify = NULL;
430                 hash_func = _tmp3_;
431                 hash_func_target = _tmp1_;
432                 hash_func_target_destroy_notify = _tmp2_;
433         }
434         _tmp4_ = equal_func;
435         _tmp4__target = equal_func_target;
436         if (_tmp4_ == NULL) {
437                 void* _tmp5_ = NULL;
438                 GDestroyNotify _tmp6_ = NULL;
439                 GeeEqualDataFunc _tmp7_ = NULL;
440                 _tmp7_ = gee_functions_get_equal_func_for (g_type, &_tmp5_, &_tmp6_);
441                 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
442                 equal_func = NULL;
443                 equal_func_target = NULL;
444                 equal_func_target_destroy_notify = NULL;
445                 equal_func = _tmp7_;
446                 equal_func_target = _tmp5_;
447                 equal_func_target_destroy_notify = _tmp6_;
448         }
449         _tmp8_ = hash_func;
450         _tmp8__target = hash_func_target;
451         gee_hash_set_set_hash_func (self, _tmp8_, _tmp8__target);
452         _tmp9_ = equal_func;
453         _tmp9__target = equal_func_target;
454         gee_hash_set_set_equal_func (self, _tmp9_, _tmp9__target);
455         self->priv->_array_size = GEE_HASH_SET_MIN_SIZE;
456         _tmp10_ = self->priv->_array_size;
457         _tmp11_ = g_new0 (GeeHashSetNode*, _tmp10_ + 1);
458         self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
459         self->priv->_nodes = _tmp11_;
460         self->priv->_nodes_length1 = _tmp10_;
461         self->priv->__nodes_size_ = self->priv->_nodes_length1;
462         (hash_func_target_destroy_notify == NULL) ? NULL : (hash_func_target_destroy_notify (hash_func_target), NULL);
463         hash_func = NULL;
464         hash_func_target = NULL;
465         hash_func_target_destroy_notify = NULL;
466         (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
467         equal_func = NULL;
468         equal_func_target = NULL;
469         equal_func_target_destroy_notify = NULL;
470         return self;
471 }
472
473
474 GeeHashSet* gee_hash_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashDataFunc hash_func, void* hash_func_target, GDestroyNotify hash_func_target_destroy_notify, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
475         return gee_hash_set_construct (GEE_TYPE_HASH_SET, g_type, g_dup_func, g_destroy_func, hash_func, hash_func_target, hash_func_target_destroy_notify, equal_func, equal_func_target, equal_func_target_destroy_notify);
476 }
477
478
479 static GeeHashSetNode** gee_hash_set_lookup_node (GeeHashSet* self, gconstpointer key) {
480         GeeHashSetNode** result = NULL;
481         GeeHashDataFunc _tmp0_;
482         void* _tmp0__target;
483         GeeHashDataFunc _tmp1_;
484         void* _tmp1__target;
485         gconstpointer _tmp2_;
486         guint _tmp3_ = 0U;
487         guint hash_value;
488         GeeHashSetNode** _tmp4_;
489         gint _tmp4__length1;
490         guint _tmp5_;
491         gint _tmp6_;
492         GeeHashSetNode** node;
493         GeeHashSetNode** _tmp22_;
494         g_return_val_if_fail (self != NULL, NULL);
495         _tmp0_ = gee_hash_set_get_hash_func (self, &_tmp0__target);
496         _tmp1_ = _tmp0_;
497         _tmp1__target = _tmp0__target;
498         _tmp2_ = key;
499         _tmp3_ = _tmp1_ (_tmp2_, _tmp1__target);
500         hash_value = _tmp3_;
501         _tmp4_ = self->priv->_nodes;
502         _tmp4__length1 = self->priv->_nodes_length1;
503         _tmp5_ = hash_value;
504         _tmp6_ = self->priv->_array_size;
505         node = &_tmp4_[_tmp5_ % _tmp6_];
506         while (TRUE) {
507                 gboolean _tmp7_ = FALSE;
508                 GeeHashSetNode** _tmp8_;
509                 gboolean _tmp20_;
510                 GeeHashSetNode** _tmp21_;
511                 _tmp8_ = node;
512                 if ((*_tmp8_) != NULL) {
513                         gboolean _tmp9_ = FALSE;
514                         guint _tmp10_;
515                         GeeHashSetNode** _tmp11_;
516                         guint _tmp12_;
517                         gboolean _tmp19_;
518                         _tmp10_ = hash_value;
519                         _tmp11_ = node;
520                         _tmp12_ = (*_tmp11_)->key_hash;
521                         if (_tmp10_ != _tmp12_) {
522                                 _tmp9_ = TRUE;
523                         } else {
524                                 GeeEqualDataFunc _tmp13_;
525                                 void* _tmp13__target;
526                                 GeeEqualDataFunc _tmp14_;
527                                 void* _tmp14__target;
528                                 GeeHashSetNode** _tmp15_;
529                                 gconstpointer _tmp16_;
530                                 gconstpointer _tmp17_;
531                                 gboolean _tmp18_ = FALSE;
532                                 _tmp13_ = gee_hash_set_get_equal_func (self, &_tmp13__target);
533                                 _tmp14_ = _tmp13_;
534                                 _tmp14__target = _tmp13__target;
535                                 _tmp15_ = node;
536                                 _tmp16_ = (*_tmp15_)->key;
537                                 _tmp17_ = key;
538                                 _tmp18_ = _tmp14_ (_tmp16_, _tmp17_, _tmp14__target);
539                                 _tmp9_ = !_tmp18_;
540                         }
541                         _tmp19_ = _tmp9_;
542                         _tmp7_ = _tmp19_;
543                 } else {
544                         _tmp7_ = FALSE;
545                 }
546                 _tmp20_ = _tmp7_;
547                 if (!_tmp20_) {
548                         break;
549                 }
550                 _tmp21_ = node;
551                 node = &(*_tmp21_)->next;
552         }
553         _tmp22_ = node;
554         result = _tmp22_;
555         return result;
556 }
557
558
559 /**
560  * {@inheritDoc}
561  */
562 static gboolean gee_hash_set_real_contains (GeeAbstractCollection* base, gconstpointer key) {
563         GeeHashSet * self;
564         gboolean result = FALSE;
565         gconstpointer _tmp0_;
566         GeeHashSetNode** _tmp1_ = NULL;
567         GeeHashSetNode** node;
568         self = (GeeHashSet*) base;
569         _tmp0_ = key;
570         _tmp1_ = gee_hash_set_lookup_node (self, _tmp0_);
571         node = _tmp1_;
572         result = (*node) != NULL;
573         return result;
574 }
575
576
577 /**
578  * {@inheritDoc}
579  */
580 static GeeIterator* gee_hash_set_real_iterator (GeeAbstractCollection* base) {
581         GeeHashSet * self;
582         GeeIterator* result = NULL;
583         GeeHashSetIterator* _tmp0_;
584         self = (GeeHashSet*) base;
585         _tmp0_ = gee_hash_set_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
586         result = (GeeIterator*) _tmp0_;
587         return result;
588 }
589
590
591 /**
592  * {@inheritDoc}
593  */
594 static gboolean gee_hash_set_real_add (GeeAbstractCollection* base, gconstpointer key) {
595         GeeHashSet * self;
596         gboolean result = FALSE;
597         gconstpointer _tmp0_;
598         GeeHashSetNode** _tmp1_ = NULL;
599         GeeHashSetNode** node;
600         GeeHashSetNode** _tmp2_;
601         self = (GeeHashSet*) base;
602         _tmp0_ = key;
603         _tmp1_ = gee_hash_set_lookup_node (self, _tmp0_);
604         node = _tmp1_;
605         _tmp2_ = node;
606         if ((*_tmp2_) != NULL) {
607                 result = FALSE;
608                 return result;
609         } else {
610                 GeeHashDataFunc _tmp3_;
611                 void* _tmp3__target;
612                 GeeHashDataFunc _tmp4_;
613                 void* _tmp4__target;
614                 gconstpointer _tmp5_;
615                 guint _tmp6_ = 0U;
616                 guint hash_value;
617                 GeeHashSetNode** _tmp7_;
618                 gconstpointer _tmp8_;
619                 gpointer _tmp9_;
620                 guint _tmp10_;
621                 GeeHashSetNode* _tmp11_;
622                 GeeHashSetNode* _tmp12_;
623                 gint _tmp13_;
624                 gint _tmp14_;
625                 _tmp3_ = gee_hash_set_get_hash_func (self, &_tmp3__target);
626                 _tmp4_ = _tmp3_;
627                 _tmp4__target = _tmp3__target;
628                 _tmp5_ = key;
629                 _tmp6_ = _tmp4_ (_tmp5_, _tmp4__target);
630                 hash_value = _tmp6_;
631                 _tmp7_ = node;
632                 _tmp8_ = key;
633                 _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
634                 _tmp10_ = hash_value;
635                 _tmp11_ = gee_hash_set_node_new (_tmp9_, _tmp10_);
636                 *_tmp7_ = _tmp11_;
637                 _tmp12_ = *_tmp7_;
638                 _tmp13_ = self->priv->_nnodes;
639                 self->priv->_nnodes = _tmp13_ + 1;
640                 gee_hash_set_resize (self);
641                 _tmp14_ = self->priv->_stamp;
642                 self->priv->_stamp = _tmp14_ + 1;
643                 result = TRUE;
644                 return result;
645         }
646 }
647
648
649 /**
650  * {@inheritDoc}
651  */
652 static gboolean gee_hash_set_real_remove (GeeAbstractCollection* base, gconstpointer key) {
653         GeeHashSet * self;
654         gboolean result = FALSE;
655         gconstpointer _tmp0_;
656         gboolean _tmp1_ = FALSE;
657         gboolean b;
658         gboolean _tmp2_;
659         self = (GeeHashSet*) base;
660         _tmp0_ = key;
661         _tmp1_ = gee_hash_set_remove_helper (self, _tmp0_);
662         b = _tmp1_;
663         _tmp2_ = b;
664         if (_tmp2_) {
665                 gee_hash_set_resize (self);
666         }
667         result = b;
668         return result;
669 }
670
671
672 /**
673  * {@inheritDoc}
674  */
675 static void gee_hash_set_real_clear (GeeAbstractCollection* base) {
676         GeeHashSet * self;
677         self = (GeeHashSet*) base;
678         {
679                 gint i;
680                 i = 0;
681                 {
682                         gboolean _tmp0_;
683                         _tmp0_ = TRUE;
684                         while (TRUE) {
685                                 gboolean _tmp1_;
686                                 gint _tmp3_;
687                                 gint _tmp4_;
688                                 GeeHashSetNode** _tmp5_;
689                                 gint _tmp5__length1;
690                                 gint _tmp6_;
691                                 GeeHashSetNode* _tmp7_;
692                                 GeeHashSetNode* node;
693                                 _tmp1_ = _tmp0_;
694                                 if (!_tmp1_) {
695                                         gint _tmp2_;
696                                         _tmp2_ = i;
697                                         i = _tmp2_ + 1;
698                                 }
699                                 _tmp0_ = FALSE;
700                                 _tmp3_ = i;
701                                 _tmp4_ = self->priv->_array_size;
702                                 if (!(_tmp3_ < _tmp4_)) {
703                                         break;
704                                 }
705                                 _tmp5_ = self->priv->_nodes;
706                                 _tmp5__length1 = self->priv->_nodes_length1;
707                                 _tmp6_ = i;
708                                 _tmp7_ = _tmp5_[_tmp6_];
709                                 _tmp5_[_tmp6_] = NULL;
710                                 node = _tmp7_;
711                                 while (TRUE) {
712                                         GeeHashSetNode* _tmp8_;
713                                         GeeHashSetNode* _tmp9_;
714                                         GeeHashSetNode* _tmp10_;
715                                         GeeHashSetNode* next;
716                                         GeeHashSetNode* _tmp11_;
717                                         GeeHashSetNode* _tmp12_;
718                                         _tmp8_ = node;
719                                         if (!(_tmp8_ != NULL)) {
720                                                 break;
721                                         }
722                                         _tmp9_ = node;
723                                         _tmp10_ = _tmp9_->next;
724                                         _tmp9_->next = NULL;
725                                         next = _tmp10_;
726                                         _tmp11_ = node;
727                                         ((_tmp11_->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_->key = (self->priv->g_destroy_func (_tmp11_->key), NULL));
728                                         _tmp11_->key = NULL;
729                                         _tmp12_ = next;
730                                         next = NULL;
731                                         _gee_hash_set_node_free0 (node);
732                                         node = _tmp12_;
733                                         _gee_hash_set_node_free0 (next);
734                                 }
735                                 _gee_hash_set_node_free0 (node);
736                         }
737                 }
738         }
739         self->priv->_nnodes = 0;
740         gee_hash_set_resize (self);
741 }
742
743
744 static inline gboolean gee_hash_set_remove_helper (GeeHashSet* self, gconstpointer key) {
745         gboolean result = FALSE;
746         gconstpointer _tmp0_;
747         GeeHashSetNode** _tmp1_ = NULL;
748         GeeHashSetNode** node;
749         GeeHashSetNode** _tmp2_;
750         g_return_val_if_fail (self != NULL, FALSE);
751         _tmp0_ = key;
752         _tmp1_ = gee_hash_set_lookup_node (self, _tmp0_);
753         node = _tmp1_;
754         _tmp2_ = node;
755         if ((*_tmp2_) != NULL) {
756                 GeeHashSetNode** _tmp3_;
757                 GeeHashSetNode** _tmp4_;
758                 GeeHashSetNode* _tmp5_;
759                 GeeHashSetNode* next;
760                 GeeHashSetNode** _tmp6_;
761                 GeeHashSetNode** _tmp7_;
762                 GeeHashSetNode** _tmp8_;
763                 GeeHashSetNode* _tmp9_;
764                 GeeHashSetNode* _tmp10_;
765                 gint _tmp11_;
766                 gint _tmp12_;
767                 _tmp3_ = node;
768                 _vala_assert ((*_tmp3_) != NULL, "*node != null");
769                 _tmp4_ = node;
770                 _tmp5_ = (*_tmp4_)->next;
771                 (*_tmp4_)->next = NULL;
772                 next = _tmp5_;
773                 _tmp6_ = node;
774                 (((*_tmp6_)->key == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : ((*_tmp6_)->key = (self->priv->g_destroy_func ((*_tmp6_)->key), NULL));
775                 (*_tmp6_)->key = NULL;
776                 _tmp7_ = node;
777                 gee_hash_set_node_free (*_tmp7_);
778                 _tmp8_ = node;
779                 _tmp9_ = next;
780                 next = NULL;
781                 *_tmp8_ = _tmp9_;
782                 _tmp10_ = *_tmp8_;
783                 _tmp11_ = self->priv->_nnodes;
784                 self->priv->_nnodes = _tmp11_ - 1;
785                 _tmp12_ = self->priv->_stamp;
786                 self->priv->_stamp = _tmp12_ + 1;
787                 result = TRUE;
788                 _gee_hash_set_node_free0 (next);
789                 return result;
790         }
791         result = FALSE;
792         return result;
793 }
794
795
796 static void gee_hash_set_resize (GeeHashSet* self) {
797         gboolean _tmp0_ = FALSE;
798         gboolean _tmp1_ = FALSE;
799         gint _tmp2_;
800         gint _tmp3_;
801         gboolean _tmp5_;
802         gboolean _tmp11_;
803         g_return_if_fail (self != NULL);
804         _tmp2_ = self->priv->_array_size;
805         _tmp3_ = self->priv->_nnodes;
806         if (_tmp2_ >= (3 * _tmp3_)) {
807                 gint _tmp4_;
808                 _tmp4_ = self->priv->_array_size;
809                 _tmp1_ = _tmp4_ >= GEE_HASH_SET_MIN_SIZE;
810         } else {
811                 _tmp1_ = FALSE;
812         }
813         _tmp5_ = _tmp1_;
814         if (_tmp5_) {
815                 _tmp0_ = TRUE;
816         } else {
817                 gboolean _tmp6_ = FALSE;
818                 gint _tmp7_;
819                 gint _tmp8_;
820                 gboolean _tmp10_;
821                 _tmp7_ = self->priv->_array_size;
822                 _tmp8_ = self->priv->_nnodes;
823                 if ((3 * _tmp7_) <= _tmp8_) {
824                         gint _tmp9_;
825                         _tmp9_ = self->priv->_array_size;
826                         _tmp6_ = _tmp9_ < GEE_HASH_SET_MAX_SIZE;
827                 } else {
828                         _tmp6_ = FALSE;
829                 }
830                 _tmp10_ = _tmp6_;
831                 _tmp0_ = _tmp10_;
832         }
833         _tmp11_ = _tmp0_;
834         if (_tmp11_) {
835                 gint _tmp12_;
836                 guint _tmp13_ = 0U;
837                 gint new_array_size;
838                 gint _tmp14_;
839                 gint _tmp15_ = 0;
840                 gint _tmp16_;
841                 GeeHashSetNode** _tmp17_ = NULL;
842                 GeeHashSetNode** new_nodes;
843                 gint new_nodes_length1;
844                 gint _new_nodes_size_;
845                 GeeHashSetNode** _tmp43_;
846                 gint _tmp43__length1;
847                 gint _tmp44_;
848                 _tmp12_ = self->priv->_nnodes;
849                 _tmp13_ = g_spaced_primes_closest ((guint) _tmp12_);
850                 new_array_size = (gint) _tmp13_;
851                 _tmp14_ = new_array_size;
852                 _tmp15_ = CLAMP (_tmp14_, GEE_HASH_SET_MIN_SIZE, GEE_HASH_SET_MAX_SIZE);
853                 new_array_size = _tmp15_;
854                 _tmp16_ = new_array_size;
855                 _tmp17_ = g_new0 (GeeHashSetNode*, _tmp16_ + 1);
856                 new_nodes = _tmp17_;
857                 new_nodes_length1 = _tmp16_;
858                 _new_nodes_size_ = new_nodes_length1;
859                 {
860                         gint i;
861                         i = 0;
862                         {
863                                 gboolean _tmp18_;
864                                 _tmp18_ = TRUE;
865                                 while (TRUE) {
866                                         gboolean _tmp19_;
867                                         gint _tmp21_;
868                                         gint _tmp22_;
869                                         GeeHashSetNode* node = NULL;
870                                         GeeHashSetNode* next;
871                                         _tmp19_ = _tmp18_;
872                                         if (!_tmp19_) {
873                                                 gint _tmp20_;
874                                                 _tmp20_ = i;
875                                                 i = _tmp20_ + 1;
876                                         }
877                                         _tmp18_ = FALSE;
878                                         _tmp21_ = i;
879                                         _tmp22_ = self->priv->_array_size;
880                                         if (!(_tmp21_ < _tmp22_)) {
881                                                 break;
882                                         }
883                                         next = NULL;
884                                         {
885                                                 GeeHashSetNode** _tmp23_;
886                                                 gint _tmp23__length1;
887                                                 gint _tmp24_;
888                                                 GeeHashSetNode* _tmp25_;
889                                                 gboolean _tmp26_;
890                                                 _tmp23_ = self->priv->_nodes;
891                                                 _tmp23__length1 = self->priv->_nodes_length1;
892                                                 _tmp24_ = i;
893                                                 _tmp25_ = _tmp23_[_tmp24_];
894                                                 _tmp23_[_tmp24_] = NULL;
895                                                 _gee_hash_set_node_free0 (node);
896                                                 node = _tmp25_;
897                                                 _tmp26_ = TRUE;
898                                                 while (TRUE) {
899                                                         gboolean _tmp27_;
900                                                         GeeHashSetNode* _tmp29_;
901                                                         GeeHashSetNode* _tmp30_;
902                                                         GeeHashSetNode* _tmp31_;
903                                                         GeeHashSetNode* _tmp32_;
904                                                         guint _tmp33_;
905                                                         gint _tmp34_;
906                                                         guint hash_val;
907                                                         GeeHashSetNode* _tmp35_;
908                                                         GeeHashSetNode** _tmp36_;
909                                                         gint _tmp36__length1;
910                                                         guint _tmp37_;
911                                                         GeeHashSetNode* _tmp38_;
912                                                         GeeHashSetNode** _tmp39_;
913                                                         gint _tmp39__length1;
914                                                         guint _tmp40_;
915                                                         GeeHashSetNode* _tmp41_;
916                                                         GeeHashSetNode* _tmp42_;
917                                                         _tmp27_ = _tmp26_;
918                                                         if (!_tmp27_) {
919                                                                 GeeHashSetNode* _tmp28_;
920                                                                 _tmp28_ = next;
921                                                                 next = NULL;
922                                                                 _gee_hash_set_node_free0 (node);
923                                                                 node = _tmp28_;
924                                                         }
925                                                         _tmp26_ = FALSE;
926                                                         _tmp29_ = node;
927                                                         if (!(_tmp29_ != NULL)) {
928                                                                 break;
929                                                         }
930                                                         _tmp30_ = node;
931                                                         _tmp31_ = _tmp30_->next;
932                                                         _tmp30_->next = NULL;
933                                                         _gee_hash_set_node_free0 (next);
934                                                         next = _tmp31_;
935                                                         _tmp32_ = node;
936                                                         _tmp33_ = _tmp32_->key_hash;
937                                                         _tmp34_ = new_array_size;
938                                                         hash_val = _tmp33_ % _tmp34_;
939                                                         _tmp35_ = node;
940                                                         _tmp36_ = new_nodes;
941                                                         _tmp36__length1 = new_nodes_length1;
942                                                         _tmp37_ = hash_val;
943                                                         _tmp38_ = _tmp36_[_tmp37_];
944                                                         _tmp36_[_tmp37_] = NULL;
945                                                         _gee_hash_set_node_free0 (_tmp35_->next);
946                                                         _tmp35_->next = _tmp38_;
947                                                         _tmp39_ = new_nodes;
948                                                         _tmp39__length1 = new_nodes_length1;
949                                                         _tmp40_ = hash_val;
950                                                         _tmp41_ = node;
951                                                         node = NULL;
952                                                         _gee_hash_set_node_free0 (_tmp39_[_tmp40_]);
953                                                         _tmp39_[_tmp40_] = _tmp41_;
954                                                         _tmp42_ = _tmp39_[_tmp40_];
955                                                 }
956                                         }
957                                         _gee_hash_set_node_free0 (next);
958                                         _gee_hash_set_node_free0 (node);
959                                 }
960                         }
961                 }
962                 _tmp43_ = new_nodes;
963                 _tmp43__length1 = new_nodes_length1;
964                 new_nodes = NULL;
965                 self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
966                 self->priv->_nodes = _tmp43_;
967                 self->priv->_nodes_length1 = _tmp43__length1;
968                 self->priv->__nodes_size_ = self->priv->_nodes_length1;
969                 _tmp44_ = new_array_size;
970                 self->priv->_array_size = _tmp44_;
971                 new_nodes = (_vala_array_free (new_nodes, new_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
972         }
973 }
974
975
976 static gint gee_hash_set_real_get_size (GeeAbstractCollection* base) {
977         gint result;
978         GeeHashSet* self;
979         gint _tmp0_;
980         self = (GeeHashSet*) base;
981         _tmp0_ = self->priv->_nnodes;
982         result = _tmp0_;
983         return result;
984 }
985
986
987 static gboolean gee_hash_set_real_get_read_only (GeeAbstractCollection* base) {
988         gboolean result;
989         GeeHashSet* self;
990         self = (GeeHashSet*) base;
991         result = FALSE;
992         return result;
993 }
994
995
996 GeeHashDataFunc gee_hash_set_get_hash_func (GeeHashSet* self, gpointer* result_target) {
997         GeeHashDataFunc result;
998         GeeHashDataFunc _tmp0_;
999         void* _tmp0__target;
1000         GeeHashDataFunc _tmp1_;
1001         void* _tmp1__target;
1002         g_return_val_if_fail (self != NULL, NULL);
1003         _tmp0_ = self->priv->_hash_func;
1004         _tmp0__target = self->priv->_hash_func_target;
1005         _tmp1_ = _tmp0_;
1006         _tmp1__target = _tmp0__target;
1007         *result_target = _tmp1__target;
1008         result = _tmp1_;
1009         return result;
1010 }
1011
1012
1013 static void gee_hash_set_set_hash_func (GeeHashSet* self, GeeHashDataFunc value, gpointer value_target) {
1014         GeeHashDataFunc _tmp0_;
1015         void* _tmp0__target;
1016         g_return_if_fail (self != NULL);
1017         _tmp0_ = value;
1018         _tmp0__target = value_target;
1019         (self->priv->_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_hash_func_target_destroy_notify (self->priv->_hash_func_target), NULL);
1020         self->priv->_hash_func = NULL;
1021         self->priv->_hash_func_target = NULL;
1022         self->priv->_hash_func_target_destroy_notify = NULL;
1023         self->priv->_hash_func = _tmp0_;
1024         self->priv->_hash_func_target = _tmp0__target;
1025         self->priv->_hash_func_target_destroy_notify = NULL;
1026 }
1027
1028
1029 GeeEqualDataFunc gee_hash_set_get_equal_func (GeeHashSet* self, gpointer* result_target) {
1030         GeeEqualDataFunc result;
1031         GeeEqualDataFunc _tmp0_;
1032         void* _tmp0__target;
1033         GeeEqualDataFunc _tmp1_;
1034         void* _tmp1__target;
1035         g_return_val_if_fail (self != NULL, NULL);
1036         _tmp0_ = self->priv->_equal_func;
1037         _tmp0__target = self->priv->_equal_func_target;
1038         _tmp1_ = _tmp0_;
1039         _tmp1__target = _tmp0__target;
1040         *result_target = _tmp1__target;
1041         result = _tmp1_;
1042         return result;
1043 }
1044
1045
1046 static void gee_hash_set_set_equal_func (GeeHashSet* self, GeeEqualDataFunc value, gpointer value_target) {
1047         GeeEqualDataFunc _tmp0_;
1048         void* _tmp0__target;
1049         g_return_if_fail (self != NULL);
1050         _tmp0_ = value;
1051         _tmp0__target = value_target;
1052         (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL);
1053         self->priv->_equal_func = NULL;
1054         self->priv->_equal_func_target = NULL;
1055         self->priv->_equal_func_target_destroy_notify = NULL;
1056         self->priv->_equal_func = _tmp0_;
1057         self->priv->_equal_func_target = _tmp0__target;
1058         self->priv->_equal_func_target_destroy_notify = NULL;
1059 }
1060
1061
1062 static GeeHashSetNode* gee_hash_set_node_new (gpointer k, guint hash) {
1063         GeeHashSetNode* self;
1064         gpointer _tmp0_;
1065         guint _tmp1_;
1066         self = g_slice_new0 (GeeHashSetNode);
1067         gee_hash_set_node_instance_init (self);
1068         _tmp0_ = k;
1069         k = NULL;
1070         self->key = _tmp0_;
1071         _tmp1_ = hash;
1072         self->key_hash = _tmp1_;
1073         return self;
1074 }
1075
1076
1077 static void gee_hash_set_node_instance_init (GeeHashSetNode * self) {
1078 }
1079
1080
1081 static void gee_hash_set_node_free (GeeHashSetNode* self) {
1082         _gee_hash_set_node_free0 (self->next);
1083         g_slice_free (GeeHashSetNode, self);
1084 }
1085
1086
1087 static gpointer _g_object_ref0 (gpointer self) {
1088         return self ? g_object_ref (self) : NULL;
1089 }
1090
1091
1092 static GeeHashSetIterator* gee_hash_set_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashSet* set) {
1093         GeeHashSetIterator * self = NULL;
1094         GeeHashSet* _tmp0_;
1095         GeeHashSet* _tmp1_;
1096         GeeHashSet* _tmp2_;
1097         gint _tmp3_;
1098         g_return_val_if_fail (set != NULL, NULL);
1099         self = (GeeHashSetIterator*) g_object_new (object_type, NULL);
1100         self->priv->g_type = g_type;
1101         self->priv->g_dup_func = g_dup_func;
1102         self->priv->g_destroy_func = g_destroy_func;
1103         _tmp0_ = set;
1104         _tmp1_ = _g_object_ref0 (_tmp0_);
1105         _g_object_unref0 (self->priv->_set);
1106         self->priv->_set = _tmp1_;
1107         _tmp2_ = self->priv->_set;
1108         _tmp3_ = _tmp2_->priv->_stamp;
1109         self->priv->_stamp = _tmp3_;
1110         return self;
1111 }
1112
1113
1114 static GeeHashSetIterator* gee_hash_set_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeHashSet* set) {
1115         return gee_hash_set_iterator_construct (GEE_HASH_SET_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, set);
1116 }
1117
1118
1119 static gboolean gee_hash_set_iterator_real_next (GeeIterator* base) {
1120         GeeHashSetIterator * self;
1121         gboolean result = FALSE;
1122         gint _tmp0_;
1123         GeeHashSet* _tmp1_;
1124         gint _tmp2_;
1125         gboolean _tmp3_ = FALSE;
1126         GeeHashSetNode* _tmp4_;
1127         GeeHashSetNode* _tmp5_;
1128         self = (GeeHashSetIterator*) base;
1129         _tmp0_ = self->priv->_stamp;
1130         _tmp1_ = self->priv->_set;
1131         _tmp2_ = _tmp1_->priv->_stamp;
1132         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp");
1133         _tmp3_ = gee_iterator_has_next ((GeeIterator*) self);
1134         if (!_tmp3_) {
1135                 result = FALSE;
1136                 return result;
1137         }
1138         _tmp4_ = self->priv->_next;
1139         self->priv->_node = _tmp4_;
1140         self->priv->_next = NULL;
1141         _tmp5_ = self->priv->_node;
1142         result = _tmp5_ != NULL;
1143         return result;
1144 }
1145
1146
1147 static gboolean gee_hash_set_iterator_real_has_next (GeeIterator* base) {
1148         GeeHashSetIterator * self;
1149         gboolean result = FALSE;
1150         gint _tmp0_;
1151         GeeHashSet* _tmp1_;
1152         gint _tmp2_;
1153         GeeHashSetNode* _tmp3_;
1154         GeeHashSetNode* _tmp19_;
1155         self = (GeeHashSetIterator*) base;
1156         _tmp0_ = self->priv->_stamp;
1157         _tmp1_ = self->priv->_set;
1158         _tmp2_ = _tmp1_->priv->_stamp;
1159         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp");
1160         _tmp3_ = self->priv->_next;
1161         if (_tmp3_ == NULL) {
1162                 GeeHashSetNode* _tmp4_;
1163                 GeeHashSetNode* _tmp5_;
1164                 _tmp4_ = self->priv->_node;
1165                 self->priv->_next = _tmp4_;
1166                 _tmp5_ = self->priv->_next;
1167                 if (_tmp5_ != NULL) {
1168                         GeeHashSetNode* _tmp6_;
1169                         GeeHashSetNode* _tmp7_;
1170                         _tmp6_ = self->priv->_next;
1171                         _tmp7_ = _tmp6_->next;
1172                         self->priv->_next = _tmp7_;
1173                 }
1174                 while (TRUE) {
1175                         gboolean _tmp8_ = FALSE;
1176                         GeeHashSetNode* _tmp9_;
1177                         gboolean _tmp13_;
1178                         gint _tmp14_;
1179                         GeeHashSet* _tmp15_;
1180                         GeeHashSetNode** _tmp16_;
1181                         gint _tmp16__length1;
1182                         gint _tmp17_;
1183                         GeeHashSetNode* _tmp18_;
1184                         _tmp9_ = self->priv->_next;
1185                         if (_tmp9_ == NULL) {
1186                                 gint _tmp10_;
1187                                 GeeHashSet* _tmp11_;
1188                                 gint _tmp12_;
1189                                 _tmp10_ = self->priv->_index;
1190                                 _tmp11_ = self->priv->_set;
1191                                 _tmp12_ = _tmp11_->priv->_array_size;
1192                                 _tmp8_ = (_tmp10_ + 1) < _tmp12_;
1193                         } else {
1194                                 _tmp8_ = FALSE;
1195                         }
1196                         _tmp13_ = _tmp8_;
1197                         if (!_tmp13_) {
1198                                 break;
1199                         }
1200                         _tmp14_ = self->priv->_index;
1201                         self->priv->_index = _tmp14_ + 1;
1202                         _tmp15_ = self->priv->_set;
1203                         _tmp16_ = _tmp15_->priv->_nodes;
1204                         _tmp16__length1 = _tmp15_->priv->_nodes_length1;
1205                         _tmp17_ = self->priv->_index;
1206                         _tmp18_ = _tmp16_[_tmp17_];
1207                         self->priv->_next = _tmp18_;
1208                 }
1209         }
1210         _tmp19_ = self->priv->_next;
1211         result = _tmp19_ != NULL;
1212         return result;
1213 }
1214
1215
1216 static gpointer gee_hash_set_iterator_real_get (GeeIterator* base) {
1217         GeeHashSetIterator * self;
1218         gpointer result = NULL;
1219         gint _tmp0_;
1220         GeeHashSet* _tmp1_;
1221         gint _tmp2_;
1222         GeeHashSetNode* _tmp3_;
1223         GeeHashSetNode* _tmp4_;
1224         gconstpointer _tmp5_;
1225         gpointer _tmp6_;
1226         self = (GeeHashSetIterator*) base;
1227         _tmp0_ = self->priv->_stamp;
1228         _tmp1_ = self->priv->_set;
1229         _tmp2_ = _tmp1_->priv->_stamp;
1230         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp");
1231         _tmp3_ = self->priv->_node;
1232         _vala_assert (_tmp3_ != NULL, "_node != null");
1233         _tmp4_ = self->priv->_node;
1234         _tmp5_ = _tmp4_->key;
1235         _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
1236         result = _tmp6_;
1237         return result;
1238 }
1239
1240
1241 static void gee_hash_set_iterator_real_remove (GeeIterator* base) {
1242         GeeHashSetIterator * self;
1243         gint _tmp0_;
1244         GeeHashSet* _tmp1_;
1245         gint _tmp2_;
1246         GeeHashSetNode* _tmp3_;
1247         GeeHashSet* _tmp4_;
1248         GeeHashSetNode* _tmp5_;
1249         gconstpointer _tmp6_;
1250         GeeHashSet* _tmp7_;
1251         gint _tmp8_;
1252         self = (GeeHashSetIterator*) base;
1253         _tmp0_ = self->priv->_stamp;
1254         _tmp1_ = self->priv->_set;
1255         _tmp2_ = _tmp1_->priv->_stamp;
1256         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp");
1257         _tmp3_ = self->priv->_node;
1258         _vala_assert (_tmp3_ != NULL, "_node != null");
1259         gee_iterator_has_next ((GeeIterator*) self);
1260         _tmp4_ = self->priv->_set;
1261         _tmp5_ = self->priv->_node;
1262         _tmp6_ = _tmp5_->key;
1263         gee_hash_set_remove_helper (_tmp4_, _tmp6_);
1264         self->priv->_node = NULL;
1265         _tmp7_ = self->priv->_set;
1266         _tmp8_ = _tmp7_->priv->_stamp;
1267         self->priv->_stamp = _tmp8_;
1268 }
1269
1270
1271 static gboolean gee_hash_set_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
1272         GeeHashSetIterator * self;
1273         gboolean result = FALSE;
1274         gint _tmp0_;
1275         GeeHashSet* _tmp1_;
1276         gint _tmp2_;
1277         GeeHashSetNode* _tmp3_;
1278         self = (GeeHashSetIterator*) base;
1279         _tmp0_ = self->priv->_stamp;
1280         _tmp1_ = self->priv->_set;
1281         _tmp2_ = _tmp1_->priv->_stamp;
1282         _vala_assert (_tmp0_ == _tmp2_, "_stamp == _set._stamp");
1283         _tmp3_ = self->priv->_node;
1284         if (_tmp3_ != NULL) {
1285                 GeeForallFunc _tmp4_;
1286                 void* _tmp4__target;
1287                 GeeHashSetNode* _tmp5_;
1288                 gconstpointer _tmp6_;
1289                 gpointer _tmp7_;
1290                 gboolean _tmp8_ = FALSE;
1291                 _tmp4_ = f;
1292                 _tmp4__target = f_target;
1293                 _tmp5_ = self->priv->_node;
1294                 _tmp6_ = _tmp5_->key;
1295                 _tmp7_ = ((_tmp6_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp6_) : ((gpointer) _tmp6_);
1296                 _tmp8_ = _tmp4_ (_tmp7_, _tmp4__target);
1297                 if (!_tmp8_) {
1298                         result = FALSE;
1299                         return result;
1300                 }
1301         }
1302         while (TRUE) {
1303                 gboolean _tmp9_ = FALSE;
1304                 gint _tmp10_;
1305                 GeeHashSet* _tmp11_;
1306                 gint _tmp12_;
1307                 gboolean _tmp14_;
1308                 GeeHashSetNode* _tmp15_;
1309                 _tmp10_ = self->priv->_index;
1310                 _tmp11_ = self->priv->_set;
1311                 _tmp12_ = _tmp11_->priv->_array_size;
1312                 if ((_tmp10_ + 1) < _tmp12_) {
1313                         _tmp9_ = TRUE;
1314                 } else {
1315                         GeeHashSetNode* _tmp13_;
1316                         _tmp13_ = self->priv->_next;
1317                         _tmp9_ = _tmp13_ != NULL;
1318                 }
1319                 _tmp14_ = _tmp9_;
1320                 if (!_tmp14_) {
1321                         break;
1322                 }
1323                 _tmp15_ = self->priv->_next;
1324                 if (_tmp15_ != NULL) {
1325                         GeeHashSetNode* _tmp16_;
1326                         GeeForallFunc _tmp17_;
1327                         void* _tmp17__target;
1328                         GeeHashSetNode* _tmp18_;
1329                         gconstpointer _tmp19_;
1330                         gpointer _tmp20_;
1331                         gboolean _tmp21_ = FALSE;
1332                         GeeHashSetNode* _tmp22_;
1333                         GeeHashSetNode* _tmp23_;
1334                         _tmp16_ = self->priv->_next;
1335                         self->priv->_node = _tmp16_;
1336                         _tmp17_ = f;
1337                         _tmp17__target = f_target;
1338                         _tmp18_ = self->priv->_node;
1339                         _tmp19_ = _tmp18_->key;
1340                         _tmp20_ = ((_tmp19_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp19_) : ((gpointer) _tmp19_);
1341                         _tmp21_ = _tmp17_ (_tmp20_, _tmp17__target);
1342                         if (!_tmp21_) {
1343                                 result = FALSE;
1344                                 return result;
1345                         }
1346                         _tmp22_ = self->priv->_node;
1347                         _tmp23_ = _tmp22_->next;
1348                         self->priv->_next = _tmp23_;
1349                 } else {
1350                         gint _tmp24_;
1351                         GeeHashSet* _tmp25_;
1352                         GeeHashSetNode** _tmp26_;
1353                         gint _tmp26__length1;
1354                         gint _tmp27_;
1355                         GeeHashSetNode* _tmp28_;
1356                         _tmp24_ = self->priv->_index;
1357                         self->priv->_index = _tmp24_ + 1;
1358                         _tmp25_ = self->priv->_set;
1359                         _tmp26_ = _tmp25_->priv->_nodes;
1360                         _tmp26__length1 = _tmp25_->priv->_nodes_length1;
1361                         _tmp27_ = self->priv->_index;
1362                         _tmp28_ = _tmp26_[_tmp27_];
1363                         self->priv->_next = _tmp28_;
1364                 }
1365         }
1366         result = FALSE;
1367         return result;
1368 }
1369
1370
1371 static gboolean gee_hash_set_iterator_real_get_read_only (GeeIterator* base) {
1372         gboolean result;
1373         GeeHashSetIterator* self;
1374         self = (GeeHashSetIterator*) base;
1375         result = FALSE;
1376         return result;
1377 }
1378
1379
1380 static gboolean gee_hash_set_iterator_real_get_valid (GeeIterator* base) {
1381         gboolean result;
1382         GeeHashSetIterator* self;
1383         GeeHashSetNode* _tmp0_;
1384         self = (GeeHashSetIterator*) base;
1385         _tmp0_ = self->priv->_node;
1386         result = _tmp0_ != NULL;
1387         return result;
1388 }
1389
1390
1391 static void gee_hash_set_iterator_class_init (GeeHashSetIteratorClass * klass) {
1392         gee_hash_set_iterator_parent_class = g_type_class_peek_parent (klass);
1393         g_type_class_add_private (klass, sizeof (GeeHashSetIteratorPrivate));
1394         G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_set_iterator_get_property;
1395         G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_set_iterator_set_property;
1396         G_OBJECT_CLASS (klass)->finalize = gee_hash_set_iterator_finalize;
1397         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1398         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1399         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1400         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1401         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_ITERATOR_VALID, g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1402 }
1403
1404
1405 static GType gee_hash_set_iterator_gee_traversable_get_g_type (GeeHashSetIterator* self) {
1406         return self->priv->g_type;
1407 }
1408
1409
1410 static GBoxedCopyFunc gee_hash_set_iterator_gee_traversable_get_g_dup_func (GeeHashSetIterator* self) {
1411         return self->priv->g_dup_func;
1412 }
1413
1414
1415 static GDestroyNotify gee_hash_set_iterator_gee_traversable_get_g_destroy_func (GeeHashSetIterator* self) {
1416         return self->priv->g_destroy_func;
1417 }
1418
1419
1420 static void gee_hash_set_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
1421         gee_hash_set_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
1422         iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_hash_set_iterator_real_foreach;
1423         iface->get_g_type = (GType(*)(GeeTraversable*)) gee_hash_set_iterator_gee_traversable_get_g_type;
1424         iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_hash_set_iterator_gee_traversable_get_g_dup_func;
1425         iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_hash_set_iterator_gee_traversable_get_g_destroy_func;
1426 }
1427
1428
1429 static void gee_hash_set_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
1430         gee_hash_set_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
1431         iface->next = (gboolean (*)(GeeIterator*)) gee_hash_set_iterator_real_next;
1432         iface->has_next = (gboolean (*)(GeeIterator*)) gee_hash_set_iterator_real_has_next;
1433         iface->get = (gpointer (*)(GeeIterator*)) gee_hash_set_iterator_real_get;
1434         iface->remove = (void (*)(GeeIterator*)) gee_hash_set_iterator_real_remove;
1435         iface->get_read_only = gee_hash_set_iterator_real_get_read_only;
1436         iface->get_valid = gee_hash_set_iterator_real_get_valid;
1437 }
1438
1439
1440 static void gee_hash_set_iterator_instance_init (GeeHashSetIterator * self) {
1441         self->priv = GEE_HASH_SET_ITERATOR_GET_PRIVATE (self);
1442         self->priv->_index = -1;
1443         self->priv->_stamp = 0;
1444 }
1445
1446
1447 static void gee_hash_set_iterator_finalize (GObject* obj) {
1448         GeeHashSetIterator * self;
1449         self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator);
1450         _g_object_unref0 (self->priv->_set);
1451         G_OBJECT_CLASS (gee_hash_set_iterator_parent_class)->finalize (obj);
1452 }
1453
1454
1455 static GType gee_hash_set_iterator_get_type (void) {
1456         static volatile gsize gee_hash_set_iterator_type_id__volatile = 0;
1457         if (g_once_init_enter (&gee_hash_set_iterator_type_id__volatile)) {
1458                 static const GTypeInfo g_define_type_info = { sizeof (GeeHashSetIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_set_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashSetIterator), 0, (GInstanceInitFunc) gee_hash_set_iterator_instance_init, NULL };
1459                 static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_hash_set_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1460                 static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_hash_set_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1461                 GType gee_hash_set_iterator_type_id;
1462                 gee_hash_set_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeHashSetIterator", &g_define_type_info, 0);
1463                 g_type_add_interface_static (gee_hash_set_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
1464                 g_type_add_interface_static (gee_hash_set_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
1465                 g_once_init_leave (&gee_hash_set_iterator_type_id__volatile, gee_hash_set_iterator_type_id);
1466         }
1467         return gee_hash_set_iterator_type_id__volatile;
1468 }
1469
1470
1471 static void _vala_gee_hash_set_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
1472         GeeHashSetIterator * self;
1473         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator);
1474         switch (property_id) {
1475                 case GEE_HASH_SET_ITERATOR_READ_ONLY:
1476                 g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
1477                 break;
1478                 case GEE_HASH_SET_ITERATOR_VALID:
1479                 g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
1480                 break;
1481                 default:
1482                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1483                 break;
1484         }
1485 }
1486
1487
1488 static void _vala_gee_hash_set_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
1489         GeeHashSetIterator * self;
1490         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_HASH_SET_TYPE_ITERATOR, GeeHashSetIterator);
1491         switch (property_id) {
1492                 case GEE_HASH_SET_ITERATOR_G_TYPE:
1493                 self->priv->g_type = g_value_get_gtype (value);
1494                 break;
1495                 case GEE_HASH_SET_ITERATOR_G_DUP_FUNC:
1496                 self->priv->g_dup_func = g_value_get_pointer (value);
1497                 break;
1498                 case GEE_HASH_SET_ITERATOR_G_DESTROY_FUNC:
1499                 self->priv->g_destroy_func = g_value_get_pointer (value);
1500                 break;
1501                 default:
1502                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1503                 break;
1504         }
1505 }
1506
1507
1508 static void gee_hash_set_class_init (GeeHashSetClass * klass) {
1509         gee_hash_set_parent_class = g_type_class_peek_parent (klass);
1510         g_type_class_add_private (klass, sizeof (GeeHashSetPrivate));
1511         GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_hash_set_real_contains;
1512         GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_hash_set_real_iterator;
1513         GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_hash_set_real_add;
1514         GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_hash_set_real_remove;
1515         GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_hash_set_real_clear;
1516         GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_hash_set_real_get_size;
1517         GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_hash_set_real_get_read_only;
1518         G_OBJECT_CLASS (klass)->get_property = _vala_gee_hash_set_get_property;
1519         G_OBJECT_CLASS (klass)->set_property = _vala_gee_hash_set_set_property;
1520         G_OBJECT_CLASS (klass)->finalize = gee_hash_set_finalize;
1521         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1522         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1523         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
1524         /**
1525          * {@inheritDoc}
1526          */
1527         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1528         /**
1529          * {@inheritDoc}
1530          */
1531         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_HASH_SET_READ_ONLY, g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1532 }
1533
1534
1535 static void gee_hash_set_instance_init (GeeHashSet * self) {
1536         self->priv = GEE_HASH_SET_GET_PRIVATE (self);
1537         self->priv->_stamp = 0;
1538 }
1539
1540
1541 static void gee_hash_set_finalize (GObject* obj) {
1542         GeeHashSet * self;
1543         self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_HASH_SET, GeeHashSet);
1544         gee_abstract_collection_clear ((GeeAbstractCollection*) self);
1545         (self->priv->_hash_func_target_destroy_notify == NULL) ? NULL : (self->priv->_hash_func_target_destroy_notify (self->priv->_hash_func_target), NULL);
1546         self->priv->_hash_func = NULL;
1547         self->priv->_hash_func_target = NULL;
1548         self->priv->_hash_func_target_destroy_notify = NULL;
1549         (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL);
1550         self->priv->_equal_func = NULL;
1551         self->priv->_equal_func_target = NULL;
1552         self->priv->_equal_func_target_destroy_notify = NULL;
1553         self->priv->_nodes = (_vala_array_free (self->priv->_nodes, self->priv->_nodes_length1, (GDestroyNotify) gee_hash_set_node_free), NULL);
1554         G_OBJECT_CLASS (gee_hash_set_parent_class)->finalize (obj);
1555 }
1556
1557
1558 /**
1559  * Hash table implementation of the {@link Set} interface.
1560  *
1561  * This implementation is better fit for highly heterogenous values.
1562  * In case of high value hashes redundancy or higher amount of data prefer using
1563  * tree implementation like {@link TreeSet}.
1564  *
1565  * @see TreeSet
1566  */
1567 GType gee_hash_set_get_type (void) {
1568         static volatile gsize gee_hash_set_type_id__volatile = 0;
1569         if (g_once_init_enter (&gee_hash_set_type_id__volatile)) {
1570                 static const GTypeInfo g_define_type_info = { sizeof (GeeHashSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_hash_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeHashSet), 0, (GInstanceInitFunc) gee_hash_set_instance_init, NULL };
1571                 GType gee_hash_set_type_id;
1572                 gee_hash_set_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_SET, "GeeHashSet", &g_define_type_info, 0);
1573                 g_once_init_leave (&gee_hash_set_type_id__volatile, gee_hash_set_type_id);
1574         }
1575         return gee_hash_set_type_id__volatile;
1576 }
1577
1578
1579 static void _vala_gee_hash_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
1580         GeeHashSet * self;
1581         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_SET, GeeHashSet);
1582         switch (property_id) {
1583                 case GEE_HASH_SET_SIZE:
1584                 g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
1585                 break;
1586                 case GEE_HASH_SET_READ_ONLY:
1587                 g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
1588                 break;
1589                 default:
1590                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1591                 break;
1592         }
1593 }
1594
1595
1596 static void _vala_gee_hash_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
1597         GeeHashSet * self;
1598         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_HASH_SET, GeeHashSet);
1599         switch (property_id) {
1600                 case GEE_HASH_SET_G_TYPE:
1601                 self->priv->g_type = g_value_get_gtype (value);
1602                 break;
1603                 case GEE_HASH_SET_G_DUP_FUNC:
1604                 self->priv->g_dup_func = g_value_get_pointer (value);
1605                 break;
1606                 case GEE_HASH_SET_G_DESTROY_FUNC:
1607                 self->priv->g_destroy_func = g_value_get_pointer (value);
1608                 break;
1609                 default:
1610                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1611                 break;
1612         }
1613 }
1614
1615
1616 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1617         if ((array != NULL) && (destroy_func != NULL)) {
1618                 int i;
1619                 for (i = 0; i < array_length; i = i + 1) {
1620                         if (((gpointer*) array)[i] != NULL) {
1621                                 destroy_func (((gpointer*) array)[i]);
1622                         }
1623                 }
1624         }
1625 }
1626
1627
1628 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1629         _vala_array_destroy (array, array_length, destroy_func);
1630         g_free (array);
1631 }
1632
1633
1634