1 /* arraylist.c generated by valac 0.18.0, the Vala compiler
2 * generated from arraylist.vala, do not modify */
6 * Copyright (C) 2004-2005 Novell, Inc
7 * Copyright (C) 2005 David Waite
8 * Copyright (C) 2007-2008 Jürg Billeter
9 * Copyright (C) 2009 Didier Villevalois
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 * Jürg Billeter <j@bitron.ch>
27 * Didier 'Ptitjes Villevalois <ptitjes@free.fr>
31 #include <glib-object.h>
35 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
36 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
37 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
38 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
40 typedef struct _GeeTraversable GeeTraversable;
41 typedef struct _GeeTraversableIface GeeTraversableIface;
43 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
45 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
46 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
47 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
48 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
49 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
50 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
52 typedef struct _GeeLazy GeeLazy;
53 typedef struct _GeeLazyClass GeeLazyClass;
55 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
56 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
57 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
58 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
60 typedef struct _GeeIterator GeeIterator;
61 typedef struct _GeeIteratorIface GeeIteratorIface;
63 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
64 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
65 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
66 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
68 typedef struct _GeeIterable GeeIterable;
69 typedef struct _GeeIterableIface GeeIterableIface;
71 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
72 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
73 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
74 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
76 typedef struct _GeeCollection GeeCollection;
77 typedef struct _GeeCollectionIface GeeCollectionIface;
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;
88 typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate;
90 #define GEE_TYPE_LIST (gee_list_get_type ())
91 #define GEE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST, GeeList))
92 #define GEE_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST))
93 #define GEE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST, GeeListIface))
95 typedef struct _GeeList GeeList;
96 typedef struct _GeeListIface GeeListIface;
98 #define GEE_TYPE_LIST_ITERATOR (gee_list_iterator_get_type ())
99 #define GEE_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIterator))
100 #define GEE_IS_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LIST_ITERATOR))
101 #define GEE_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_LIST_ITERATOR, GeeListIteratorIface))
103 typedef struct _GeeListIterator GeeListIterator;
104 typedef struct _GeeListIteratorIface GeeListIteratorIface;
106 #define GEE_TYPE_ABSTRACT_LIST (gee_abstract_list_get_type ())
107 #define GEE_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractList))
108 #define GEE_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
109 #define GEE_IS_ABSTRACT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_LIST))
110 #define GEE_IS_ABSTRACT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_LIST))
111 #define GEE_ABSTRACT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_LIST, GeeAbstractListClass))
113 typedef struct _GeeAbstractList GeeAbstractList;
114 typedef struct _GeeAbstractListClass GeeAbstractListClass;
115 typedef struct _GeeAbstractListPrivate GeeAbstractListPrivate;
117 #define GEE_TYPE_BIDIR_LIST (gee_bidir_list_get_type ())
118 #define GEE_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirList))
119 #define GEE_IS_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST))
120 #define GEE_BIDIR_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST, GeeBidirListIface))
122 typedef struct _GeeBidirList GeeBidirList;
123 typedef struct _GeeBidirListIface GeeBidirListIface;
125 #define GEE_TYPE_BIDIR_ITERATOR (gee_bidir_iterator_get_type ())
126 #define GEE_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIterator))
127 #define GEE_IS_BIDIR_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_ITERATOR))
128 #define GEE_BIDIR_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_ITERATOR, GeeBidirIteratorIface))
130 typedef struct _GeeBidirIterator GeeBidirIterator;
131 typedef struct _GeeBidirIteratorIface GeeBidirIteratorIface;
133 #define GEE_TYPE_BIDIR_LIST_ITERATOR (gee_bidir_list_iterator_get_type ())
134 #define GEE_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIterator))
135 #define GEE_IS_BIDIR_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR))
136 #define GEE_BIDIR_LIST_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_BIDIR_LIST_ITERATOR, GeeBidirListIteratorIface))
138 typedef struct _GeeBidirListIterator GeeBidirListIterator;
139 typedef struct _GeeBidirListIteratorIface GeeBidirListIteratorIface;
141 #define GEE_TYPE_ABSTRACT_BIDIR_LIST (gee_abstract_bidir_list_get_type ())
142 #define GEE_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirList))
143 #define GEE_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass))
144 #define GEE_IS_ABSTRACT_BIDIR_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST))
145 #define GEE_IS_ABSTRACT_BIDIR_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ABSTRACT_BIDIR_LIST))
146 #define GEE_ABSTRACT_BIDIR_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ABSTRACT_BIDIR_LIST, GeeAbstractBidirListClass))
148 typedef struct _GeeAbstractBidirList GeeAbstractBidirList;
149 typedef struct _GeeAbstractBidirListClass GeeAbstractBidirListClass;
150 typedef struct _GeeAbstractBidirListPrivate GeeAbstractBidirListPrivate;
152 #define GEE_TYPE_ARRAY_LIST (gee_array_list_get_type ())
153 #define GEE_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayList))
154 #define GEE_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_ARRAY_LIST, GeeArrayListClass))
155 #define GEE_IS_ARRAY_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ARRAY_LIST))
156 #define GEE_IS_ARRAY_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_ARRAY_LIST))
157 #define GEE_ARRAY_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_ARRAY_LIST, GeeArrayListClass))
159 typedef struct _GeeArrayList GeeArrayList;
160 typedef struct _GeeArrayListClass GeeArrayListClass;
161 typedef struct _GeeArrayListPrivate GeeArrayListPrivate;
163 #define GEE_ARRAY_LIST_TYPE_ITERATOR (gee_array_list_iterator_get_type ())
164 #define GEE_ARRAY_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator))
165 #define GEE_ARRAY_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorClass))
166 #define GEE_ARRAY_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_ARRAY_LIST_TYPE_ITERATOR))
167 #define GEE_ARRAY_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_ARRAY_LIST_TYPE_ITERATOR))
168 #define GEE_ARRAY_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorClass))
170 typedef struct _GeeArrayListIterator GeeArrayListIterator;
171 typedef struct _GeeArrayListIteratorClass GeeArrayListIteratorClass;
172 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
173 typedef struct _GeeArrayListIteratorPrivate GeeArrayListIteratorPrivate;
174 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
176 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
178 GEE_TRAVERSABLE_STREAM_YIELD,
179 GEE_TRAVERSABLE_STREAM_CONTINUE,
180 GEE_TRAVERSABLE_STREAM_END
181 } GeeTraversableStream;
183 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
184 struct _GeeIteratorIface {
185 GTypeInterface parent_iface;
186 gboolean (*next) (GeeIterator* self);
187 gboolean (*has_next) (GeeIterator* self);
188 gpointer (*get) (GeeIterator* self);
189 void (*remove) (GeeIterator* self);
190 gboolean (*get_valid) (GeeIterator* self);
191 gboolean (*get_read_only) (GeeIterator* self);
194 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
195 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
196 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
197 struct _GeeTraversableIface {
198 GTypeInterface parent_iface;
199 GType (*get_g_type) (GeeTraversable* self);
200 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
201 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
202 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
203 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);
204 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
205 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
206 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
207 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
208 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
209 GType (*get_element_type) (GeeTraversable* self);
212 struct _GeeIterableIface {
213 GTypeInterface parent_iface;
214 GType (*get_g_type) (GeeIterable* self);
215 GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
216 GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
217 GeeIterator* (*iterator) (GeeIterable* self);
220 struct _GeeCollectionIface {
221 GTypeInterface parent_iface;
222 GType (*get_g_type) (GeeCollection* self);
223 GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
224 GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
225 gboolean (*contains) (GeeCollection* self, gconstpointer item);
226 gboolean (*add) (GeeCollection* self, gconstpointer item);
227 gboolean (*remove) (GeeCollection* self, gconstpointer item);
228 void (*clear) (GeeCollection* self);
229 gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
230 gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
231 gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
232 gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
233 gpointer* (*to_array) (GeeCollection* self, int* result_length1);
234 gint (*get_size) (GeeCollection* self);
235 gboolean (*get_is_empty) (GeeCollection* self);
236 gboolean (*get_read_only) (GeeCollection* self);
237 GeeCollection* (*get_read_only_view) (GeeCollection* self);
240 struct _GeeAbstractCollection {
241 GObject parent_instance;
242 GeeAbstractCollectionPrivate * priv;
245 struct _GeeAbstractCollectionClass {
246 GObjectClass parent_class;
247 gboolean (*contains) (GeeAbstractCollection* self, gconstpointer item);
248 gboolean (*add) (GeeAbstractCollection* self, gconstpointer item);
249 gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item);
250 void (*clear) (GeeAbstractCollection* self);
251 GeeIterator* (*iterator) (GeeAbstractCollection* self);
252 gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target);
253 void (*reserved0) (GeeAbstractCollection* self);
254 void (*reserved1) (GeeAbstractCollection* self);
255 void (*reserved2) (GeeAbstractCollection* self);
256 void (*reserved3) (GeeAbstractCollection* self);
257 void (*reserved4) (GeeAbstractCollection* self);
258 void (*reserved5) (GeeAbstractCollection* self);
259 void (*reserved6) (GeeAbstractCollection* self);
260 void (*reserved7) (GeeAbstractCollection* self);
261 void (*reserved8) (GeeAbstractCollection* self);
262 void (*reserved9) (GeeAbstractCollection* self);
263 gint (*get_size) (GeeAbstractCollection* self);
264 gboolean (*get_read_only) (GeeAbstractCollection* self);
265 GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self);
268 struct _GeeListIteratorIface {
269 GTypeInterface parent_iface;
270 void (*set) (GeeListIterator* self, gconstpointer item);
271 void (*add) (GeeListIterator* self, gconstpointer item);
272 gint (*index) (GeeListIterator* self);
275 struct _GeeListIface {
276 GTypeInterface parent_iface;
277 GType (*get_g_type) (GeeList* self);
278 GBoxedCopyFunc (*get_g_dup_func) (GeeList* self);
279 GDestroyNotify (*get_g_destroy_func) (GeeList* self);
280 GeeListIterator* (*list_iterator) (GeeList* self);
281 gpointer (*get) (GeeList* self, gint index);
282 void (*set) (GeeList* self, gint index, gconstpointer item);
283 gint (*index_of) (GeeList* self, gconstpointer item);
284 void (*insert) (GeeList* self, gint index, gconstpointer item);
285 gpointer (*remove_at) (GeeList* self, gint index);
286 GeeList* (*slice) (GeeList* self, gint start, gint stop);
287 gpointer (*first) (GeeList* self);
288 gpointer (*last) (GeeList* self);
289 void (*insert_all) (GeeList* self, gint index, GeeCollection* collection);
290 void (*sort) (GeeList* self, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify);
291 GeeList* (*get_read_only_view) (GeeList* self);
294 struct _GeeAbstractList {
295 GeeAbstractCollection parent_instance;
296 GeeAbstractListPrivate * priv;
299 struct _GeeAbstractListClass {
300 GeeAbstractCollectionClass parent_class;
301 GeeListIterator* (*list_iterator) (GeeAbstractList* self);
302 gpointer (*get) (GeeAbstractList* self, gint index);
303 void (*set) (GeeAbstractList* self, gint index, gconstpointer item);
304 gint (*index_of) (GeeAbstractList* self, gconstpointer item);
305 void (*insert) (GeeAbstractList* self, gint index, gconstpointer item);
306 gpointer (*remove_at) (GeeAbstractList* self, gint index);
307 GeeList* (*slice) (GeeAbstractList* self, gint start, gint stop);
308 void (*reserved0) (GeeAbstractList* self);
309 void (*reserved1) (GeeAbstractList* self);
310 void (*reserved2) (GeeAbstractList* self);
311 void (*reserved3) (GeeAbstractList* self);
312 void (*reserved4) (GeeAbstractList* self);
313 void (*reserved5) (GeeAbstractList* self);
314 void (*reserved6) (GeeAbstractList* self);
315 void (*reserved7) (GeeAbstractList* self);
316 void (*reserved8) (GeeAbstractList* self);
317 void (*reserved9) (GeeAbstractList* self);
318 GeeList* (*get_read_only_view) (GeeAbstractList* self);
321 struct _GeeBidirIteratorIface {
322 GTypeInterface parent_iface;
323 GType (*get_g_type) (GeeBidirIterator* self);
324 GBoxedCopyFunc (*get_g_dup_func) (GeeBidirIterator* self);
325 GDestroyNotify (*get_g_destroy_func) (GeeBidirIterator* self);
326 gboolean (*previous) (GeeBidirIterator* self);
327 gboolean (*has_previous) (GeeBidirIterator* self);
328 gboolean (*first) (GeeBidirIterator* self);
329 gboolean (*last) (GeeBidirIterator* self);
332 struct _GeeBidirListIteratorIface {
333 GTypeInterface parent_iface;
334 GType (*get_g_type) (GeeBidirListIterator* self);
335 GBoxedCopyFunc (*get_g_dup_func) (GeeBidirListIterator* self);
336 GDestroyNotify (*get_g_destroy_func) (GeeBidirListIterator* self);
337 void (*insert) (GeeBidirListIterator* self, gconstpointer item);
340 struct _GeeBidirListIface {
341 GTypeInterface parent_iface;
342 GType (*get_g_type) (GeeBidirList* self);
343 GBoxedCopyFunc (*get_g_dup_func) (GeeBidirList* self);
344 GDestroyNotify (*get_g_destroy_func) (GeeBidirList* self);
345 GeeBidirListIterator* (*bidir_list_iterator) (GeeBidirList* self);
346 GeeBidirList* (*get_read_only_view) (GeeBidirList* self);
349 struct _GeeAbstractBidirList {
350 GeeAbstractList parent_instance;
351 GeeAbstractBidirListPrivate * priv;
354 struct _GeeAbstractBidirListClass {
355 GeeAbstractListClass parent_class;
356 GeeBidirListIterator* (*bidir_list_iterator) (GeeAbstractBidirList* self);
357 void (*reserved0) (GeeAbstractBidirList* self);
358 void (*reserved1) (GeeAbstractBidirList* self);
359 void (*reserved2) (GeeAbstractBidirList* self);
360 void (*reserved3) (GeeAbstractBidirList* self);
361 void (*reserved4) (GeeAbstractBidirList* self);
362 void (*reserved5) (GeeAbstractBidirList* self);
363 void (*reserved6) (GeeAbstractBidirList* self);
364 void (*reserved7) (GeeAbstractBidirList* self);
365 void (*reserved8) (GeeAbstractBidirList* self);
366 void (*reserved9) (GeeAbstractBidirList* self);
367 GeeBidirList* (*get_read_only_view) (GeeAbstractBidirList* self);
370 struct _GeeArrayList {
371 GeeAbstractBidirList parent_instance;
372 GeeArrayListPrivate * priv;
379 struct _GeeArrayListClass {
380 GeeAbstractBidirListClass parent_class;
383 typedef gboolean (*GeeEqualDataFunc) (gconstpointer a, gconstpointer b, void* user_data);
384 struct _GeeArrayListPrivate {
386 GBoxedCopyFunc g_dup_func;
387 GDestroyNotify g_destroy_func;
388 GeeEqualDataFunc _equal_func;
389 gpointer _equal_func_target;
390 GDestroyNotify _equal_func_target_destroy_notify;
394 struct _GeeArrayListIterator {
395 GObject parent_instance;
396 GeeArrayListIteratorPrivate * priv;
399 struct _GeeArrayListIteratorClass {
400 GObjectClass parent_class;
403 struct _GeeArrayListIteratorPrivate {
405 GBoxedCopyFunc g_dup_func;
406 GDestroyNotify g_destroy_func;
414 static gpointer gee_array_list_parent_class = NULL;
415 static gpointer gee_array_list_iterator_parent_class = NULL;
416 static GeeTraversableIface* gee_array_list_iterator_gee_traversable_parent_iface = NULL;
417 static GeeIteratorIface* gee_array_list_iterator_gee_iterator_parent_iface = NULL;
418 static GeeBidirIteratorIface* gee_array_list_iterator_gee_bidir_iterator_parent_iface = NULL;
419 static GeeListIteratorIface* gee_array_list_iterator_gee_list_iterator_parent_iface = NULL;
420 static GeeBidirListIteratorIface* gee_array_list_iterator_gee_bidir_list_iterator_parent_iface = NULL;
422 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
423 gpointer gee_lazy_ref (gpointer instance);
424 void gee_lazy_unref (gpointer instance);
425 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
426 void gee_value_set_lazy (GValue* value, gpointer v_object);
427 void gee_value_take_lazy (GValue* value, gpointer v_object);
428 gpointer gee_value_get_lazy (const GValue* value);
429 GType gee_lazy_get_type (void) G_GNUC_CONST;
430 GType gee_iterator_get_type (void) G_GNUC_CONST;
431 GType gee_traversable_get_type (void) G_GNUC_CONST;
432 GType gee_iterable_get_type (void) G_GNUC_CONST;
433 GType gee_collection_get_type (void) G_GNUC_CONST;
434 GType gee_abstract_collection_get_type (void) G_GNUC_CONST;
435 GType gee_list_iterator_get_type (void) G_GNUC_CONST;
436 GType gee_list_get_type (void) G_GNUC_CONST;
437 GType gee_abstract_list_get_type (void) G_GNUC_CONST;
438 GType gee_bidir_iterator_get_type (void) G_GNUC_CONST;
439 GType gee_bidir_list_iterator_get_type (void) G_GNUC_CONST;
440 GType gee_bidir_list_get_type (void) G_GNUC_CONST;
441 GType gee_abstract_bidir_list_get_type (void) G_GNUC_CONST;
442 GType gee_array_list_get_type (void) G_GNUC_CONST;
443 #define GEE_ARRAY_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_ARRAY_LIST, GeeArrayListPrivate))
445 GEE_ARRAY_LIST_DUMMY_PROPERTY,
446 GEE_ARRAY_LIST_G_TYPE,
447 GEE_ARRAY_LIST_G_DUP_FUNC,
448 GEE_ARRAY_LIST_G_DESTROY_FUNC,
450 GEE_ARRAY_LIST_READ_ONLY
452 GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
453 GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
454 GeeAbstractBidirList* gee_abstract_bidir_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
455 GeeEqualDataFunc gee_functions_get_equal_func_for (GType t, void** result_target, GDestroyNotify* result_target_destroy_notify);
456 static void gee_array_list_set_equal_func (GeeArrayList* self, GeeEqualDataFunc value, gpointer value_target);
457 GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
458 GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify);
459 static gpointer* _vala_array_dup1 (gpointer* self, int length, GBoxedCopyFunc g_dup_func);
460 static gboolean gee_array_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target);
461 static GeeIterator* gee_array_list_real_iterator (GeeAbstractCollection* base);
462 static GeeArrayListIterator* gee_array_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list);
463 static GeeArrayListIterator* gee_array_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list);
464 static GType gee_array_list_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
465 static GeeListIterator* gee_array_list_real_list_iterator (GeeAbstractList* base);
466 static GeeBidirListIterator* gee_array_list_real_bidir_list_iterator (GeeAbstractBidirList* base);
467 static gboolean gee_array_list_real_contains (GeeAbstractCollection* base, gconstpointer item);
468 gint gee_abstract_list_index_of (GeeAbstractList* self, gconstpointer item);
469 static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer item);
470 GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target);
471 static gpointer gee_array_list_real_get (GeeAbstractList* base, gint index);
472 static void gee_array_list_real_set (GeeAbstractList* base, gint index, gconstpointer item);
473 static gboolean gee_array_list_real_add (GeeAbstractCollection* base, gconstpointer item);
474 static void gee_array_list_grow_if_needed (GeeArrayList* self, gint new_count);
475 static void gee_array_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item);
476 static void gee_array_list_shift (GeeArrayList* self, gint start, gint delta);
477 static gboolean gee_array_list_real_remove (GeeAbstractCollection* base, gconstpointer item);
478 gpointer gee_abstract_list_remove_at (GeeAbstractList* self, gint index);
479 static gpointer gee_array_list_real_remove_at (GeeAbstractList* base, gint index);
480 static void gee_array_list_real_clear (GeeAbstractCollection* base);
481 static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gint stop);
482 gboolean gee_abstract_collection_add (GeeAbstractCollection* self, gconstpointer item);
483 gpointer gee_abstract_list_get (GeeAbstractList* self, gint index);
484 gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection);
485 gboolean gee_collection_get_is_empty (GeeCollection* self);
486 gint gee_collection_get_size (GeeCollection* self);
487 gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target);
488 static gboolean __lambda28_ (GeeArrayList* self, gpointer item);
489 static gboolean ___lambda28__gee_forall_func (gpointer g, gpointer self);
490 static void gee_array_list_set_capacity (GeeArrayList* self, gint value);
491 #define GEE_ARRAY_LIST_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIteratorPrivate))
493 GEE_ARRAY_LIST_ITERATOR_DUMMY_PROPERTY,
494 GEE_ARRAY_LIST_ITERATOR_G_TYPE,
495 GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC,
496 GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC,
497 GEE_ARRAY_LIST_ITERATOR_READ_ONLY,
498 GEE_ARRAY_LIST_ITERATOR_VALID
500 static gboolean gee_array_list_iterator_real_next (GeeIterator* base);
501 static gboolean gee_array_list_iterator_real_has_next (GeeIterator* base);
502 static gboolean gee_array_list_iterator_real_first (GeeBidirIterator* base);
503 gint gee_abstract_collection_get_size (GeeAbstractCollection* self);
504 static gpointer gee_array_list_iterator_real_get (GeeIterator* base);
505 static void gee_array_list_iterator_real_remove (GeeIterator* base);
506 static gboolean gee_array_list_iterator_real_previous (GeeBidirIterator* base);
507 static gboolean gee_array_list_iterator_real_has_previous (GeeBidirIterator* base);
508 static gboolean gee_array_list_iterator_real_last (GeeBidirIterator* base);
509 static void gee_array_list_iterator_real_set (GeeListIterator* base, gconstpointer item);
510 static void gee_array_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item);
511 void gee_abstract_list_insert (GeeAbstractList* self, gint index, gconstpointer item);
512 static void gee_array_list_iterator_real_add (GeeListIterator* base, gconstpointer item);
513 static gint gee_array_list_iterator_real_index (GeeListIterator* base);
514 static gboolean gee_array_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
515 static void gee_array_list_iterator_finalize (GObject* obj);
516 gboolean gee_iterator_get_read_only (GeeIterator* self);
517 gboolean gee_iterator_get_valid (GeeIterator* self);
518 static void _vala_gee_array_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
519 static void _vala_gee_array_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
520 static void gee_array_list_finalize (GObject* obj);
521 gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self);
522 static void _vala_gee_array_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
523 static void _vala_gee_array_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
524 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
525 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
526 static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length);
530 * Constructs a new, empty array list.
532 * If not provided, the function parameter is requested to the
533 * {@link Functions} function factory methods.
535 * @param equal_func an optional element equality testing function
537 GeeArrayList* gee_array_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
538 GeeArrayList * self = NULL;
539 GeeEqualDataFunc _tmp0_;
541 GeeEqualDataFunc _tmp4_;
543 gpointer* _tmp5_ = NULL;
544 self = (GeeArrayList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
545 self->priv->g_type = g_type;
546 self->priv->g_dup_func = g_dup_func;
547 self->priv->g_destroy_func = g_destroy_func;
549 _tmp0__target = equal_func_target;
550 if (_tmp0_ == NULL) {
552 GDestroyNotify _tmp2_ = NULL;
553 GeeEqualDataFunc _tmp3_ = NULL;
554 _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_);
555 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
557 equal_func_target = NULL;
558 equal_func_target_destroy_notify = NULL;
560 equal_func_target = _tmp1_;
561 equal_func_target_destroy_notify = _tmp2_;
564 _tmp4__target = equal_func_target;
565 gee_array_list_set_equal_func (self, _tmp4_, _tmp4__target);
566 _tmp5_ = g_new0 (gpointer, 4);
567 self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) g_destroy_func), NULL);
568 self->_items = _tmp5_;
569 self->_items_length1 = 4;
570 self->__items_size_ = self->_items_length1;
572 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
574 equal_func_target = NULL;
575 equal_func_target_destroy_notify = NULL;
580 GeeArrayList* gee_array_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
581 return gee_array_list_construct (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify);
586 * Constructs a new array list based on provided array.
588 * If not provided, the function parameter is requested to the
589 * {@link Functions} function factory methods.
591 * @param items initial items to be put into array
592 * @param equal_func an optional element equality testing function
594 static gpointer* _vala_array_dup1 (gpointer* self, int length, GBoxedCopyFunc g_dup_func) {
597 result = g_new0 (gpointer, length);
598 for (i = 0; i < length; i++) {
600 _tmp0_ = ((self[i] != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) self[i]) : ((gpointer) self[i]);
607 GeeArrayList* gee_array_list_construct_wrap (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
608 GeeArrayList * self = NULL;
609 GeeEqualDataFunc _tmp0_;
611 GeeEqualDataFunc _tmp4_;
619 self = (GeeArrayList*) gee_abstract_bidir_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func);
620 self->priv->g_type = g_type;
621 self->priv->g_dup_func = g_dup_func;
622 self->priv->g_destroy_func = g_destroy_func;
624 _tmp0__target = equal_func_target;
625 if (_tmp0_ == NULL) {
627 GDestroyNotify _tmp2_ = NULL;
628 GeeEqualDataFunc _tmp3_ = NULL;
629 _tmp3_ = gee_functions_get_equal_func_for (g_type, &_tmp1_, &_tmp2_);
630 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
632 equal_func_target = NULL;
633 equal_func_target_destroy_notify = NULL;
635 equal_func_target = _tmp1_;
636 equal_func_target_destroy_notify = _tmp2_;
639 _tmp4__target = equal_func_target;
640 gee_array_list_set_equal_func (self, _tmp4_, _tmp4__target);
642 _tmp5__length1 = items_length1;
643 _tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup1 (_tmp5_, _tmp5__length1, g_dup_func) : ((gpointer) _tmp5_);
644 _tmp6__length1 = _tmp5__length1;
645 self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) g_destroy_func), NULL);
646 self->_items = _tmp6_;
647 self->_items_length1 = _tmp6__length1;
648 self->__items_size_ = self->_items_length1;
650 _tmp7__length1 = items_length1;
651 self->_size = _tmp7__length1;
652 items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_destroy_func), NULL);
653 (equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
655 equal_func_target = NULL;
656 equal_func_target_destroy_notify = NULL;
661 GeeArrayList* gee_array_list_new_wrap (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, gpointer* items, int items_length1, GeeEqualDataFunc equal_func, void* equal_func_target, GDestroyNotify equal_func_target_destroy_notify) {
662 return gee_array_list_construct_wrap (GEE_TYPE_ARRAY_LIST, g_type, g_dup_func, g_destroy_func, items, items_length1, equal_func, equal_func_target, equal_func_target_destroy_notify);
669 static gboolean gee_array_list_real_foreach (GeeAbstractCollection* base, GeeForallFunc f, void* f_target) {
671 gboolean result = FALSE;
672 self = (GeeArrayList*) base;
683 GeeForallFunc _tmp5_;
688 gconstpointer _tmp8_;
690 gboolean _tmp10_ = FALSE;
699 _tmp4_ = self->_size;
700 if (!(_tmp3_ < _tmp4_)) {
704 _tmp5__target = f_target;
705 _tmp6_ = self->_items;
706 _tmp6__length1 = self->_items_length1;
708 _tmp8_ = _tmp6_[_tmp7_];
709 _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
710 _tmp10_ = _tmp5_ (_tmp9_, _tmp5__target);
726 static GeeIterator* gee_array_list_real_iterator (GeeAbstractCollection* base) {
728 GeeIterator* result = NULL;
729 GeeArrayListIterator* _tmp0_;
730 self = (GeeArrayList*) base;
731 _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
732 result = (GeeIterator*) _tmp0_;
740 static GeeListIterator* gee_array_list_real_list_iterator (GeeAbstractList* base) {
742 GeeListIterator* result = NULL;
743 GeeArrayListIterator* _tmp0_;
744 self = (GeeArrayList*) base;
745 _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
746 result = (GeeListIterator*) _tmp0_;
754 static GeeBidirListIterator* gee_array_list_real_bidir_list_iterator (GeeAbstractBidirList* base) {
756 GeeBidirListIterator* result = NULL;
757 GeeArrayListIterator* _tmp0_;
758 self = (GeeArrayList*) base;
759 _tmp0_ = gee_array_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, self);
760 result = (GeeBidirListIterator*) _tmp0_;
768 static gboolean gee_array_list_real_contains (GeeAbstractCollection* base, gconstpointer item) {
770 gboolean result = FALSE;
771 gconstpointer _tmp0_;
773 self = (GeeArrayList*) base;
775 _tmp1_ = gee_abstract_list_index_of ((GeeAbstractList*) self, _tmp0_);
776 result = _tmp1_ != (-1);
784 static gint gee_array_list_real_index_of (GeeAbstractList* base, gconstpointer item) {
787 self = (GeeArrayList*) base;
798 GeeEqualDataFunc _tmp5_;
800 GeeEqualDataFunc _tmp6_;
805 gconstpointer _tmp9_;
806 gconstpointer _tmp10_;
807 gboolean _tmp11_ = FALSE;
816 _tmp4_ = self->_size;
817 if (!(_tmp3_ < _tmp4_)) {
820 _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target);
822 _tmp6__target = _tmp5__target;
823 _tmp7_ = self->_items;
824 _tmp7__length1 = self->_items_length1;
826 _tmp9_ = _tmp7_[_tmp8_];
828 _tmp11_ = _tmp6_ (_tmp9_, _tmp10_, _tmp6__target);
844 static gpointer gee_array_list_real_get (GeeAbstractList* base, gint index) {
846 gpointer result = NULL;
853 gconstpointer _tmp5_;
855 self = (GeeArrayList*) base;
857 _vala_assert (_tmp0_ >= 0, "index >= 0");
859 _tmp2_ = self->_size;
860 _vala_assert (_tmp1_ < _tmp2_, "index < _size");
861 _tmp3_ = self->_items;
862 _tmp3__length1 = self->_items_length1;
864 _tmp5_ = _tmp3_[_tmp4_];
865 _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
874 static void gee_array_list_real_set (GeeAbstractList* base, gint index, gconstpointer item) {
882 gconstpointer _tmp5_;
885 self = (GeeArrayList*) base;
887 _vala_assert (_tmp0_ >= 0, "index >= 0");
889 _tmp2_ = self->_size;
890 _vala_assert (_tmp1_ < _tmp2_, "index < _size");
891 _tmp3_ = self->_items;
892 _tmp3__length1 = self->_items_length1;
895 _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
896 ((_tmp3_[_tmp4_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp3_[_tmp4_] = (self->priv->g_destroy_func (_tmp3_[_tmp4_]), NULL));
897 _tmp3_[_tmp4_] = _tmp6_;
898 _tmp7_ = _tmp3_[_tmp4_];
905 static gboolean gee_array_list_real_add (GeeAbstractCollection* base, gconstpointer item) {
907 gboolean result = FALSE;
914 gconstpointer _tmp4_;
918 self = (GeeArrayList*) base;
919 _tmp0_ = self->_size;
920 _tmp1_ = self->_items;
921 _tmp1__length1 = self->_items_length1;
922 if (_tmp0_ == _tmp1__length1) {
923 gee_array_list_grow_if_needed (self, 1);
925 _tmp2_ = self->_items;
926 _tmp2__length1 = self->_items_length1;
927 _tmp3_ = self->_size;
928 self->_size = _tmp3_ + 1;
930 _tmp5_ = ((_tmp4_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp4_) : ((gpointer) _tmp4_);
931 ((_tmp2_[_tmp3_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp2_[_tmp3_] = (self->priv->g_destroy_func (_tmp2_[_tmp3_]), NULL));
932 _tmp2_[_tmp3_] = _tmp5_;
933 _tmp6_ = _tmp2_[_tmp3_];
934 _tmp7_ = self->priv->_stamp;
935 self->priv->_stamp = _tmp7_ + 1;
944 static void gee_array_list_real_insert (GeeAbstractList* base, gint index, gconstpointer item) {
956 gconstpointer _tmp8_;
960 self = (GeeArrayList*) base;
962 _vala_assert (_tmp0_ >= 0, "index >= 0");
964 _tmp2_ = self->_size;
965 _vala_assert (_tmp1_ <= _tmp2_, "index <= _size");
966 _tmp3_ = self->_size;
967 _tmp4_ = self->_items;
968 _tmp4__length1 = self->_items_length1;
969 if (_tmp3_ == _tmp4__length1) {
970 gee_array_list_grow_if_needed (self, 1);
973 gee_array_list_shift (self, _tmp5_, 1);
974 _tmp6_ = self->_items;
975 _tmp6__length1 = self->_items_length1;
978 _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
979 ((_tmp6_[_tmp7_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp6_[_tmp7_] = (self->priv->g_destroy_func (_tmp6_[_tmp7_]), NULL));
980 _tmp6_[_tmp7_] = _tmp9_;
981 _tmp10_ = _tmp6_[_tmp7_];
982 _tmp11_ = self->priv->_stamp;
983 self->priv->_stamp = _tmp11_ + 1;
990 static gboolean gee_array_list_real_remove (GeeAbstractCollection* base, gconstpointer item) {
992 gboolean result = FALSE;
993 self = (GeeArrayList*) base;
1004 GeeEqualDataFunc _tmp5_;
1005 void* _tmp5__target;
1006 GeeEqualDataFunc _tmp6_;
1007 void* _tmp6__target;
1009 gint _tmp7__length1;
1011 gconstpointer _tmp9_;
1012 gconstpointer _tmp10_;
1013 gboolean _tmp11_ = FALSE;
1022 _tmp4_ = self->_size;
1023 if (!(_tmp3_ < _tmp4_)) {
1026 _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target);
1028 _tmp6__target = _tmp5__target;
1029 _tmp7_ = self->_items;
1030 _tmp7__length1 = self->_items_length1;
1032 _tmp9_ = _tmp7_[_tmp8_];
1034 _tmp11_ = _tmp6_ (_tmp9_, _tmp10_, _tmp6__target);
1037 gpointer _tmp13_ = NULL;
1040 _tmp13_ = gee_abstract_list_remove_at ((GeeAbstractList*) self, _tmp12_);
1042 ((_tmp14_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp14_ = (self->priv->g_destroy_func (_tmp14_), NULL));
1057 static gpointer gee_array_list_real_remove_at (GeeAbstractList* base, gint index) {
1058 GeeArrayList * self;
1059 gpointer result = NULL;
1064 gint _tmp3__length1;
1066 gconstpointer _tmp5_;
1070 gint _tmp7__length1;
1075 self = (GeeArrayList*) base;
1077 _vala_assert (_tmp0_ >= 0, "index >= 0");
1079 _tmp2_ = self->_size;
1080 _vala_assert (_tmp1_ < _tmp2_, "index < _size");
1081 _tmp3_ = self->_items;
1082 _tmp3__length1 = self->_items_length1;
1084 _tmp5_ = _tmp3_[_tmp4_];
1085 _tmp6_ = ((_tmp5_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp5_) : ((gpointer) _tmp5_);
1087 _tmp7_ = self->_items;
1088 _tmp7__length1 = self->_items_length1;
1090 ((_tmp7_[_tmp8_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp7_[_tmp8_] = (self->priv->g_destroy_func (_tmp7_[_tmp8_]), NULL));
1091 _tmp7_[_tmp8_] = NULL;
1092 _tmp9_ = _tmp7_[_tmp8_];
1094 gee_array_list_shift (self, _tmp10_ + 1, -1);
1095 _tmp11_ = self->priv->_stamp;
1096 self->priv->_stamp = _tmp11_ + 1;
1105 static void gee_array_list_real_clear (GeeAbstractCollection* base) {
1106 GeeArrayList * self;
1108 self = (GeeArrayList*) base;
1120 gint _tmp5__length1;
1131 _tmp4_ = self->_size;
1132 if (!(_tmp3_ < _tmp4_)) {
1135 _tmp5_ = self->_items;
1136 _tmp5__length1 = self->_items_length1;
1138 ((_tmp5_[_tmp6_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp5_[_tmp6_] = (self->priv->g_destroy_func (_tmp5_[_tmp6_]), NULL));
1139 _tmp5_[_tmp6_] = NULL;
1140 _tmp7_ = _tmp5_[_tmp6_];
1145 _tmp8_ = self->priv->_stamp;
1146 self->priv->_stamp = _tmp8_ + 1;
1153 static GeeList* gee_array_list_real_slice (GeeAbstractList* base, gint start, gint stop) {
1154 GeeArrayList * self;
1155 GeeList* result = NULL;
1161 GeeEqualDataFunc _tmp5_;
1162 void* _tmp5__target;
1163 GeeEqualDataFunc _tmp6_;
1164 void* _tmp6__target;
1165 GeeArrayList* _tmp7_;
1166 GeeArrayList* slice;
1167 self = (GeeArrayList*) base;
1170 g_return_val_if_fail (_tmp0_ <= _tmp1_, NULL);
1172 g_return_val_if_fail (_tmp2_ >= 0, NULL);
1174 _tmp4_ = self->_size;
1175 g_return_val_if_fail (_tmp3_ <= _tmp4_, NULL);
1176 _tmp5_ = gee_array_list_get_equal_func (self, &_tmp5__target);
1178 _tmp6__target = _tmp5__target;
1179 _tmp7_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp6_, _tmp6__target, NULL);
1193 GeeArrayList* _tmp14_;
1195 gpointer _tmp16_ = NULL;
1206 if (!(_tmp12_ < _tmp13_)) {
1211 _tmp16_ = gee_abstract_list_get ((GeeAbstractList*) self, _tmp15_);
1213 gee_abstract_collection_add ((GeeAbstractCollection*) _tmp14_, _tmp17_);
1214 ((_tmp17_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp17_ = (self->priv->g_destroy_func (_tmp17_), NULL));
1218 result = (GeeList*) slice;
1226 static gboolean __lambda28_ (GeeArrayList* self, gpointer item) {
1227 gboolean result = FALSE;
1229 gint _tmp0__length1;
1231 gconstpointer _tmp2_;
1234 _tmp0_ = self->_items;
1235 _tmp0__length1 = self->_items_length1;
1236 _tmp1_ = self->_size;
1237 self->_size = _tmp1_ + 1;
1239 _tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
1240 ((_tmp0_[_tmp1_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp0_[_tmp1_] = (self->priv->g_destroy_func (_tmp0_[_tmp1_]), NULL));
1241 _tmp0_[_tmp1_] = _tmp3_;
1242 _tmp4_ = _tmp0_[_tmp1_];
1244 ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
1249 static gboolean ___lambda28__gee_forall_func (gpointer g, gpointer self) {
1251 result = __lambda28_ (self, g);
1256 gboolean gee_array_list_add_all (GeeArrayList* self, GeeCollection* collection) {
1257 gboolean result = FALSE;
1258 GeeCollection* _tmp0_;
1261 GeeCollection* _tmp3_;
1264 GeeCollection* _tmp6_;
1266 g_return_val_if_fail (self != NULL, FALSE);
1267 g_return_val_if_fail (collection != NULL, FALSE);
1268 _tmp0_ = collection;
1269 _tmp1_ = gee_collection_get_is_empty (_tmp0_);
1275 _tmp3_ = collection;
1276 _tmp4_ = gee_collection_get_size (_tmp3_);
1278 gee_array_list_grow_if_needed (self, _tmp5_);
1279 _tmp6_ = collection;
1280 gee_traversable_foreach ((GeeTraversable*) _tmp6_, ___lambda28__gee_forall_func, self);
1281 _tmp7_ = self->priv->_stamp;
1282 self->priv->_stamp = _tmp7_ + 1;
1288 static void gee_array_list_shift (GeeArrayList* self, gint start, gint delta) {
1301 g_return_if_fail (self != NULL);
1303 _vala_assert (_tmp0_ >= 0, "start >= 0");
1305 _tmp2_ = self->_size;
1306 _vala_assert (_tmp1_ <= _tmp2_, "start <= _size");
1309 _vala_assert (_tmp3_ >= (-_tmp4_), "start >= -delta");
1313 _tmp8_ = self->_size;
1315 _vala_array_move (self->_items, sizeof (gpointer), _tmp5_, _tmp6_ + _tmp7_, _tmp8_ - _tmp9_);
1316 _tmp10_ = self->_size;
1318 self->_size = _tmp10_ + _tmp11_;
1322 static void gee_array_list_grow_if_needed (GeeArrayList* self, gint new_count) {
1329 gint _tmp4__length1;
1330 g_return_if_fail (self != NULL);
1332 _vala_assert (_tmp0_ >= 0, "new_count >= 0");
1333 _tmp1_ = self->_size;
1335 minimum_size = _tmp1_ + _tmp2_;
1336 _tmp3_ = minimum_size;
1337 _tmp4_ = self->_items;
1338 _tmp4__length1 = self->_items_length1;
1339 if (_tmp3_ > _tmp4__length1) {
1343 gint _tmp7__length1;
1346 _tmp7_ = self->_items;
1347 _tmp7__length1 = self->_items_length1;
1348 if (_tmp6_ > _tmp7__length1) {
1350 _tmp8_ = minimum_size;
1354 gint _tmp9__length1;
1355 _tmp9_ = self->_items;
1356 _tmp9__length1 = self->_items_length1;
1357 _tmp5_ = 2 * _tmp9__length1;
1360 gee_array_list_set_capacity (self, _tmp10_);
1365 static void gee_array_list_set_capacity (GeeArrayList* self, gint value) {
1370 g_return_if_fail (self != NULL);
1372 _tmp1_ = self->_size;
1373 _vala_assert (_tmp0_ >= _tmp1_, "value >= _size");
1376 self->_items = g_renew (gpointer, self->_items, _tmp2_);
1377 (_tmp3_ > self->_items_length1) ? memset (self->_items + self->_items_length1, 0, sizeof (gpointer) * (_tmp3_ - self->_items_length1)) : NULL;
1378 self->_items_length1 = _tmp3_;
1379 self->__items_size_ = _tmp3_;
1383 static gint gee_array_list_real_get_size (GeeAbstractCollection* base) {
1387 self = (GeeArrayList*) base;
1388 _tmp0_ = self->_size;
1394 static gboolean gee_array_list_real_get_read_only (GeeAbstractCollection* base) {
1397 self = (GeeArrayList*) base;
1403 GeeEqualDataFunc gee_array_list_get_equal_func (GeeArrayList* self, gpointer* result_target) {
1404 GeeEqualDataFunc result;
1405 GeeEqualDataFunc _tmp0_;
1406 void* _tmp0__target;
1407 GeeEqualDataFunc _tmp1_;
1408 void* _tmp1__target;
1409 g_return_val_if_fail (self != NULL, NULL);
1410 _tmp0_ = self->priv->_equal_func;
1411 _tmp0__target = self->priv->_equal_func_target;
1413 _tmp1__target = _tmp0__target;
1414 *result_target = _tmp1__target;
1420 static void gee_array_list_set_equal_func (GeeArrayList* self, GeeEqualDataFunc value, gpointer value_target) {
1421 GeeEqualDataFunc _tmp0_;
1422 void* _tmp0__target;
1423 g_return_if_fail (self != NULL);
1425 _tmp0__target = value_target;
1426 (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL);
1427 self->priv->_equal_func = NULL;
1428 self->priv->_equal_func_target = NULL;
1429 self->priv->_equal_func_target_destroy_notify = NULL;
1430 self->priv->_equal_func = _tmp0_;
1431 self->priv->_equal_func_target = _tmp0__target;
1432 self->priv->_equal_func_target_destroy_notify = NULL;
1436 static gpointer _g_object_ref0 (gpointer self) {
1437 return self ? g_object_ref (self) : NULL;
1441 static GeeArrayListIterator* gee_array_list_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list) {
1442 GeeArrayListIterator * self = NULL;
1443 GeeArrayList* _tmp0_;
1444 GeeArrayList* _tmp1_;
1445 GeeArrayList* _tmp2_;
1447 g_return_val_if_fail (list != NULL, NULL);
1448 self = (GeeArrayListIterator*) g_object_new (object_type, NULL);
1449 self->priv->g_type = g_type;
1450 self->priv->g_dup_func = g_dup_func;
1451 self->priv->g_destroy_func = g_destroy_func;
1453 _tmp1_ = _g_object_ref0 (_tmp0_);
1454 _g_object_unref0 (self->priv->_list);
1455 self->priv->_list = _tmp1_;
1456 _tmp2_ = self->priv->_list;
1457 _tmp3_ = _tmp2_->priv->_stamp;
1458 self->priv->_stamp = _tmp3_;
1463 static GeeArrayListIterator* gee_array_list_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeArrayList* list) {
1464 return gee_array_list_iterator_construct (GEE_ARRAY_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, list);
1468 static gboolean gee_array_list_iterator_real_next (GeeIterator* base) {
1469 GeeArrayListIterator * self;
1470 gboolean result = FALSE;
1472 GeeArrayList* _tmp1_;
1475 GeeArrayList* _tmp4_;
1477 self = (GeeArrayListIterator*) base;
1478 _tmp0_ = self->priv->_stamp;
1479 _tmp1_ = self->priv->_list;
1480 _tmp2_ = _tmp1_->priv->_stamp;
1481 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1482 _tmp3_ = self->priv->_index;
1483 _tmp4_ = self->priv->_list;
1484 _tmp5_ = _tmp4_->_size;
1485 if ((_tmp3_ + 1) < _tmp5_) {
1487 _tmp6_ = self->priv->_index;
1488 self->priv->_index = _tmp6_ + 1;
1489 self->priv->_removed = FALSE;
1498 static gboolean gee_array_list_iterator_real_has_next (GeeIterator* base) {
1499 GeeArrayListIterator * self;
1500 gboolean result = FALSE;
1502 GeeArrayList* _tmp1_;
1505 GeeArrayList* _tmp4_;
1507 self = (GeeArrayListIterator*) base;
1508 _tmp0_ = self->priv->_stamp;
1509 _tmp1_ = self->priv->_list;
1510 _tmp2_ = _tmp1_->priv->_stamp;
1511 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1512 _tmp3_ = self->priv->_index;
1513 _tmp4_ = self->priv->_list;
1514 _tmp5_ = _tmp4_->_size;
1515 result = (_tmp3_ + 1) < _tmp5_;
1520 static gboolean gee_array_list_iterator_real_first (GeeBidirIterator* base) {
1521 GeeArrayListIterator * self;
1522 gboolean result = FALSE;
1524 GeeArrayList* _tmp1_;
1526 GeeArrayList* _tmp3_;
1529 self = (GeeArrayListIterator*) base;
1530 _tmp0_ = self->priv->_stamp;
1531 _tmp1_ = self->priv->_list;
1532 _tmp2_ = _tmp1_->priv->_stamp;
1533 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1534 _tmp3_ = self->priv->_list;
1535 _tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp3_);
1541 self->priv->_index = 0;
1542 self->priv->_removed = FALSE;
1548 static gpointer gee_array_list_iterator_real_get (GeeIterator* base) {
1549 GeeArrayListIterator * self;
1550 gpointer result = NULL;
1552 GeeArrayList* _tmp1_;
1556 GeeArrayList* _tmp5_;
1559 GeeArrayList* _tmp8_;
1561 gint _tmp9__length1;
1563 gconstpointer _tmp11_;
1565 self = (GeeArrayListIterator*) base;
1566 _tmp0_ = self->priv->_stamp;
1567 _tmp1_ = self->priv->_list;
1568 _tmp2_ = _tmp1_->priv->_stamp;
1569 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1570 _tmp3_ = self->priv->_index;
1571 _vala_assert (_tmp3_ >= 0, "_index >= 0");
1572 _tmp4_ = self->priv->_index;
1573 _tmp5_ = self->priv->_list;
1574 _tmp6_ = _tmp5_->_size;
1575 _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1576 _tmp7_ = self->priv->_removed;
1577 _vala_assert (!_tmp7_, "! _removed");
1578 _tmp8_ = self->priv->_list;
1579 _tmp9_ = _tmp8_->_items;
1580 _tmp9__length1 = _tmp8_->_items_length1;
1581 _tmp10_ = self->priv->_index;
1582 _tmp11_ = _tmp9_[_tmp10_];
1583 _tmp12_ = ((_tmp11_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp11_) : ((gpointer) _tmp11_);
1589 static void gee_array_list_iterator_real_remove (GeeIterator* base) {
1590 GeeArrayListIterator * self;
1592 GeeArrayList* _tmp1_;
1596 GeeArrayList* _tmp5_;
1599 GeeArrayList* _tmp8_;
1601 gpointer _tmp10_ = NULL;
1604 GeeArrayList* _tmp13_;
1606 self = (GeeArrayListIterator*) base;
1607 _tmp0_ = self->priv->_stamp;
1608 _tmp1_ = self->priv->_list;
1609 _tmp2_ = _tmp1_->priv->_stamp;
1610 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1611 _tmp3_ = self->priv->_index;
1612 _vala_assert (_tmp3_ >= 0, "_index >= 0");
1613 _tmp4_ = self->priv->_index;
1614 _tmp5_ = self->priv->_list;
1615 _tmp6_ = _tmp5_->_size;
1616 _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1617 _tmp7_ = self->priv->_removed;
1618 _vala_assert (!_tmp7_, "! _removed");
1619 _tmp8_ = self->priv->_list;
1620 _tmp9_ = self->priv->_index;
1621 _tmp10_ = gee_abstract_list_remove_at ((GeeAbstractList*) _tmp8_, _tmp9_);
1623 ((_tmp11_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp11_ = (self->priv->g_destroy_func (_tmp11_), NULL));
1624 _tmp12_ = self->priv->_index;
1625 self->priv->_index = _tmp12_ - 1;
1626 self->priv->_removed = TRUE;
1627 _tmp13_ = self->priv->_list;
1628 _tmp14_ = _tmp13_->priv->_stamp;
1629 self->priv->_stamp = _tmp14_;
1633 static gboolean gee_array_list_iterator_real_previous (GeeBidirIterator* base) {
1634 GeeArrayListIterator * self;
1635 gboolean result = FALSE;
1637 GeeArrayList* _tmp1_;
1640 self = (GeeArrayListIterator*) base;
1641 _tmp0_ = self->priv->_stamp;
1642 _tmp1_ = self->priv->_list;
1643 _tmp2_ = _tmp1_->priv->_stamp;
1644 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1645 _tmp3_ = self->priv->_index;
1648 _tmp4_ = self->priv->_index;
1649 self->priv->_index = _tmp4_ - 1;
1658 static gboolean gee_array_list_iterator_real_has_previous (GeeBidirIterator* base) {
1659 GeeArrayListIterator * self;
1660 gboolean result = FALSE;
1662 GeeArrayList* _tmp1_;
1665 self = (GeeArrayListIterator*) base;
1666 _tmp0_ = self->priv->_stamp;
1667 _tmp1_ = self->priv->_list;
1668 _tmp2_ = _tmp1_->priv->_stamp;
1669 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1670 _tmp3_ = self->priv->_index;
1671 result = (_tmp3_ - 1) >= 0;
1676 static gboolean gee_array_list_iterator_real_last (GeeBidirIterator* base) {
1677 GeeArrayListIterator * self;
1678 gboolean result = FALSE;
1680 GeeArrayList* _tmp1_;
1682 GeeArrayList* _tmp3_;
1685 GeeArrayList* _tmp6_;
1687 self = (GeeArrayListIterator*) base;
1688 _tmp0_ = self->priv->_stamp;
1689 _tmp1_ = self->priv->_list;
1690 _tmp2_ = _tmp1_->priv->_stamp;
1691 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1692 _tmp3_ = self->priv->_list;
1693 _tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp3_);
1699 _tmp6_ = self->priv->_list;
1700 _tmp7_ = _tmp6_->_size;
1701 self->priv->_index = _tmp7_ - 1;
1707 static void gee_array_list_iterator_real_set (GeeListIterator* base, gconstpointer item) {
1708 GeeArrayListIterator * self;
1710 GeeArrayList* _tmp1_;
1714 GeeArrayList* _tmp5_;
1716 GeeArrayList* _tmp7_;
1718 gint _tmp8__length1;
1720 gconstpointer _tmp10_;
1723 GeeArrayList* _tmp13_;
1724 GeeArrayList* _tmp14_;
1727 self = (GeeArrayListIterator*) base;
1728 _tmp0_ = self->priv->_stamp;
1729 _tmp1_ = self->priv->_list;
1730 _tmp2_ = _tmp1_->priv->_stamp;
1731 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1732 _tmp3_ = self->priv->_index;
1733 _vala_assert (_tmp3_ >= 0, "_index >= 0");
1734 _tmp4_ = self->priv->_index;
1735 _tmp5_ = self->priv->_list;
1736 _tmp6_ = _tmp5_->_size;
1737 _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1738 _tmp7_ = self->priv->_list;
1739 _tmp8_ = _tmp7_->_items;
1740 _tmp8__length1 = _tmp7_->_items_length1;
1741 _tmp9_ = self->priv->_index;
1743 _tmp11_ = ((_tmp10_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp10_) : ((gpointer) _tmp10_);
1744 ((_tmp8_[_tmp9_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp8_[_tmp9_] = (self->priv->g_destroy_func (_tmp8_[_tmp9_]), NULL));
1745 _tmp8_[_tmp9_] = _tmp11_;
1746 _tmp12_ = _tmp8_[_tmp9_];
1747 _tmp13_ = self->priv->_list;
1748 _tmp14_ = self->priv->_list;
1749 _tmp15_ = _tmp14_->priv->_stamp;
1750 _tmp14_->priv->_stamp = _tmp15_ + 1;
1751 _tmp16_ = _tmp14_->priv->_stamp;
1752 self->priv->_stamp = _tmp16_;
1756 static void gee_array_list_iterator_real_insert (GeeBidirListIterator* base, gconstpointer item) {
1757 GeeArrayListIterator * self;
1759 GeeArrayList* _tmp1_;
1763 GeeArrayList* _tmp5_;
1765 GeeArrayList* _tmp7_;
1767 gconstpointer _tmp9_;
1769 GeeArrayList* _tmp11_;
1771 self = (GeeArrayListIterator*) base;
1772 _tmp0_ = self->priv->_stamp;
1773 _tmp1_ = self->priv->_list;
1774 _tmp2_ = _tmp1_->priv->_stamp;
1775 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1776 _tmp3_ = self->priv->_index;
1777 _vala_assert (_tmp3_ >= 0, "_index >= 0");
1778 _tmp4_ = self->priv->_index;
1779 _tmp5_ = self->priv->_list;
1780 _tmp6_ = _tmp5_->_size;
1781 _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1782 _tmp7_ = self->priv->_list;
1783 _tmp8_ = self->priv->_index;
1785 gee_abstract_list_insert ((GeeAbstractList*) _tmp7_, _tmp8_, _tmp9_);
1786 _tmp10_ = self->priv->_index;
1787 self->priv->_index = _tmp10_ + 1;
1788 _tmp11_ = self->priv->_list;
1789 _tmp12_ = _tmp11_->priv->_stamp;
1790 self->priv->_stamp = _tmp12_;
1794 static void gee_array_list_iterator_real_add (GeeListIterator* base, gconstpointer item) {
1795 GeeArrayListIterator * self;
1797 GeeArrayList* _tmp1_;
1801 GeeArrayList* _tmp5_;
1803 GeeArrayList* _tmp7_;
1805 gconstpointer _tmp9_;
1807 GeeArrayList* _tmp11_;
1809 self = (GeeArrayListIterator*) base;
1810 _tmp0_ = self->priv->_stamp;
1811 _tmp1_ = self->priv->_list;
1812 _tmp2_ = _tmp1_->priv->_stamp;
1813 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1814 _tmp3_ = self->priv->_index;
1815 _vala_assert (_tmp3_ >= 0, "_index >= 0");
1816 _tmp4_ = self->priv->_index;
1817 _tmp5_ = self->priv->_list;
1818 _tmp6_ = _tmp5_->_size;
1819 _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1820 _tmp7_ = self->priv->_list;
1821 _tmp8_ = self->priv->_index;
1823 gee_abstract_list_insert ((GeeAbstractList*) _tmp7_, _tmp8_ + 1, _tmp9_);
1824 _tmp10_ = self->priv->_index;
1825 self->priv->_index = _tmp10_ + 1;
1826 _tmp11_ = self->priv->_list;
1827 _tmp12_ = _tmp11_->priv->_stamp;
1828 self->priv->_stamp = _tmp12_;
1832 static gint gee_array_list_iterator_real_index (GeeListIterator* base) {
1833 GeeArrayListIterator * self;
1836 GeeArrayList* _tmp1_;
1840 GeeArrayList* _tmp5_;
1843 self = (GeeArrayListIterator*) base;
1844 _tmp0_ = self->priv->_stamp;
1845 _tmp1_ = self->priv->_list;
1846 _tmp2_ = _tmp1_->priv->_stamp;
1847 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1848 _tmp3_ = self->priv->_index;
1849 _vala_assert (_tmp3_ >= 0, "_index >= 0");
1850 _tmp4_ = self->priv->_index;
1851 _tmp5_ = self->priv->_list;
1852 _tmp6_ = _tmp5_->_size;
1853 _vala_assert (_tmp4_ < _tmp6_, "_index < _list._size");
1854 _tmp7_ = self->priv->_index;
1860 static gboolean gee_array_list_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
1861 GeeArrayListIterator * self;
1862 gboolean result = FALSE;
1864 GeeArrayList* _tmp1_;
1866 gboolean _tmp3_ = FALSE;
1869 GeeArrayList* _tmp19_;
1871 self = (GeeArrayListIterator*) base;
1872 _tmp0_ = self->priv->_stamp;
1873 _tmp1_ = self->priv->_list;
1874 _tmp2_ = _tmp1_->priv->_stamp;
1875 _vala_assert (_tmp0_ == _tmp2_, "_stamp == _list._stamp");
1876 _tmp4_ = self->priv->_index;
1881 _tmp5_ = self->priv->_removed;
1887 _tmp7_ = self->priv->_index;
1888 self->priv->_index = _tmp7_ + 1;
1892 GeeArrayList* _tmp9_;
1894 GeeForallFunc _tmp11_;
1895 void* _tmp11__target;
1896 GeeArrayList* _tmp12_;
1898 gint _tmp13__length1;
1900 gconstpointer _tmp15_;
1902 gboolean _tmp17_ = FALSE;
1904 _tmp8_ = self->priv->_index;
1905 _tmp9_ = self->priv->_list;
1906 _tmp10_ = _tmp9_->_size;
1907 if (!(_tmp8_ < _tmp10_)) {
1911 _tmp11__target = f_target;
1912 _tmp12_ = self->priv->_list;
1913 _tmp13_ = _tmp12_->_items;
1914 _tmp13__length1 = _tmp12_->_items_length1;
1915 _tmp14_ = self->priv->_index;
1916 _tmp15_ = _tmp13_[_tmp14_];
1917 _tmp16_ = ((_tmp15_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp15_) : ((gpointer) _tmp15_);
1918 _tmp17_ = _tmp11_ (_tmp16_, _tmp11__target);
1923 _tmp18_ = self->priv->_index;
1924 self->priv->_index = _tmp18_ + 1;
1926 _tmp19_ = self->priv->_list;
1927 _tmp20_ = _tmp19_->_size;
1928 self->priv->_index = _tmp20_ - 1;
1934 static gboolean gee_array_list_iterator_real_get_read_only (GeeIterator* base) {
1936 GeeArrayListIterator* self;
1937 self = (GeeArrayListIterator*) base;
1943 static gboolean gee_array_list_iterator_real_get_valid (GeeIterator* base) {
1945 GeeArrayListIterator* self;
1946 gboolean _tmp0_ = FALSE;
1947 gboolean _tmp1_ = FALSE;
1951 self = (GeeArrayListIterator*) base;
1952 _tmp2_ = self->priv->_index;
1955 GeeArrayList* _tmp4_;
1957 _tmp3_ = self->priv->_index;
1958 _tmp4_ = self->priv->_list;
1959 _tmp5_ = _tmp4_->_size;
1960 _tmp1_ = _tmp3_ < _tmp5_;
1967 _tmp7_ = self->priv->_removed;
1978 static void gee_array_list_iterator_class_init (GeeArrayListIteratorClass * klass) {
1979 gee_array_list_iterator_parent_class = g_type_class_peek_parent (klass);
1980 g_type_class_add_private (klass, sizeof (GeeArrayListIteratorPrivate));
1981 G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_list_iterator_get_property;
1982 G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_list_iterator_set_property;
1983 G_OBJECT_CLASS (klass)->finalize = gee_array_list_iterator_finalize;
1984 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
1985 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
1986 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
1987 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
1988 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
1992 static GType gee_array_list_iterator_gee_traversable_get_g_type (GeeArrayListIterator* self) {
1993 return self->priv->g_type;
1997 static GBoxedCopyFunc gee_array_list_iterator_gee_traversable_get_g_dup_func (GeeArrayListIterator* self) {
1998 return self->priv->g_dup_func;
2002 static GDestroyNotify gee_array_list_iterator_gee_traversable_get_g_destroy_func (GeeArrayListIterator* self) {
2003 return self->priv->g_destroy_func;
2007 static void gee_array_list_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
2008 gee_array_list_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
2009 iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_array_list_iterator_real_foreach;
2010 iface->get_g_type = (GType(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_type;
2011 iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_dup_func;
2012 iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_array_list_iterator_gee_traversable_get_g_destroy_func;
2016 static void gee_array_list_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
2017 gee_array_list_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
2018 iface->next = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_next;
2019 iface->has_next = (gboolean (*)(GeeIterator*)) gee_array_list_iterator_real_has_next;
2020 iface->get = (gpointer (*)(GeeIterator*)) gee_array_list_iterator_real_get;
2021 iface->remove = (void (*)(GeeIterator*)) gee_array_list_iterator_real_remove;
2022 iface->get_read_only = gee_array_list_iterator_real_get_read_only;
2023 iface->get_valid = gee_array_list_iterator_real_get_valid;
2027 static GType gee_array_list_iterator_gee_bidir_iterator_get_g_type (GeeArrayListIterator* self) {
2028 return self->priv->g_type;
2032 static GBoxedCopyFunc gee_array_list_iterator_gee_bidir_iterator_get_g_dup_func (GeeArrayListIterator* self) {
2033 return self->priv->g_dup_func;
2037 static GDestroyNotify gee_array_list_iterator_gee_bidir_iterator_get_g_destroy_func (GeeArrayListIterator* self) {
2038 return self->priv->g_destroy_func;
2042 static void gee_array_list_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface) {
2043 gee_array_list_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface);
2044 iface->first = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_first;
2045 iface->previous = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_previous;
2046 iface->has_previous = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_has_previous;
2047 iface->last = (gboolean (*)(GeeBidirIterator*)) gee_array_list_iterator_real_last;
2048 iface->get_g_type = (GType(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_type;
2049 iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_dup_func;
2050 iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirIterator*)) gee_array_list_iterator_gee_bidir_iterator_get_g_destroy_func;
2054 static void gee_array_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface) {
2055 gee_array_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
2056 iface->set = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_set;
2057 iface->add = (void (*)(GeeListIterator*, gconstpointer)) gee_array_list_iterator_real_add;
2058 iface->index = (gint (*)(GeeListIterator*)) gee_array_list_iterator_real_index;
2062 static GType gee_array_list_iterator_gee_bidir_list_iterator_get_g_type (GeeArrayListIterator* self) {
2063 return self->priv->g_type;
2067 static GBoxedCopyFunc gee_array_list_iterator_gee_bidir_list_iterator_get_g_dup_func (GeeArrayListIterator* self) {
2068 return self->priv->g_dup_func;
2072 static GDestroyNotify gee_array_list_iterator_gee_bidir_list_iterator_get_g_destroy_func (GeeArrayListIterator* self) {
2073 return self->priv->g_destroy_func;
2077 static void gee_array_list_iterator_gee_bidir_list_iterator_interface_init (GeeBidirListIteratorIface * iface) {
2078 gee_array_list_iterator_gee_bidir_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
2079 iface->insert = (void (*)(GeeBidirListIterator*, gconstpointer)) gee_array_list_iterator_real_insert;
2080 iface->get_g_type = (GType(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_type;
2081 iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_dup_func;
2082 iface->get_g_destroy_func = (GDestroyNotify(*)(GeeBidirListIterator*)) gee_array_list_iterator_gee_bidir_list_iterator_get_g_destroy_func;
2086 static void gee_array_list_iterator_instance_init (GeeArrayListIterator * self) {
2087 self->priv = GEE_ARRAY_LIST_ITERATOR_GET_PRIVATE (self);
2088 self->priv->_index = -1;
2089 self->priv->_removed = FALSE;
2090 self->priv->_stamp = 0;
2094 static void gee_array_list_iterator_finalize (GObject* obj) {
2095 GeeArrayListIterator * self;
2096 self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator);
2097 _g_object_unref0 (self->priv->_list);
2098 G_OBJECT_CLASS (gee_array_list_iterator_parent_class)->finalize (obj);
2102 static GType gee_array_list_iterator_get_type (void) {
2103 static volatile gsize gee_array_list_iterator_type_id__volatile = 0;
2104 if (g_once_init_enter (&gee_array_list_iterator_type_id__volatile)) {
2105 static const GTypeInfo g_define_type_info = { sizeof (GeeArrayListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayListIterator), 0, (GInstanceInitFunc) gee_array_list_iterator_instance_init, NULL };
2106 static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2107 static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2108 static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2109 static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2110 static const GInterfaceInfo gee_bidir_list_iterator_info = { (GInterfaceInitFunc) gee_array_list_iterator_gee_bidir_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
2111 GType gee_array_list_iterator_type_id;
2112 gee_array_list_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeArrayListIterator", &g_define_type_info, 0);
2113 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
2114 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
2115 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info);
2116 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info);
2117 g_type_add_interface_static (gee_array_list_iterator_type_id, GEE_TYPE_BIDIR_LIST_ITERATOR, &gee_bidir_list_iterator_info);
2118 g_once_init_leave (&gee_array_list_iterator_type_id__volatile, gee_array_list_iterator_type_id);
2120 return gee_array_list_iterator_type_id__volatile;
2124 static void _vala_gee_array_list_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
2125 GeeArrayListIterator * self;
2126 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator);
2127 switch (property_id) {
2128 case GEE_ARRAY_LIST_ITERATOR_READ_ONLY:
2129 g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
2131 case GEE_ARRAY_LIST_ITERATOR_VALID:
2132 g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
2135 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2141 static void _vala_gee_array_list_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
2142 GeeArrayListIterator * self;
2143 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_ARRAY_LIST_TYPE_ITERATOR, GeeArrayListIterator);
2144 switch (property_id) {
2145 case GEE_ARRAY_LIST_ITERATOR_G_TYPE:
2146 self->priv->g_type = g_value_get_gtype (value);
2148 case GEE_ARRAY_LIST_ITERATOR_G_DUP_FUNC:
2149 self->priv->g_dup_func = g_value_get_pointer (value);
2151 case GEE_ARRAY_LIST_ITERATOR_G_DESTROY_FUNC:
2152 self->priv->g_destroy_func = g_value_get_pointer (value);
2155 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2161 static void gee_array_list_class_init (GeeArrayListClass * klass) {
2162 gee_array_list_parent_class = g_type_class_peek_parent (klass);
2163 g_type_class_add_private (klass, sizeof (GeeArrayListPrivate));
2164 GEE_ABSTRACT_COLLECTION_CLASS (klass)->foreach = gee_array_list_real_foreach;
2165 GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_array_list_real_iterator;
2166 GEE_ABSTRACT_LIST_CLASS (klass)->list_iterator = gee_array_list_real_list_iterator;
2167 GEE_ABSTRACT_BIDIR_LIST_CLASS (klass)->bidir_list_iterator = gee_array_list_real_bidir_list_iterator;
2168 GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains = gee_array_list_real_contains;
2169 GEE_ABSTRACT_LIST_CLASS (klass)->index_of = gee_array_list_real_index_of;
2170 GEE_ABSTRACT_LIST_CLASS (klass)->get = gee_array_list_real_get;
2171 GEE_ABSTRACT_LIST_CLASS (klass)->set = gee_array_list_real_set;
2172 GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_array_list_real_add;
2173 GEE_ABSTRACT_LIST_CLASS (klass)->insert = gee_array_list_real_insert;
2174 GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_array_list_real_remove;
2175 GEE_ABSTRACT_LIST_CLASS (klass)->remove_at = gee_array_list_real_remove_at;
2176 GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_array_list_real_clear;
2177 GEE_ABSTRACT_LIST_CLASS (klass)->slice = gee_array_list_real_slice;
2178 GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = gee_array_list_real_get_size;
2179 GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = gee_array_list_real_get_read_only;
2180 G_OBJECT_CLASS (klass)->get_property = _vala_gee_array_list_get_property;
2181 G_OBJECT_CLASS (klass)->set_property = _vala_gee_array_list_set_property;
2182 G_OBJECT_CLASS (klass)->finalize = gee_array_list_finalize;
2183 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
2184 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
2185 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
2189 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
2193 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ARRAY_LIST_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));
2197 static void gee_array_list_instance_init (GeeArrayList * self) {
2198 self->priv = GEE_ARRAY_LIST_GET_PRIVATE (self);
2199 self->priv->_stamp = 0;
2203 static void gee_array_list_finalize (GObject* obj) {
2204 GeeArrayList * self;
2205 self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_ARRAY_LIST, GeeArrayList);
2206 (self->priv->_equal_func_target_destroy_notify == NULL) ? NULL : (self->priv->_equal_func_target_destroy_notify (self->priv->_equal_func_target), NULL);
2207 self->priv->_equal_func = NULL;
2208 self->priv->_equal_func_target = NULL;
2209 self->priv->_equal_func_target_destroy_notify = NULL;
2210 self->_items = (_vala_array_free (self->_items, self->_items_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL);
2211 G_OBJECT_CLASS (gee_array_list_parent_class)->finalize (obj);
2216 * Resizable array implementation of the {@link List} interface.
2218 * The storage array grows automatically when needed.
2220 * This implementation is pretty good for rarely modified data. Because they are
2221 * stored in an array this structure does not fit for highly mutable data. For an
2222 * alternative implementation see {@link LinkedList}.
2226 GType gee_array_list_get_type (void) {
2227 static volatile gsize gee_array_list_type_id__volatile = 0;
2228 if (g_once_init_enter (&gee_array_list_type_id__volatile)) {
2229 static const GTypeInfo g_define_type_info = { sizeof (GeeArrayListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_array_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeArrayList), 0, (GInstanceInitFunc) gee_array_list_instance_init, NULL };
2230 GType gee_array_list_type_id;
2231 gee_array_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_LIST, "GeeArrayList", &g_define_type_info, 0);
2232 g_once_init_leave (&gee_array_list_type_id__volatile, gee_array_list_type_id);
2234 return gee_array_list_type_id__volatile;
2238 static void _vala_gee_array_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
2239 GeeArrayList * self;
2240 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_LIST, GeeArrayList);
2241 switch (property_id) {
2242 case GEE_ARRAY_LIST_SIZE:
2243 g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
2245 case GEE_ARRAY_LIST_READ_ONLY:
2246 g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
2249 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2255 static void _vala_gee_array_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
2256 GeeArrayList * self;
2257 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ARRAY_LIST, GeeArrayList);
2258 switch (property_id) {
2259 case GEE_ARRAY_LIST_G_TYPE:
2260 self->priv->g_type = g_value_get_gtype (value);
2262 case GEE_ARRAY_LIST_G_DUP_FUNC:
2263 self->priv->g_dup_func = g_value_get_pointer (value);
2265 case GEE_ARRAY_LIST_G_DESTROY_FUNC:
2266 self->priv->g_destroy_func = g_value_get_pointer (value);
2269 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2275 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2276 if ((array != NULL) && (destroy_func != NULL)) {
2278 for (i = 0; i < array_length; i = i + 1) {
2279 if (((gpointer*) array)[i] != NULL) {
2280 destroy_func (((gpointer*) array)[i]);
2287 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2288 _vala_array_destroy (array, array_length, destroy_func);
2293 static void _vala_array_move (gpointer array, gsize element_size, gint src, gint dest, gint length) {
2294 g_memmove (((char*) array) + (dest * element_size), ((char*) array) + (src * element_size), length * element_size);
2295 if ((src < dest) && ((src + length) > dest)) {
2296 memset (((char*) array) + (src * element_size), 0, (dest - src) * element_size);
2297 } else if ((src > dest) && (src < (dest + length))) {
2298 memset (((char*) array) + ((dest + length) * element_size), 0, (src - dest) * element_size);
2299 } else if (src != dest) {
2300 memset (((char*) array) + (src * element_size), 0, length * element_size);