1 /* unfolditerator.c generated by valac 0.18.0, the Vala compiler
2 * generated from unfolditerator.vala, do not modify */
6 * Copyright (C) 2011 Maciej Piechotka
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 * Maciej Piechotka <uzytkownik2@gmail.com>
27 #include <glib-object.h>
30 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
31 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
32 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
33 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
35 typedef struct _GeeTraversable GeeTraversable;
36 typedef struct _GeeTraversableIface GeeTraversableIface;
38 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
40 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
41 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
42 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
43 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
44 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
45 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
47 typedef struct _GeeLazy GeeLazy;
48 typedef struct _GeeLazyClass GeeLazyClass;
50 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
51 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
52 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
53 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
55 typedef struct _GeeIterator GeeIterator;
56 typedef struct _GeeIteratorIface GeeIteratorIface;
58 #define GEE_TYPE_UNFOLD_ITERATOR (gee_unfold_iterator_get_type ())
59 #define GEE_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator))
60 #define GEE_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass))
61 #define GEE_IS_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_UNFOLD_ITERATOR))
62 #define GEE_IS_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_UNFOLD_ITERATOR))
63 #define GEE_UNFOLD_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass))
65 typedef struct _GeeUnfoldIterator GeeUnfoldIterator;
66 typedef struct _GeeUnfoldIteratorClass GeeUnfoldIteratorClass;
67 typedef struct _GeeUnfoldIteratorPrivate GeeUnfoldIteratorPrivate;
68 #define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL)))
69 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
71 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
73 GEE_TRAVERSABLE_STREAM_YIELD,
74 GEE_TRAVERSABLE_STREAM_CONTINUE,
75 GEE_TRAVERSABLE_STREAM_END
76 } GeeTraversableStream;
78 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
79 struct _GeeIteratorIface {
80 GTypeInterface parent_iface;
81 gboolean (*next) (GeeIterator* self);
82 gboolean (*has_next) (GeeIterator* self);
83 gpointer (*get) (GeeIterator* self);
84 void (*remove) (GeeIterator* self);
85 gboolean (*get_valid) (GeeIterator* self);
86 gboolean (*get_read_only) (GeeIterator* self);
89 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
90 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
91 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
92 struct _GeeTraversableIface {
93 GTypeInterface parent_iface;
94 GType (*get_g_type) (GeeTraversable* self);
95 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
96 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
97 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
98 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);
99 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
100 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
101 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
102 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
103 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
104 GType (*get_element_type) (GeeTraversable* self);
107 struct _GeeUnfoldIterator {
108 GObject parent_instance;
109 GeeUnfoldIteratorPrivate * priv;
112 struct _GeeUnfoldIteratorClass {
113 GObjectClass parent_class;
116 typedef GeeLazy* (*GeeUnfoldFunc) (void* user_data);
117 struct _GeeUnfoldIteratorPrivate {
119 GBoxedCopyFunc g_dup_func;
120 GDestroyNotify g_destroy_func;
122 gpointer _func_target;
123 GDestroyNotify _func_target_destroy_notify;
130 static gpointer gee_unfold_iterator_parent_class = NULL;
131 static GeeTraversableIface* gee_unfold_iterator_gee_traversable_parent_iface = NULL;
132 static GeeIteratorIface* gee_unfold_iterator_gee_iterator_parent_iface = NULL;
134 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
135 gpointer gee_lazy_ref (gpointer instance);
136 void gee_lazy_unref (gpointer instance);
137 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
138 void gee_value_set_lazy (GValue* value, gpointer v_object);
139 void gee_value_take_lazy (GValue* value, gpointer v_object);
140 gpointer gee_value_get_lazy (const GValue* value);
141 GType gee_lazy_get_type (void) G_GNUC_CONST;
142 GType gee_iterator_get_type (void) G_GNUC_CONST;
143 GType gee_traversable_get_type (void) G_GNUC_CONST;
144 GType gee_unfold_iterator_get_type (void) G_GNUC_CONST;
145 #define GEE_UNFOLD_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorPrivate))
147 GEE_UNFOLD_ITERATOR_DUMMY_PROPERTY,
148 GEE_UNFOLD_ITERATOR_G_TYPE,
149 GEE_UNFOLD_ITERATOR_G_DUP_FUNC,
150 GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC,
151 GEE_UNFOLD_ITERATOR_VALID,
152 GEE_UNFOLD_ITERATOR_READ_ONLY
154 GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current);
155 GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current);
156 static gboolean gee_unfold_iterator_real_next (GeeIterator* base);
157 gboolean gee_iterator_has_next (GeeIterator* self);
158 void gee_lazy_eval (GeeLazy* self);
159 static gboolean gee_unfold_iterator_real_has_next (GeeIterator* base);
160 static gpointer gee_unfold_iterator_real_get (GeeIterator* base);
161 gconstpointer gee_lazy_get_value (GeeLazy* self);
162 static void gee_unfold_iterator_real_remove (GeeIterator* base);
163 static gboolean gee_unfold_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
164 static void gee_unfold_iterator_finalize (GObject* obj);
165 gboolean gee_iterator_get_valid (GeeIterator* self);
166 gboolean gee_iterator_get_read_only (GeeIterator* self);
167 static void _vala_gee_unfold_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
168 static void _vala_gee_unfold_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
171 GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current) {
172 GeeUnfoldIterator * self = NULL;
174 GeeUnfoldFunc _tmp1_;
176 GDestroyNotify _tmp1__target_destroy_notify;
177 self = (GeeUnfoldIterator*) g_object_new (object_type, NULL);
178 self->priv->g_type = g_type;
179 self->priv->g_dup_func = g_dup_func;
180 self->priv->g_destroy_func = g_destroy_func;
183 _gee_lazy_unref0 (self->priv->_current);
184 self->priv->_current = _tmp0_;
186 _tmp1__target = func_target;
187 _tmp1__target_destroy_notify = func_target_destroy_notify;
188 func_target_destroy_notify = NULL;
189 (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL);
190 self->priv->_func = NULL;
191 self->priv->_func_target = NULL;
192 self->priv->_func_target_destroy_notify = NULL;
193 self->priv->_func = _tmp1_;
194 self->priv->_func_target = _tmp1__target;
195 self->priv->_func_target_destroy_notify = _tmp1__target_destroy_notify;
196 self->priv->_end = FALSE;
197 (func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL);
200 func_target_destroy_notify = NULL;
201 _gee_lazy_unref0 (current);
206 GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeUnfoldFunc func, void* func_target, GDestroyNotify func_target_destroy_notify, GeeLazy* current) {
207 return gee_unfold_iterator_construct (GEE_TYPE_UNFOLD_ITERATOR, g_type, g_dup_func, g_destroy_func, func, func_target, func_target_destroy_notify, current);
211 static gboolean gee_unfold_iterator_real_next (GeeIterator* base) {
212 GeeUnfoldIterator * self;
213 gboolean result = FALSE;
214 gboolean _tmp0_ = FALSE;
215 self = (GeeUnfoldIterator*) base;
216 _tmp0_ = gee_iterator_has_next ((GeeIterator*) self);
220 _tmp1_ = self->priv->_current;
221 if (_tmp1_ != NULL) {
223 _tmp2_ = self->priv->_current;
224 gee_lazy_eval (_tmp2_);
226 _tmp3_ = self->priv->_next;
227 self->priv->_next = NULL;
228 _gee_lazy_unref0 (self->priv->_current);
229 self->priv->_current = _tmp3_;
238 static gboolean gee_unfold_iterator_real_has_next (GeeIterator* base) {
239 GeeUnfoldIterator * self;
240 gboolean result = FALSE;
243 GeeUnfoldFunc _tmp2_;
245 GeeLazy* _tmp3_ = NULL;
248 self = (GeeUnfoldIterator*) base;
249 _tmp0_ = self->priv->_end;
254 _tmp1_ = self->priv->_next;
255 if (_tmp1_ != NULL) {
259 _tmp2_ = self->priv->_func;
260 _tmp2__target = self->priv->_func_target;
261 _tmp3_ = _tmp2_ (_tmp2__target);
262 _gee_lazy_unref0 (self->priv->_next);
263 self->priv->_next = _tmp3_;
264 _tmp4_ = self->priv->_next;
265 if (_tmp4_ == NULL) {
266 self->priv->_end = TRUE;
268 _tmp5_ = self->priv->_next;
269 result = _tmp5_ != NULL;
274 static gpointer gee_unfold_iterator_real_get (GeeIterator* base) {
275 GeeUnfoldIterator * self;
276 gpointer result = NULL;
279 gconstpointer _tmp2_;
280 gconstpointer _tmp3_;
282 self = (GeeUnfoldIterator*) base;
283 _tmp0_ = self->priv->_current;
284 _vala_assert (_tmp0_ != NULL, "_current != null");
285 _tmp1_ = self->priv->_current;
286 _tmp2_ = gee_lazy_get_value (_tmp1_);
288 _tmp4_ = ((_tmp3_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_);
294 static void gee_unfold_iterator_real_remove (GeeIterator* base) {
295 GeeUnfoldIterator * self;
296 self = (GeeUnfoldIterator*) base;
297 g_assert_not_reached ();
301 static gboolean gee_unfold_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
302 GeeUnfoldIterator * self;
303 gboolean result = FALSE;
307 self = (GeeUnfoldIterator*) base;
308 _tmp0_ = self->priv->_current;
309 if (_tmp0_ != NULL) {
310 GeeForallFunc _tmp1_;
314 gboolean _tmp4_ = FALSE;
316 _tmp1__target = f_target;
317 _tmp2_ = self->priv->_current;
318 _tmp3_ = ((_tmp2_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp2_) : ((gpointer) _tmp2_);
319 _tmp4_ = _tmp1_ (_tmp3_, _tmp1__target);
325 _tmp5_ = self->priv->_next;
326 if (_tmp5_ != NULL) {
328 GeeForallFunc _tmp7_;
332 gboolean _tmp10_ = FALSE;
333 _tmp6_ = self->priv->_next;
334 self->priv->_next = NULL;
335 _gee_lazy_unref0 (self->priv->_current);
336 self->priv->_current = _tmp6_;
338 _tmp7__target = f_target;
339 _tmp8_ = self->priv->_current;
340 _tmp9_ = ((_tmp8_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp8_) : ((gpointer) _tmp8_);
341 _tmp10_ = _tmp7_ (_tmp9_, _tmp7__target);
348 _tmp11_ = self->priv->_end;
354 _tmp12_ = self->priv->_current;
355 if (_tmp12_ == NULL) {
356 GeeUnfoldFunc _tmp13_;
357 void* _tmp13__target;
358 GeeLazy* _tmp14_ = NULL;
360 _tmp13_ = self->priv->_func;
361 _tmp13__target = self->priv->_func_target;
362 _tmp14_ = _tmp13_ (_tmp13__target);
363 _gee_lazy_unref0 (self->priv->_current);
364 self->priv->_current = _tmp14_;
365 _tmp15_ = self->priv->_current;
366 if (_tmp15_ == NULL) {
367 self->priv->_end = TRUE;
371 GeeForallFunc _tmp16_;
372 void* _tmp16__target;
375 gboolean _tmp19_ = FALSE;
377 _tmp16__target = f_target;
378 _tmp17_ = self->priv->_current;
379 _tmp18_ = ((_tmp17_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp17_) : ((gpointer) _tmp17_);
380 _tmp19_ = _tmp16_ (_tmp18_, _tmp16__target);
388 GeeUnfoldFunc _tmp20_;
389 void* _tmp20__target;
390 GeeLazy* _tmp21_ = NULL;
393 GeeForallFunc _tmp24_;
394 void* _tmp24__target;
397 gboolean _tmp27_ = FALSE;
398 _tmp20_ = self->priv->_func;
399 _tmp20__target = self->priv->_func_target;
400 _tmp21_ = _tmp20_ (_tmp20__target);
401 _gee_lazy_unref0 (self->priv->_next);
402 self->priv->_next = _tmp21_;
403 _tmp22_ = self->priv->_next;
404 if (!(_tmp22_ != NULL)) {
407 _tmp23_ = self->priv->_next;
408 self->priv->_next = NULL;
409 _gee_lazy_unref0 (self->priv->_current);
410 self->priv->_current = _tmp23_;
412 _tmp24__target = f_target;
413 _tmp25_ = self->priv->_current;
414 _tmp26_ = ((_tmp25_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp25_) : ((gpointer) _tmp25_);
415 _tmp27_ = _tmp24_ (_tmp26_, _tmp24__target);
421 self->priv->_end = TRUE;
427 static gboolean gee_unfold_iterator_real_get_valid (GeeIterator* base) {
429 GeeUnfoldIterator* self;
431 self = (GeeUnfoldIterator*) base;
432 _tmp0_ = self->priv->_current;
433 result = _tmp0_ != NULL;
438 static gboolean gee_unfold_iterator_real_get_read_only (GeeIterator* base) {
440 GeeUnfoldIterator* self;
441 self = (GeeUnfoldIterator*) base;
447 static void gee_unfold_iterator_class_init (GeeUnfoldIteratorClass * klass) {
448 gee_unfold_iterator_parent_class = g_type_class_peek_parent (klass);
449 g_type_class_add_private (klass, sizeof (GeeUnfoldIteratorPrivate));
450 G_OBJECT_CLASS (klass)->get_property = _vala_gee_unfold_iterator_get_property;
451 G_OBJECT_CLASS (klass)->set_property = _vala_gee_unfold_iterator_set_property;
452 G_OBJECT_CLASS (klass)->finalize = gee_unfold_iterator_finalize;
453 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_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));
454 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_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));
455 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_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));
456 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_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));
457 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_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));
461 static GType gee_unfold_iterator_gee_traversable_get_g_type (GeeUnfoldIterator* self) {
462 return self->priv->g_type;
466 static GBoxedCopyFunc gee_unfold_iterator_gee_traversable_get_g_dup_func (GeeUnfoldIterator* self) {
467 return self->priv->g_dup_func;
471 static GDestroyNotify gee_unfold_iterator_gee_traversable_get_g_destroy_func (GeeUnfoldIterator* self) {
472 return self->priv->g_destroy_func;
476 static void gee_unfold_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
477 gee_unfold_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
478 iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_unfold_iterator_real_foreach;
479 iface->get_g_type = (GType(*)(GeeTraversable*)) gee_unfold_iterator_gee_traversable_get_g_type;
480 iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_unfold_iterator_gee_traversable_get_g_dup_func;
481 iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_unfold_iterator_gee_traversable_get_g_destroy_func;
485 static void gee_unfold_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
486 gee_unfold_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
487 iface->next = (gboolean (*)(GeeIterator*)) gee_unfold_iterator_real_next;
488 iface->has_next = (gboolean (*)(GeeIterator*)) gee_unfold_iterator_real_has_next;
489 iface->get = (gpointer (*)(GeeIterator*)) gee_unfold_iterator_real_get;
490 iface->remove = (void (*)(GeeIterator*)) gee_unfold_iterator_real_remove;
491 iface->get_valid = gee_unfold_iterator_real_get_valid;
492 iface->get_read_only = gee_unfold_iterator_real_get_read_only;
496 static void gee_unfold_iterator_instance_init (GeeUnfoldIterator * self) {
497 self->priv = GEE_UNFOLD_ITERATOR_GET_PRIVATE (self);
501 static void gee_unfold_iterator_finalize (GObject* obj) {
502 GeeUnfoldIterator * self;
503 self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator);
504 (self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL);
505 self->priv->_func = NULL;
506 self->priv->_func_target = NULL;
507 self->priv->_func_target_destroy_notify = NULL;
508 _gee_lazy_unref0 (self->priv->_current);
509 _gee_lazy_unref0 (self->priv->_next);
510 G_OBJECT_CLASS (gee_unfold_iterator_parent_class)->finalize (obj);
514 GType gee_unfold_iterator_get_type (void) {
515 static volatile gsize gee_unfold_iterator_type_id__volatile = 0;
516 if (g_once_init_enter (&gee_unfold_iterator_type_id__volatile)) {
517 static const GTypeInfo g_define_type_info = { sizeof (GeeUnfoldIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_unfold_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeUnfoldIterator), 0, (GInstanceInitFunc) gee_unfold_iterator_instance_init, NULL };
518 static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_unfold_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
519 static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_unfold_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
520 GType gee_unfold_iterator_type_id;
521 gee_unfold_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeUnfoldIterator", &g_define_type_info, 0);
522 g_type_add_interface_static (gee_unfold_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
523 g_type_add_interface_static (gee_unfold_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
524 g_once_init_leave (&gee_unfold_iterator_type_id__volatile, gee_unfold_iterator_type_id);
526 return gee_unfold_iterator_type_id__volatile;
530 static void _vala_gee_unfold_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
531 GeeUnfoldIterator * self;
532 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator);
533 switch (property_id) {
534 case GEE_UNFOLD_ITERATOR_VALID:
535 g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
537 case GEE_UNFOLD_ITERATOR_READ_ONLY:
538 g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
541 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
547 static void _vala_gee_unfold_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
548 GeeUnfoldIterator * self;
549 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator);
550 switch (property_id) {
551 case GEE_UNFOLD_ITERATOR_G_TYPE:
552 self->priv->g_type = g_value_get_gtype (value);
554 case GEE_UNFOLD_ITERATOR_G_DUP_FUNC:
555 self->priv->g_dup_func = g_value_get_pointer (value);
557 case GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC:
558 self->priv->g_destroy_func = g_value_get_pointer (value);
561 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);