1 /* collection.c generated by valac 0.18.0, the Vala compiler
2 * generated from collection.vala, do not modify */
6 * Copyright (C) 2007-2009 Jürg Billeter
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * Jürg Billeter <j@bitron.ch>
27 #include <glib-object.h>
33 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
34 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
35 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
36 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
38 typedef struct _GeeTraversable GeeTraversable;
39 typedef struct _GeeTraversableIface GeeTraversableIface;
41 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
43 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
44 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
45 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
46 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
47 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
48 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
50 typedef struct _GeeLazy GeeLazy;
51 typedef struct _GeeLazyClass GeeLazyClass;
53 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
54 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
55 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
56 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
58 typedef struct _GeeIterator GeeIterator;
59 typedef struct _GeeIteratorIface GeeIteratorIface;
61 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
62 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
63 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
64 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
66 typedef struct _GeeIterable GeeIterable;
67 typedef struct _GeeIterableIface GeeIterableIface;
69 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
70 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
71 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
72 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
74 typedef struct _GeeCollection GeeCollection;
75 typedef struct _GeeCollectionIface GeeCollectionIface;
76 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
77 #define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
79 #define GEE_TYPE_ABSTRACT_COLLECTION (gee_abstract_collection_get_type ())
80 #define GEE_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection))
81 #define GEE_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
82 #define GEE_IS_ABSTRACT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_COLLECTION))
83 #define GEE_IS_ABSTRACT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_COLLECTION))
84 #define GEE_ABSTRACT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollectionClass))
86 typedef struct _GeeAbstractCollection GeeAbstractCollection;
87 typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass;
89 #define GEE_TYPE_ABSTRACT_SET (gee_abstract_set_get_type ())
90 #define GEE_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSet))
91 #define GEE_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
92 #define GEE_IS_ABSTRACT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_SET))
93 #define GEE_IS_ABSTRACT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_SET))
94 #define GEE_ABSTRACT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_SET, GeeAbstractSetClass))
96 typedef struct _GeeAbstractSet GeeAbstractSet;
97 typedef struct _GeeAbstractSetClass GeeAbstractSetClass;
99 #define GEE_TYPE_HASH_SET (gee_hash_set_get_type ())
100 #define GEE_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_HASH_SET, GeeHashSet))
101 #define GEE_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_HASH_SET, GeeHashSetClass))
102 #define GEE_IS_HASH_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_HASH_SET))
103 #define GEE_IS_HASH_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_HASH_SET))
104 #define GEE_HASH_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_HASH_SET, GeeHashSetClass))
106 typedef struct _GeeHashSet GeeHashSet;
107 typedef struct _GeeHashSetClass GeeHashSetClass;
109 #define GEE_TYPE_SET (gee_set_get_type ())
110 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
111 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
112 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
114 typedef struct _GeeSet GeeSet;
115 typedef struct _GeeSetIface GeeSetIface;
117 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
119 GEE_TRAVERSABLE_STREAM_YIELD,
120 GEE_TRAVERSABLE_STREAM_CONTINUE,
121 GEE_TRAVERSABLE_STREAM_END
122 } GeeTraversableStream;
124 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
125 struct _GeeIteratorIface {
126 GTypeInterface parent_iface;
127 gboolean (*next) (GeeIterator* self);
128 gboolean (*has_next) (GeeIterator* self);
129 gpointer (*get) (GeeIterator* self);
130 void (*remove) (GeeIterator* self);
131 gboolean (*get_valid) (GeeIterator* self);
132 gboolean (*get_read_only) (GeeIterator* self);
135 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
136 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
137 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
138 struct _GeeTraversableIface {
139 GTypeInterface parent_iface;
140 GType (*get_g_type) (GeeTraversable* self);
141 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
142 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
143 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
144 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);
145 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
146 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
147 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
148 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
149 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
150 GType (*get_element_type) (GeeTraversable* self);
153 struct _GeeIterableIface {
154 GTypeInterface parent_iface;
155 GType (*get_g_type) (GeeIterable* self);
156 GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
157 GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
158 GeeIterator* (*iterator) (GeeIterable* self);
161 struct _GeeCollectionIface {
162 GTypeInterface parent_iface;
163 GType (*get_g_type) (GeeCollection* self);
164 GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
165 GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
166 gboolean (*contains) (GeeCollection* self, gconstpointer item);
167 gboolean (*add) (GeeCollection* self, gconstpointer item);
168 gboolean (*remove) (GeeCollection* self, gconstpointer item);
169 void (*clear) (GeeCollection* self);
170 gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
171 gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
172 gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
173 gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
174 gpointer* (*to_array) (GeeCollection* self, int* result_length1);
175 gint (*get_size) (GeeCollection* self);
176 gboolean (*get_is_empty) (GeeCollection* self);
177 gboolean (*get_read_only) (GeeCollection* self);
178 GeeCollection* (*get_read_only_view) (GeeCollection* self);
181 typedef guint (*GeeHashDataFunc) (gconstpointer v, void* user_data);
182 typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data);
183 struct _GeeSetIface {
184 GTypeInterface parent_iface;
185 GType (*get_g_type) (GeeSet* self);
186 GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
187 GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
188 GeeSet* (*get_read_only_view) (GeeSet* self);
193 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
194 gpointer gee_lazy_ref (gpointer instance);
195 void gee_lazy_unref (gpointer instance);
196 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
197 void gee_value_set_lazy (GValue* value, gpointer v_object);
198 void gee_value_take_lazy (GValue* value, gpointer v_object);
199 gpointer gee_value_get_lazy (const GValue* value);
200 GType gee_lazy_get_type (void) G_GNUC_CONST;
201 GType gee_iterator_get_type (void) G_GNUC_CONST;
202 GType gee_traversable_get_type (void) G_GNUC_CONST;
203 GType gee_iterable_get_type (void) G_GNUC_CONST;
204 GType gee_collection_get_type (void) G_GNUC_CONST;
205 gboolean gee_collection_contains (GeeCollection* self, gconstpointer item);
206 gboolean gee_collection_add (GeeCollection* self, gconstpointer item);
207 gboolean gee_collection_remove (GeeCollection* self, gconstpointer item);
208 void gee_collection_clear (GeeCollection* self);
209 gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection);
210 static gboolean gee_collection_real_add_all (GeeCollection* self, GeeCollection* collection);
211 gpointer gee_traversable_fold (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
212 static gboolean __lambda15_ (GeeCollection* self, gpointer item, gboolean changed);
213 static gpointer ___lambda15__gee_fold_func (gpointer g, gpointer a, gpointer self);
214 gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection);
215 static gboolean gee_collection_real_contains_all (GeeCollection* self, GeeCollection* collection);
216 gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target);
217 static gboolean __lambda16_ (GeeCollection* self, gpointer item);
218 static gboolean ___lambda16__gee_forall_func (gpointer g, gpointer self);
219 gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection);
220 static gboolean gee_collection_real_remove_all (GeeCollection* self, GeeCollection* collection);
221 static gboolean __lambda17_ (GeeCollection* self, gpointer item, gboolean changed);
222 static gpointer ___lambda17__gee_fold_func (gpointer g, gpointer a, gpointer self);
223 gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection);
224 static gboolean gee_collection_real_retain_all (GeeCollection* self, GeeCollection* collection);
225 GeeIterator* gee_iterable_iterator (GeeIterable* self);
226 gboolean gee_iterator_next (GeeIterator* self);
227 gpointer gee_iterator_get (GeeIterator* self);
228 void gee_iterator_remove (GeeIterator* self);
229 gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1);
230 static gpointer* gee_collection_real_to_array (GeeCollection* self, int* result_length1);
231 static gboolean* gee_collection_to_bool_array (GeeCollection* coll, int* result_length1);
232 static gchar* gee_collection_to_char_array (GeeCollection* coll, int* result_length1);
233 static guchar* gee_collection_to_uchar_array (GeeCollection* coll, int* result_length1);
234 static gint* gee_collection_to_int_array (GeeCollection* coll, int* result_length1);
235 static guint* gee_collection_to_uint_array (GeeCollection* coll, int* result_length1);
236 static gint64* gee_collection_to_int64_array (GeeCollection* coll, int* result_length1);
237 static guint64* gee_collection_to_uint64_array (GeeCollection* coll, int* result_length1);
238 static glong* gee_collection_to_long_array (GeeCollection* coll, int* result_length1);
239 static gulong* gee_collection_to_ulong_array (GeeCollection* coll, int* result_length1);
240 static gfloat** gee_collection_to_float_array (GeeCollection* coll, int* result_length1);
241 static gdouble** gee_collection_to_double_array (GeeCollection* coll, int* result_length1);
242 gint gee_collection_get_size (GeeCollection* self);
243 gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1);
244 gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1);
245 gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1);
246 static gfloat* _float_dup (gfloat* self);
247 static gdouble* _double_dup (gdouble* self);
248 GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
249 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);
250 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);
251 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
252 GType gee_abstract_set_get_type (void) G_GNUC_CONST;
253 GType gee_hash_set_get_type (void) G_GNUC_CONST;
254 GType gee_set_get_type (void) G_GNUC_CONST;
255 GeeSet* gee_abstract_set_get_read_only_view (GeeAbstractSet* self);
256 gboolean gee_collection_get_is_empty (GeeCollection* self);
257 gboolean gee_collection_get_read_only (GeeCollection* self);
258 GeeCollection* gee_collection_get_read_only_view (GeeCollection* self);
259 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
260 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
264 * Determines whether this collection contains the specified item.
266 * @param item the item to locate in the collection
268 * @return ``true`` if item is found, ``false`` otherwise
270 gboolean gee_collection_contains (GeeCollection* self, gconstpointer item) {
271 g_return_val_if_fail (self != NULL, FALSE);
272 return GEE_COLLECTION_GET_INTERFACE (self)->contains (self, item);
277 * Adds an item to this collection. Must not be called on read-only
280 * @param item the item to add to the collection
282 * @return ``true`` if the collection has been changed, ``false`` otherwise
284 gboolean gee_collection_add (GeeCollection* self, gconstpointer item) {
285 g_return_val_if_fail (self != NULL, FALSE);
286 return GEE_COLLECTION_GET_INTERFACE (self)->add (self, item);
291 * Removes the first occurence of an item from this collection. Must not
292 * be called on read-only collections.
294 * @param item the item to remove from the collection
296 * @return ``true`` if the collection has been changed, ``false`` otherwise
298 gboolean gee_collection_remove (GeeCollection* self, gconstpointer item) {
299 g_return_val_if_fail (self != NULL, FALSE);
300 return GEE_COLLECTION_GET_INTERFACE (self)->remove (self, item);
305 * Removes all items from this collection. Must not be called on
306 * read-only collections.
308 void gee_collection_clear (GeeCollection* self) {
309 g_return_if_fail (self != NULL);
310 GEE_COLLECTION_GET_INTERFACE (self)->clear (self);
315 * Adds all items in the input collection to this collection.
317 * @param collection the collection which items will be added to this
320 * @return ``true`` if the collection has been changed, ``false`` otherwise
322 static gboolean __lambda15_ (GeeCollection* self, gpointer item, gboolean changed) {
323 gboolean result = FALSE;
325 gconstpointer _tmp1_;
326 gboolean _tmp2_ = FALSE;
329 _tmp2_ = gee_collection_add (self, _tmp1_);
330 result = _tmp0_ | _tmp2_;
331 ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
336 static gpointer ___lambda15__gee_fold_func (gpointer g, gpointer a, gpointer self) {
338 result = __lambda15_ (self, g, a);
343 static gboolean gee_collection_real_add_all (GeeCollection* self, GeeCollection* collection) {
344 gboolean result = FALSE;
345 GeeCollection* _tmp0_;
346 gpointer _tmp1_ = NULL;
347 g_return_val_if_fail (collection != NULL, FALSE);
349 _tmp1_ = gee_traversable_fold ((GeeTraversable*) _tmp0_, G_TYPE_BOOLEAN, NULL, NULL, ___lambda15__gee_fold_func, self, (gpointer) ((gintptr) FALSE));
350 result = (gboolean) ((gintptr) _tmp1_);
355 gboolean gee_collection_add_all (GeeCollection* self, GeeCollection* collection) {
356 g_return_val_if_fail (self != NULL, FALSE);
357 return GEE_COLLECTION_GET_INTERFACE (self)->add_all (self, collection);
362 * Returns ``true`` it this collection contains all items as the input
365 * @param collection the collection which items will be compared with
368 * @return ``true`` if the collection has been changed, ``false`` otherwise
370 static gboolean __lambda16_ (GeeCollection* self, gpointer item) {
371 gboolean result = FALSE;
372 gconstpointer _tmp0_;
373 gboolean _tmp1_ = FALSE;
375 _tmp1_ = gee_collection_contains (self, _tmp0_);
377 ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
382 static gboolean ___lambda16__gee_forall_func (gpointer g, gpointer self) {
384 result = __lambda16_ (self, g);
389 static gboolean gee_collection_real_contains_all (GeeCollection* self, GeeCollection* collection) {
390 gboolean result = FALSE;
391 GeeCollection* _tmp0_;
392 gboolean _tmp1_ = FALSE;
393 g_return_val_if_fail (collection != NULL, FALSE);
395 _tmp1_ = gee_traversable_foreach ((GeeTraversable*) _tmp0_, ___lambda16__gee_forall_func, self);
401 gboolean gee_collection_contains_all (GeeCollection* self, GeeCollection* collection) {
402 g_return_val_if_fail (self != NULL, FALSE);
403 return GEE_COLLECTION_GET_INTERFACE (self)->contains_all (self, collection);
408 * Removes the subset of items in this collection corresponding to the
409 * elments in the input collection. If there is several occurrences of
410 * the same value in this collection they are decremented of the number
411 * of occurrences in the input collection.
413 * @param collection the collection which items will be compared with
416 * @return ``true`` if the collection has been changed, ``false`` otherwise
418 static gboolean __lambda17_ (GeeCollection* self, gpointer item, gboolean changed) {
419 gboolean result = FALSE;
421 gconstpointer _tmp1_;
422 gboolean _tmp2_ = FALSE;
425 _tmp2_ = gee_collection_remove (self, _tmp1_);
426 result = _tmp0_ | _tmp2_;
427 ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
432 static gpointer ___lambda17__gee_fold_func (gpointer g, gpointer a, gpointer self) {
434 result = __lambda17_ (self, g, a);
439 static gboolean gee_collection_real_remove_all (GeeCollection* self, GeeCollection* collection) {
440 gboolean result = FALSE;
441 GeeCollection* _tmp0_;
442 gpointer _tmp1_ = NULL;
443 g_return_val_if_fail (collection != NULL, FALSE);
445 _tmp1_ = gee_traversable_fold ((GeeTraversable*) _tmp0_, G_TYPE_BOOLEAN, NULL, NULL, ___lambda17__gee_fold_func, self, (gpointer) ((gintptr) FALSE));
446 result = (gboolean) ((gintptr) _tmp1_);
451 gboolean gee_collection_remove_all (GeeCollection* self, GeeCollection* collection) {
452 g_return_val_if_fail (self != NULL, FALSE);
453 return GEE_COLLECTION_GET_INTERFACE (self)->remove_all (self, collection);
458 * Removes all items in this collection that are not contained in the input
459 * collection. In other words all common items of both collections are
460 * retained in this collection.
462 * @param collection the collection which items will be compared with
465 * @return ``true`` if the collection has been changed, ``false`` otherwise
467 static gboolean gee_collection_real_retain_all (GeeCollection* self, GeeCollection* collection) {
468 gboolean result = FALSE;
470 g_return_val_if_fail (collection != NULL, FALSE);
473 GeeIterator* _tmp0_ = NULL;
475 _tmp0_ = gee_iterable_iterator ((GeeIterable*) self);
483 gboolean _tmp4_ = FALSE;
485 gpointer _tmp6_ = NULL;
487 GeeCollection* _tmp7_;
488 gconstpointer _tmp8_;
489 gboolean _tmp9_ = FALSE;
495 _tmp4_ = gee_iterator_next (_tmp3_);
500 _tmp6_ = gee_iterator_get (_tmp5_);
504 _tmp9_ = gee_collection_contains (_tmp7_, _tmp8_);
506 GeeIterator* _tmp10_;
508 gee_iterator_remove (_tmp10_);
511 ((item == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (item = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (item), NULL));
514 _g_object_unref0 (iter);
521 gboolean gee_collection_retain_all (GeeCollection* self, GeeCollection* collection) {
522 g_return_val_if_fail (self != NULL, FALSE);
523 return GEE_COLLECTION_GET_INTERFACE (self)->retain_all (self, collection);
528 * Returns an array containing all of items from this collection.
530 * @return an array containing all of items from this collection
532 static gpointer* gee_collection_real_to_array (GeeCollection* self, int* result_length1) {
533 gpointer* result = NULL;
536 t = GEE_COLLECTION_GET_INTERFACE (self)->get_g_type (self);
538 if (_tmp0_ == G_TYPE_BOOLEAN) {
540 gboolean* _tmp2_ = NULL;
543 _tmp2_ = gee_collection_to_bool_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp1_);
544 _tmp3_ = (gpointer*) _tmp2_;
545 _tmp3__length1 = (_tmp1_ * sizeof (gboolean)) / sizeof (gpointer);
546 if (result_length1) {
547 *result_length1 = _tmp3__length1;
554 if (_tmp4_ == G_TYPE_CHAR) {
556 gchar* _tmp6_ = NULL;
559 _tmp6_ = gee_collection_to_char_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp5_);
560 _tmp7_ = (gpointer*) _tmp6_;
561 _tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (gpointer);
562 if (result_length1) {
563 *result_length1 = _tmp7__length1;
570 if (_tmp8_ == G_TYPE_UCHAR) {
572 guchar* _tmp10_ = NULL;
574 gint _tmp11__length1;
575 _tmp10_ = gee_collection_to_uchar_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp9_);
576 _tmp11_ = (gpointer*) _tmp10_;
577 _tmp11__length1 = (_tmp9_ * sizeof (guchar)) / sizeof (gpointer);
578 if (result_length1) {
579 *result_length1 = _tmp11__length1;
586 if (_tmp12_ == G_TYPE_INT) {
588 gint* _tmp14_ = NULL;
590 gint _tmp15__length1;
591 _tmp14_ = gee_collection_to_int_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp13_);
592 _tmp15_ = (gpointer*) _tmp14_;
593 _tmp15__length1 = (_tmp13_ * sizeof (gint)) / sizeof (gpointer);
594 if (result_length1) {
595 *result_length1 = _tmp15__length1;
602 if (_tmp16_ == G_TYPE_UINT) {
604 guint* _tmp18_ = NULL;
606 gint _tmp19__length1;
607 _tmp18_ = gee_collection_to_uint_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp17_);
608 _tmp19_ = (gpointer*) _tmp18_;
609 _tmp19__length1 = (_tmp17_ * sizeof (guint)) / sizeof (gpointer);
610 if (result_length1) {
611 *result_length1 = _tmp19__length1;
618 if (_tmp20_ == G_TYPE_INT64) {
620 gint64* _tmp22_ = NULL;
622 gint _tmp23__length1;
623 _tmp22_ = gee_collection_to_int64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp21_);
624 _tmp23_ = (gpointer*) _tmp22_;
625 _tmp23__length1 = (_tmp21_ * sizeof (gint64)) / sizeof (gpointer);
626 if (result_length1) {
627 *result_length1 = _tmp23__length1;
634 if (_tmp24_ == G_TYPE_UINT64) {
636 guint64* _tmp26_ = NULL;
638 gint _tmp27__length1;
639 _tmp26_ = gee_collection_to_uint64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp25_);
640 _tmp27_ = (gpointer*) _tmp26_;
641 _tmp27__length1 = (_tmp25_ * sizeof (guint64)) / sizeof (gpointer);
642 if (result_length1) {
643 *result_length1 = _tmp27__length1;
650 if (_tmp28_ == G_TYPE_LONG) {
652 glong* _tmp30_ = NULL;
654 gint _tmp31__length1;
655 _tmp30_ = gee_collection_to_long_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp29_);
656 _tmp31_ = (gpointer*) _tmp30_;
657 _tmp31__length1 = (_tmp29_ * sizeof (glong)) / sizeof (gpointer);
658 if (result_length1) {
659 *result_length1 = _tmp31__length1;
666 if (_tmp32_ == G_TYPE_ULONG) {
668 gulong* _tmp34_ = NULL;
670 gint _tmp35__length1;
671 _tmp34_ = gee_collection_to_ulong_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp33_);
672 _tmp35_ = (gpointer*) _tmp34_;
673 _tmp35__length1 = (_tmp33_ * sizeof (gulong)) / sizeof (gpointer);
674 if (result_length1) {
675 *result_length1 = _tmp35__length1;
682 if (_tmp36_ == G_TYPE_FLOAT) {
684 gfloat** _tmp38_ = NULL;
686 gint _tmp39__length1;
687 _tmp38_ = gee_collection_to_float_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp37_);
688 _tmp39_ = (gpointer*) _tmp38_;
689 _tmp39__length1 = (_tmp37_ * sizeof (gfloat*)) / sizeof (gpointer);
690 if (result_length1) {
691 *result_length1 = _tmp39__length1;
698 if (_tmp40_ == G_TYPE_DOUBLE) {
700 gdouble** _tmp42_ = NULL;
702 gint _tmp43__length1;
703 _tmp42_ = gee_collection_to_double_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp41_);
704 _tmp43_ = (gpointer*) _tmp42_;
705 _tmp43__length1 = (_tmp41_ * sizeof (gdouble*)) / sizeof (gpointer);
706 if (result_length1) {
707 *result_length1 = _tmp43__length1;
714 gpointer* _tmp46_ = NULL;
720 gint _tmp57__length1;
721 _tmp44_ = gee_collection_get_size (self);
723 _tmp46_ = g_new0 (gpointer, _tmp45_);
725 array_length1 = _tmp45_;
726 _array_size_ = array_length1;
729 GeeIterator* _tmp47_ = NULL;
730 GeeIterator* _element_it;
731 _tmp47_ = gee_iterable_iterator ((GeeIterable*) self);
732 _element_it = _tmp47_;
734 GeeIterator* _tmp48_;
735 gboolean _tmp49_ = FALSE;
736 GeeIterator* _tmp50_;
737 gpointer _tmp51_ = NULL;
740 gint _tmp52__length1;
742 gconstpointer _tmp54_;
745 _tmp48_ = _element_it;
746 _tmp49_ = gee_iterator_next (_tmp48_);
750 _tmp50_ = _element_it;
751 _tmp51_ = gee_iterator_get (_tmp50_);
754 _tmp52__length1 = array_length1;
758 _tmp55_ = ((_tmp54_ != NULL) && (GEE_COLLECTION_GET_INTERFACE (self)->get_g_dup_func (self) != NULL)) ? GEE_COLLECTION_GET_INTERFACE (self)->get_g_dup_func (self) ((gpointer) _tmp54_) : ((gpointer) _tmp54_);
759 ((_tmp52_[_tmp53_] == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (_tmp52_[_tmp53_] = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (_tmp52_[_tmp53_]), NULL));
760 _tmp52_[_tmp53_] = _tmp55_;
761 _tmp56_ = _tmp52_[_tmp53_];
762 ((element == NULL) || (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) == NULL)) ? NULL : (element = (GEE_COLLECTION_GET_INTERFACE (self)->get_g_destroy_func (self) (element), NULL));
764 _g_object_unref0 (_element_it);
767 _tmp57__length1 = array_length1;
768 if (result_length1) {
769 *result_length1 = _tmp57__length1;
787 gpointer* gee_collection_to_array (GeeCollection* self, int* result_length1) {
788 g_return_val_if_fail (self != NULL, NULL);
789 return GEE_COLLECTION_GET_INTERFACE (self)->to_array (self, result_length1);
794 * Adds all items in the input array to this collection.
796 * @param array the array which items will be added to this
799 * @return ``true`` if the collection has been changed, ``false`` otherwise
801 gboolean gee_collection_add_all_array (GeeCollection* self, gpointer* array, int array_length1) {
802 gboolean result = FALSE;
808 _tmp0__length1 = array_length1;
810 gpointer* item_collection = NULL;
811 gint item_collection_length1 = 0;
812 gint _item_collection_size_ = 0;
814 item_collection = _tmp0_;
815 item_collection_length1 = _tmp0__length1;
816 for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) {
817 gconstpointer item = NULL;
818 item = item_collection[item_it];
821 gconstpointer _tmp2_;
822 gboolean _tmp3_ = FALSE;
825 _tmp3_ = gee_collection_add (self, _tmp2_);
826 changed = _tmp1_ | _tmp3_;
836 * Returns ``true`` it this collection contains all items as the input
839 * @param array the array which items will be compared with
842 * @return ``true`` if the collection has been changed, ``false`` otherwise
844 gboolean gee_collection_contains_all_array (GeeCollection* self, gpointer* array, int array_length1) {
845 gboolean result = FALSE;
849 _tmp0__length1 = array_length1;
851 gpointer* item_collection = NULL;
852 gint item_collection_length1 = 0;
853 gint _item_collection_size_ = 0;
855 item_collection = _tmp0_;
856 item_collection_length1 = _tmp0__length1;
857 for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) {
858 gconstpointer item = NULL;
859 item = item_collection[item_it];
861 gconstpointer _tmp1_;
862 gboolean _tmp2_ = FALSE;
864 _tmp2_ = gee_collection_contains (self, _tmp1_);
878 * Removes the subset of items in this collection corresponding to the
879 * elments in the input array. If there is several occurrences of
880 * the same value in this collection they are decremented of the number
881 * of occurrences in the input array.
883 * @param array the array which items will be compared with
886 * @return ``true`` if the collection has been changed, ``false`` otherwise
888 gboolean gee_collection_remove_all_array (GeeCollection* self, gpointer* array, int array_length1) {
889 gboolean result = FALSE;
895 _tmp0__length1 = array_length1;
897 gpointer* item_collection = NULL;
898 gint item_collection_length1 = 0;
899 gint _item_collection_size_ = 0;
901 item_collection = _tmp0_;
902 item_collection_length1 = _tmp0__length1;
903 for (item_it = 0; item_it < _tmp0__length1; item_it = item_it + 1) {
904 gconstpointer item = NULL;
905 item = item_collection[item_it];
908 gconstpointer _tmp2_;
909 gboolean _tmp3_ = FALSE;
912 _tmp3_ = gee_collection_remove (self, _tmp2_);
913 changed = _tmp1_ | _tmp3_;
922 static gboolean* gee_collection_to_bool_array (GeeCollection* coll, int* result_length1) {
923 gboolean* result = NULL;
924 GeeCollection* _tmp0_;
927 gboolean* _tmp3_ = NULL;
933 gint _tmp14__length1;
934 g_return_val_if_fail (coll != NULL, NULL);
936 _tmp1_ = gee_collection_get_size (_tmp0_);
938 _tmp3_ = g_new0 (gboolean, _tmp2_);
940 array_length1 = _tmp2_;
941 _array_size_ = array_length1;
944 GeeCollection* _tmp4_;
945 GeeIterator* _tmp5_ = NULL;
946 GeeIterator* _element_it;
948 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
949 _element_it = _tmp5_;
952 gboolean _tmp7_ = FALSE;
954 gpointer _tmp9_ = NULL;
957 gint _tmp10__length1;
961 _tmp6_ = _element_it;
962 _tmp7_ = gee_iterator_next (_tmp6_);
966 _tmp8_ = _element_it;
967 _tmp9_ = gee_iterator_get (_tmp8_);
968 element = (gboolean) ((gintptr) _tmp9_);
970 _tmp10__length1 = array_length1;
974 _tmp10_[_tmp11_] = _tmp12_;
975 _tmp13_ = _tmp10_[_tmp11_];
977 _g_object_unref0 (_element_it);
980 _tmp14__length1 = array_length1;
981 if (result_length1) {
982 *result_length1 = _tmp14__length1;
989 static gchar* gee_collection_to_char_array (GeeCollection* coll, int* result_length1) {
990 gchar* result = NULL;
991 GeeCollection* _tmp0_;
994 gchar* _tmp3_ = NULL;
1000 gint _tmp14__length1;
1001 g_return_val_if_fail (coll != NULL, NULL);
1003 _tmp1_ = gee_collection_get_size (_tmp0_);
1005 _tmp3_ = g_new0 (gchar, _tmp2_);
1007 array_length1 = _tmp2_;
1008 _array_size_ = array_length1;
1011 GeeCollection* _tmp4_;
1012 GeeIterator* _tmp5_ = NULL;
1013 GeeIterator* _element_it;
1015 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1016 _element_it = _tmp5_;
1018 GeeIterator* _tmp6_;
1019 gboolean _tmp7_ = FALSE;
1020 GeeIterator* _tmp8_;
1021 gpointer _tmp9_ = NULL;
1024 gint _tmp10__length1;
1028 _tmp6_ = _element_it;
1029 _tmp7_ = gee_iterator_next (_tmp6_);
1033 _tmp8_ = _element_it;
1034 _tmp9_ = gee_iterator_get (_tmp8_);
1035 element = (gchar) ((gintptr) _tmp9_);
1037 _tmp10__length1 = array_length1;
1039 index = _tmp11_ + 1;
1041 _tmp10_[_tmp11_] = _tmp12_;
1042 _tmp13_ = _tmp10_[_tmp11_];
1044 _g_object_unref0 (_element_it);
1047 _tmp14__length1 = array_length1;
1048 if (result_length1) {
1049 *result_length1 = _tmp14__length1;
1056 static guchar* gee_collection_to_uchar_array (GeeCollection* coll, int* result_length1) {
1057 guchar* result = NULL;
1058 GeeCollection* _tmp0_;
1061 guchar* _tmp3_ = NULL;
1067 gint _tmp14__length1;
1068 g_return_val_if_fail (coll != NULL, NULL);
1070 _tmp1_ = gee_collection_get_size (_tmp0_);
1072 _tmp3_ = g_new0 (guchar, _tmp2_);
1074 array_length1 = _tmp2_;
1075 _array_size_ = array_length1;
1078 GeeCollection* _tmp4_;
1079 GeeIterator* _tmp5_ = NULL;
1080 GeeIterator* _element_it;
1082 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1083 _element_it = _tmp5_;
1085 GeeIterator* _tmp6_;
1086 gboolean _tmp7_ = FALSE;
1087 GeeIterator* _tmp8_;
1088 gpointer _tmp9_ = NULL;
1091 gint _tmp10__length1;
1095 _tmp6_ = _element_it;
1096 _tmp7_ = gee_iterator_next (_tmp6_);
1100 _tmp8_ = _element_it;
1101 _tmp9_ = gee_iterator_get (_tmp8_);
1102 element = (guchar) ((guintptr) _tmp9_);
1104 _tmp10__length1 = array_length1;
1106 index = _tmp11_ + 1;
1108 _tmp10_[_tmp11_] = _tmp12_;
1109 _tmp13_ = _tmp10_[_tmp11_];
1111 _g_object_unref0 (_element_it);
1114 _tmp14__length1 = array_length1;
1115 if (result_length1) {
1116 *result_length1 = _tmp14__length1;
1123 static gint* gee_collection_to_int_array (GeeCollection* coll, int* result_length1) {
1124 gint* result = NULL;
1125 GeeCollection* _tmp0_;
1128 gint* _tmp3_ = NULL;
1134 gint _tmp14__length1;
1135 g_return_val_if_fail (coll != NULL, NULL);
1137 _tmp1_ = gee_collection_get_size (_tmp0_);
1139 _tmp3_ = g_new0 (gint, _tmp2_);
1141 array_length1 = _tmp2_;
1142 _array_size_ = array_length1;
1145 GeeCollection* _tmp4_;
1146 GeeIterator* _tmp5_ = NULL;
1147 GeeIterator* _element_it;
1149 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1150 _element_it = _tmp5_;
1152 GeeIterator* _tmp6_;
1153 gboolean _tmp7_ = FALSE;
1154 GeeIterator* _tmp8_;
1155 gpointer _tmp9_ = NULL;
1158 gint _tmp10__length1;
1162 _tmp6_ = _element_it;
1163 _tmp7_ = gee_iterator_next (_tmp6_);
1167 _tmp8_ = _element_it;
1168 _tmp9_ = gee_iterator_get (_tmp8_);
1169 element = (gint) ((gintptr) _tmp9_);
1171 _tmp10__length1 = array_length1;
1173 index = _tmp11_ + 1;
1175 _tmp10_[_tmp11_] = _tmp12_;
1176 _tmp13_ = _tmp10_[_tmp11_];
1178 _g_object_unref0 (_element_it);
1181 _tmp14__length1 = array_length1;
1182 if (result_length1) {
1183 *result_length1 = _tmp14__length1;
1190 static guint* gee_collection_to_uint_array (GeeCollection* coll, int* result_length1) {
1191 guint* result = NULL;
1192 GeeCollection* _tmp0_;
1195 guint* _tmp3_ = NULL;
1201 gint _tmp14__length1;
1202 g_return_val_if_fail (coll != NULL, NULL);
1204 _tmp1_ = gee_collection_get_size (_tmp0_);
1206 _tmp3_ = g_new0 (guint, _tmp2_);
1208 array_length1 = _tmp2_;
1209 _array_size_ = array_length1;
1212 GeeCollection* _tmp4_;
1213 GeeIterator* _tmp5_ = NULL;
1214 GeeIterator* _element_it;
1216 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1217 _element_it = _tmp5_;
1219 GeeIterator* _tmp6_;
1220 gboolean _tmp7_ = FALSE;
1221 GeeIterator* _tmp8_;
1222 gpointer _tmp9_ = NULL;
1225 gint _tmp10__length1;
1229 _tmp6_ = _element_it;
1230 _tmp7_ = gee_iterator_next (_tmp6_);
1234 _tmp8_ = _element_it;
1235 _tmp9_ = gee_iterator_get (_tmp8_);
1236 element = (guint) ((guintptr) _tmp9_);
1238 _tmp10__length1 = array_length1;
1240 index = _tmp11_ + 1;
1242 _tmp10_[_tmp11_] = _tmp12_;
1243 _tmp13_ = _tmp10_[_tmp11_];
1245 _g_object_unref0 (_element_it);
1248 _tmp14__length1 = array_length1;
1249 if (result_length1) {
1250 *result_length1 = _tmp14__length1;
1257 static gint64* gee_collection_to_int64_array (GeeCollection* coll, int* result_length1) {
1258 gint64* result = NULL;
1259 GeeCollection* _tmp0_;
1262 gint64* _tmp3_ = NULL;
1268 gint _tmp16__length1;
1269 g_return_val_if_fail (coll != NULL, NULL);
1271 _tmp1_ = gee_collection_get_size (_tmp0_);
1273 _tmp3_ = g_new0 (gint64, _tmp2_);
1275 array_length1 = _tmp2_;
1276 _array_size_ = array_length1;
1279 GeeCollection* _tmp4_;
1280 GeeIterator* _tmp5_ = NULL;
1281 GeeIterator* _element_it;
1283 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1284 _element_it = _tmp5_;
1286 GeeIterator* _tmp6_;
1287 gboolean _tmp7_ = FALSE;
1288 GeeIterator* _tmp8_;
1289 gpointer _tmp9_ = NULL;
1294 gint _tmp12__length1;
1298 _tmp6_ = _element_it;
1299 _tmp7_ = gee_iterator_next (_tmp6_);
1303 _tmp8_ = _element_it;
1304 _tmp9_ = gee_iterator_get (_tmp8_);
1305 _tmp10_ = (gint64*) _tmp9_;
1310 _tmp12__length1 = array_length1;
1312 index = _tmp13_ + 1;
1314 _tmp12_[_tmp13_] = _tmp14_;
1315 _tmp15_ = _tmp12_[_tmp13_];
1317 _g_object_unref0 (_element_it);
1320 _tmp16__length1 = array_length1;
1321 if (result_length1) {
1322 *result_length1 = _tmp16__length1;
1329 static guint64* gee_collection_to_uint64_array (GeeCollection* coll, int* result_length1) {
1330 guint64* result = NULL;
1331 GeeCollection* _tmp0_;
1334 guint64* _tmp3_ = NULL;
1340 gint _tmp16__length1;
1341 g_return_val_if_fail (coll != NULL, NULL);
1343 _tmp1_ = gee_collection_get_size (_tmp0_);
1345 _tmp3_ = g_new0 (guint64, _tmp2_);
1347 array_length1 = _tmp2_;
1348 _array_size_ = array_length1;
1351 GeeCollection* _tmp4_;
1352 GeeIterator* _tmp5_ = NULL;
1353 GeeIterator* _element_it;
1355 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1356 _element_it = _tmp5_;
1358 GeeIterator* _tmp6_;
1359 gboolean _tmp7_ = FALSE;
1360 GeeIterator* _tmp8_;
1361 gpointer _tmp9_ = NULL;
1366 gint _tmp12__length1;
1370 _tmp6_ = _element_it;
1371 _tmp7_ = gee_iterator_next (_tmp6_);
1375 _tmp8_ = _element_it;
1376 _tmp9_ = gee_iterator_get (_tmp8_);
1377 _tmp10_ = (guint64*) _tmp9_;
1382 _tmp12__length1 = array_length1;
1384 index = _tmp13_ + 1;
1386 _tmp12_[_tmp13_] = _tmp14_;
1387 _tmp15_ = _tmp12_[_tmp13_];
1389 _g_object_unref0 (_element_it);
1392 _tmp16__length1 = array_length1;
1393 if (result_length1) {
1394 *result_length1 = _tmp16__length1;
1401 static glong* gee_collection_to_long_array (GeeCollection* coll, int* result_length1) {
1402 glong* result = NULL;
1403 GeeCollection* _tmp0_;
1406 glong* _tmp3_ = NULL;
1412 gint _tmp14__length1;
1413 g_return_val_if_fail (coll != NULL, NULL);
1415 _tmp1_ = gee_collection_get_size (_tmp0_);
1417 _tmp3_ = g_new0 (glong, _tmp2_);
1419 array_length1 = _tmp2_;
1420 _array_size_ = array_length1;
1423 GeeCollection* _tmp4_;
1424 GeeIterator* _tmp5_ = NULL;
1425 GeeIterator* _element_it;
1427 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1428 _element_it = _tmp5_;
1430 GeeIterator* _tmp6_;
1431 gboolean _tmp7_ = FALSE;
1432 GeeIterator* _tmp8_;
1433 gpointer _tmp9_ = NULL;
1436 gint _tmp10__length1;
1440 _tmp6_ = _element_it;
1441 _tmp7_ = gee_iterator_next (_tmp6_);
1445 _tmp8_ = _element_it;
1446 _tmp9_ = gee_iterator_get (_tmp8_);
1447 element = (glong) ((gintptr) _tmp9_);
1449 _tmp10__length1 = array_length1;
1451 index = _tmp11_ + 1;
1453 _tmp10_[_tmp11_] = _tmp12_;
1454 _tmp13_ = _tmp10_[_tmp11_];
1456 _g_object_unref0 (_element_it);
1459 _tmp14__length1 = array_length1;
1460 if (result_length1) {
1461 *result_length1 = _tmp14__length1;
1468 static gulong* gee_collection_to_ulong_array (GeeCollection* coll, int* result_length1) {
1469 gulong* result = NULL;
1470 GeeCollection* _tmp0_;
1473 gulong* _tmp3_ = NULL;
1479 gint _tmp14__length1;
1480 g_return_val_if_fail (coll != NULL, NULL);
1482 _tmp1_ = gee_collection_get_size (_tmp0_);
1484 _tmp3_ = g_new0 (gulong, _tmp2_);
1486 array_length1 = _tmp2_;
1487 _array_size_ = array_length1;
1490 GeeCollection* _tmp4_;
1491 GeeIterator* _tmp5_ = NULL;
1492 GeeIterator* _element_it;
1494 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1495 _element_it = _tmp5_;
1497 GeeIterator* _tmp6_;
1498 gboolean _tmp7_ = FALSE;
1499 GeeIterator* _tmp8_;
1500 gpointer _tmp9_ = NULL;
1503 gint _tmp10__length1;
1507 _tmp6_ = _element_it;
1508 _tmp7_ = gee_iterator_next (_tmp6_);
1512 _tmp8_ = _element_it;
1513 _tmp9_ = gee_iterator_get (_tmp8_);
1514 element = (gulong) ((guintptr) _tmp9_);
1516 _tmp10__length1 = array_length1;
1518 index = _tmp11_ + 1;
1520 _tmp10_[_tmp11_] = _tmp12_;
1521 _tmp13_ = _tmp10_[_tmp11_];
1523 _g_object_unref0 (_element_it);
1526 _tmp14__length1 = array_length1;
1527 if (result_length1) {
1528 *result_length1 = _tmp14__length1;
1535 static gfloat* _float_dup (gfloat* self) {
1537 dup = g_new0 (gfloat, 1);
1538 memcpy (dup, self, sizeof (gfloat));
1543 static gpointer __float_dup0 (gpointer self) {
1544 return self ? _float_dup (self) : NULL;
1548 static gfloat** gee_collection_to_float_array (GeeCollection* coll, int* result_length1) {
1549 gfloat** result = NULL;
1550 GeeCollection* _tmp0_;
1553 gfloat** _tmp3_ = NULL;
1559 gint _tmp17__length1;
1560 g_return_val_if_fail (coll != NULL, NULL);
1562 _tmp1_ = gee_collection_get_size (_tmp0_);
1564 _tmp3_ = g_new0 (gfloat*, _tmp2_);
1566 array_length1 = _tmp2_;
1567 _array_size_ = array_length1;
1570 GeeCollection* _tmp4_;
1571 GeeIterator* _tmp5_ = NULL;
1572 GeeIterator* _element_it;
1574 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1575 _element_it = _tmp5_;
1577 GeeIterator* _tmp6_;
1578 gboolean _tmp7_ = FALSE;
1579 GeeIterator* _tmp8_;
1580 gpointer _tmp9_ = NULL;
1585 gint _tmp12__length1;
1590 _tmp6_ = _element_it;
1591 _tmp7_ = gee_iterator_next (_tmp6_);
1595 _tmp8_ = _element_it;
1596 _tmp9_ = gee_iterator_get (_tmp8_);
1597 _tmp10_ = (gfloat*) _tmp9_;
1602 _tmp12__length1 = array_length1;
1604 index = _tmp13_ + 1;
1606 _tmp15_ = __float_dup0 (&_tmp14_);
1607 _g_free0 (_tmp12_[_tmp13_]);
1608 _tmp12_[_tmp13_] = _tmp15_;
1609 _tmp16_ = _tmp12_[_tmp13_];
1611 _g_object_unref0 (_element_it);
1614 _tmp17__length1 = array_length1;
1615 if (result_length1) {
1616 *result_length1 = _tmp17__length1;
1623 static gdouble* _double_dup (gdouble* self) {
1625 dup = g_new0 (gdouble, 1);
1626 memcpy (dup, self, sizeof (gdouble));
1631 static gpointer __double_dup0 (gpointer self) {
1632 return self ? _double_dup (self) : NULL;
1636 static gdouble** gee_collection_to_double_array (GeeCollection* coll, int* result_length1) {
1637 gdouble** result = NULL;
1638 GeeCollection* _tmp0_;
1641 gdouble** _tmp3_ = NULL;
1647 gint _tmp17__length1;
1648 g_return_val_if_fail (coll != NULL, NULL);
1650 _tmp1_ = gee_collection_get_size (_tmp0_);
1652 _tmp3_ = g_new0 (gdouble*, _tmp2_);
1654 array_length1 = _tmp2_;
1655 _array_size_ = array_length1;
1658 GeeCollection* _tmp4_;
1659 GeeIterator* _tmp5_ = NULL;
1660 GeeIterator* _element_it;
1662 _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
1663 _element_it = _tmp5_;
1665 GeeIterator* _tmp6_;
1666 gboolean _tmp7_ = FALSE;
1667 GeeIterator* _tmp8_;
1668 gpointer _tmp9_ = NULL;
1673 gint _tmp12__length1;
1678 _tmp6_ = _element_it;
1679 _tmp7_ = gee_iterator_next (_tmp6_);
1683 _tmp8_ = _element_it;
1684 _tmp9_ = gee_iterator_get (_tmp8_);
1685 _tmp10_ = (gdouble*) _tmp9_;
1690 _tmp12__length1 = array_length1;
1692 index = _tmp13_ + 1;
1694 _tmp15_ = __double_dup0 (&_tmp14_);
1695 _g_free0 (_tmp12_[_tmp13_]);
1696 _tmp12_[_tmp13_] = _tmp15_;
1697 _tmp16_ = _tmp12_[_tmp13_];
1699 _g_object_unref0 (_element_it);
1702 _tmp17__length1 = array_length1;
1703 if (result_length1) {
1704 *result_length1 = _tmp17__length1;
1712 * Returns an immutable empty collection.
1714 * @return an immutable empty collection
1716 GeeCollection* gee_collection_empty (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func) {
1717 GeeCollection* result = NULL;
1722 GeeCollection* _tmp4_;
1723 _tmp0_ = gee_hash_set_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, NULL, NULL, NULL, NULL, NULL, NULL);
1725 _tmp2_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp1_);
1727 _tmp4_ = (GeeCollection*) _tmp3_;
1728 _g_object_unref0 (_tmp1_);
1734 gint gee_collection_get_size (GeeCollection* self) {
1735 g_return_val_if_fail (self != NULL, 0);
1736 return GEE_COLLECTION_GET_INTERFACE (self)->get_size (self);
1740 gboolean gee_collection_get_is_empty (GeeCollection* self) {
1741 g_return_val_if_fail (self != NULL, FALSE);
1742 return GEE_COLLECTION_GET_INTERFACE (self)->get_is_empty (self);
1746 static gboolean gee_collection_real_get_is_empty (GeeCollection* base) {
1748 GeeCollection* self;
1752 _tmp0_ = gee_collection_get_size (self);
1754 result = _tmp1_ == 0;
1759 gboolean gee_collection_get_read_only (GeeCollection* self) {
1760 g_return_val_if_fail (self != NULL, FALSE);
1761 return GEE_COLLECTION_GET_INTERFACE (self)->get_read_only (self);
1765 GeeCollection* gee_collection_get_read_only_view (GeeCollection* self) {
1766 g_return_val_if_fail (self != NULL, NULL);
1767 return GEE_COLLECTION_GET_INTERFACE (self)->get_read_only_view (self);
1771 static void gee_collection_base_init (GeeCollectionIface * iface) {
1772 static gboolean initialized = FALSE;
1776 * The number of items in this collection.
1778 g_object_interface_install_property (iface, 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));
1780 * Specifies whether this collection can change - i.e. wheather {@link add},
1781 * {@link remove} etc. are legal operations.
1783 g_object_interface_install_property (iface, 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));
1785 * The read-only view of this collection.
1787 g_object_interface_install_property (iface, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_COLLECTION, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
1788 iface->add_all = gee_collection_real_add_all;
1789 iface->contains_all = gee_collection_real_contains_all;
1790 iface->remove_all = gee_collection_real_remove_all;
1791 iface->retain_all = gee_collection_real_retain_all;
1792 iface->to_array = gee_collection_real_to_array;
1793 iface->get_is_empty = gee_collection_real_get_is_empty;
1799 * A generic collection of objects.
1801 GType gee_collection_get_type (void) {
1802 static volatile gsize gee_collection_type_id__volatile = 0;
1803 if (g_once_init_enter (&gee_collection_type_id__volatile)) {
1804 static const GTypeInfo g_define_type_info = { sizeof (GeeCollectionIface), (GBaseInitFunc) gee_collection_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
1805 GType gee_collection_type_id;
1806 gee_collection_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeCollection", &g_define_type_info, 0);
1807 g_type_interface_add_prerequisite (gee_collection_type_id, GEE_TYPE_ITERABLE);
1808 g_once_init_leave (&gee_collection_type_id__volatile, gee_collection_type_id);
1810 return gee_collection_type_id__volatile;
1814 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1815 if ((array != NULL) && (destroy_func != NULL)) {
1817 for (i = 0; i < array_length; i = i + 1) {
1818 if (((gpointer*) array)[i] != NULL) {
1819 destroy_func (((gpointer*) array)[i]);
1826 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
1827 _vala_array_destroy (array, array_length, destroy_func);