/* unfolditerator.c generated by valac 0.56.3, the Vala compiler
 * generated from unfolditerator.vala, do not modify */

/* unfolditerator.vala
 *
 * Copyright (C) 2011  Maciej Piechotka
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Maciej Piechotka <uzytkownik2@gmail.com>
 */

#include <glib-object.h>
#include "gee.h"
#include <glib.h>

#define GEE_TYPE_UNFOLD_ITERATOR (gee_unfold_iterator_get_type ())
#define GEE_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator))
#define GEE_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass))
#define GEE_IS_UNFOLD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_UNFOLD_ITERATOR))
#define GEE_IS_UNFOLD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_UNFOLD_ITERATOR))
#define GEE_UNFOLD_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIteratorClass))

typedef struct _GeeUnfoldIterator GeeUnfoldIterator;
typedef struct _GeeUnfoldIteratorClass GeeUnfoldIteratorClass;
typedef struct _GeeUnfoldIteratorPrivate GeeUnfoldIteratorPrivate;
enum  {
	GEE_UNFOLD_ITERATOR_0_PROPERTY,
	GEE_UNFOLD_ITERATOR_G_TYPE,
	GEE_UNFOLD_ITERATOR_G_DUP_FUNC,
	GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC,
	GEE_UNFOLD_ITERATOR_VALID_PROPERTY,
	GEE_UNFOLD_ITERATOR_READ_ONLY_PROPERTY,
	GEE_UNFOLD_ITERATOR_NUM_PROPERTIES
};
static GParamSpec* gee_unfold_iterator_properties[GEE_UNFOLD_ITERATOR_NUM_PROPERTIES];
#define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GeeUnfoldIterator {
	GObject parent_instance;
	GeeUnfoldIteratorPrivate * priv;
};

struct _GeeUnfoldIteratorClass {
	GObjectClass parent_class;
};

struct _GeeUnfoldIteratorPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeUnfoldFunc _func;
	gpointer _func_target;
	GDestroyNotify _func_target_destroy_notify;
	GeeLazy* _current;
	GeeLazy* _next;
	gboolean _end;
};

static gint GeeUnfoldIterator_private_offset;
static gpointer gee_unfold_iterator_parent_class = NULL;
static GeeTraversableIface * gee_unfold_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface * gee_unfold_iterator_gee_iterator_parent_iface = NULL;

 G_GNUC_INTERNAL GType gee_unfold_iterator_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GeeUnfoldIterator* gee_unfold_iterator_new (GType g_type,
                                            GBoxedCopyFunc g_dup_func,
                                            GDestroyNotify g_destroy_func,
                                            GeeUnfoldFunc func,
                                            gpointer func_target,
                                            GDestroyNotify func_target_destroy_notify,
                                            GeeLazy* current);
 G_GNUC_INTERNAL GeeUnfoldIterator* gee_unfold_iterator_construct (GType object_type,
                                                  GType g_type,
                                                  GBoxedCopyFunc g_dup_func,
                                                  GDestroyNotify g_destroy_func,
                                                  GeeUnfoldFunc func,
                                                  gpointer func_target,
                                                  GDestroyNotify func_target_destroy_notify,
                                                  GeeLazy* current);
static gboolean gee_unfold_iterator_real_next (GeeIterator* base);
static gboolean gee_unfold_iterator_real_has_next (GeeIterator* base);
static gpointer gee_unfold_iterator_real_get (GeeIterator* base);
static void gee_unfold_iterator_real_remove (GeeIterator* base);
static gboolean gee_unfold_iterator_real_foreach (GeeTraversable* base,
                                           GeeForallFunc f,
                                           gpointer f_target);
static void gee_unfold_iterator_finalize (GObject * obj);
static GType gee_unfold_iterator_get_type_once (void);
static void _vala_gee_unfold_iterator_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_gee_unfold_iterator_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);

static inline gpointer
gee_unfold_iterator_get_instance_private (GeeUnfoldIterator* self)
{
	return G_STRUCT_MEMBER_P (self, GeeUnfoldIterator_private_offset);
}

 G_GNUC_INTERNAL GeeUnfoldIterator*
gee_unfold_iterator_construct (GType object_type,
                               GType g_type,
                               GBoxedCopyFunc g_dup_func,
                               GDestroyNotify g_destroy_func,
                               GeeUnfoldFunc func,
                               gpointer func_target,
                               GDestroyNotify func_target_destroy_notify,
                               GeeLazy* current)
{
	GeeUnfoldIterator * self = NULL;
	GeeLazy* _tmp0_;
	GeeUnfoldFunc _tmp1_;
	gpointer _tmp1__target;
	GDestroyNotify _tmp1__target_destroy_notify;
	self = (GeeUnfoldIterator*) g_object_new (object_type, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = current;
	current = NULL;
	_gee_lazy_unref0 (self->priv->_current);
	self->priv->_current = _tmp0_;
	_tmp1_ = func;
	_tmp1__target = func_target;
	_tmp1__target_destroy_notify = func_target_destroy_notify;
	func = NULL;
	func_target = NULL;
	func_target_destroy_notify = NULL;
	(self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL);
	self->priv->_func = NULL;
	self->priv->_func_target = NULL;
	self->priv->_func_target_destroy_notify = NULL;
	self->priv->_func = _tmp1_;
	self->priv->_func_target = _tmp1__target;
	self->priv->_func_target_destroy_notify = _tmp1__target_destroy_notify;
	self->priv->_end = FALSE;
	(func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL);
	func = NULL;
	func_target = NULL;
	func_target_destroy_notify = NULL;
	_gee_lazy_unref0 (current);
	return self;
}

 G_GNUC_INTERNAL GeeUnfoldIterator*
gee_unfold_iterator_new (GType g_type,
                         GBoxedCopyFunc g_dup_func,
                         GDestroyNotify g_destroy_func,
                         GeeUnfoldFunc func,
                         gpointer func_target,
                         GDestroyNotify func_target_destroy_notify,
                         GeeLazy* current)
{
	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);
}

static gboolean
gee_unfold_iterator_real_next (GeeIterator* base)
{
	GeeUnfoldIterator * self;
	gboolean result;
	self = (GeeUnfoldIterator*) base;
	if (gee_iterator_has_next ((GeeIterator*) self)) {
		GeeLazy* _tmp0_;
		GeeLazy* _tmp2_;
		_tmp0_ = self->priv->_current;
		if (_tmp0_ != NULL) {
			GeeLazy* _tmp1_;
			_tmp1_ = self->priv->_current;
			gee_lazy_eval (_tmp1_);
		}
		_tmp2_ = self->priv->_next;
		self->priv->_next = NULL;
		_gee_lazy_unref0 (self->priv->_current);
		self->priv->_current = _tmp2_;
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
gee_unfold_iterator_real_has_next (GeeIterator* base)
{
	GeeUnfoldIterator * self;
	GeeLazy* _tmp0_;
	GeeUnfoldFunc _tmp1_;
	gpointer _tmp1__target;
	GeeLazy* _tmp2_;
	GeeLazy* _tmp3_;
	GeeLazy* _tmp4_;
	gboolean result;
	self = (GeeUnfoldIterator*) base;
	if (self->priv->_end) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->_next;
	if (_tmp0_ != NULL) {
		result = TRUE;
		return result;
	}
	_tmp1_ = self->priv->_func;
	_tmp1__target = self->priv->_func_target;
	_tmp2_ = _tmp1_ (_tmp1__target);
	_gee_lazy_unref0 (self->priv->_next);
	self->priv->_next = _tmp2_;
	_tmp3_ = self->priv->_next;
	if (_tmp3_ == NULL) {
		self->priv->_end = TRUE;
	}
	_tmp4_ = self->priv->_next;
	result = _tmp4_ != NULL;
	return result;
}

static gpointer
gee_unfold_iterator_real_get (GeeIterator* base)
{
	GeeUnfoldIterator * self;
	GeeLazy* _tmp0_;
	GeeLazy* _tmp1_;
	gconstpointer _tmp2_;
	gconstpointer _tmp3_;
	gpointer _tmp4_;
	gpointer result;
	self = (GeeUnfoldIterator*) base;
	_tmp0_ = self->priv->_current;
	_vala_assert (_tmp0_ != NULL, "_current != null");
	_tmp1_ = self->priv->_current;
	_tmp2_ = gee_lazy_get_value (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = ((_tmp3_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_);
	result = _tmp4_;
	return result;
}

static void
gee_unfold_iterator_real_remove (GeeIterator* base)
{
	GeeUnfoldIterator * self;
	self = (GeeUnfoldIterator*) base;
	g_assert_not_reached ();
}

static gboolean
gee_unfold_iterator_real_foreach (GeeTraversable* base,
                                  GeeForallFunc f,
                                  gpointer f_target)
{
	GeeUnfoldIterator * self;
	GeeLazy* _tmp0_;
	GeeLazy* _tmp5_;
	GeeLazy* _tmp11_;
	gboolean result;
	self = (GeeUnfoldIterator*) base;
	_tmp0_ = self->priv->_current;
	if (_tmp0_ != NULL) {
		GeeLazy* _tmp1_;
		gconstpointer _tmp2_;
		gconstpointer _tmp3_;
		gpointer _tmp4_;
		_tmp1_ = self->priv->_current;
		_tmp2_ = gee_lazy_get_value (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = ((_tmp3_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp3_) : ((gpointer) _tmp3_);
		if (!f (_tmp4_, f_target)) {
			result = FALSE;
			return result;
		}
	}
	_tmp5_ = self->priv->_next;
	if (_tmp5_ != NULL) {
		GeeLazy* _tmp6_;
		GeeLazy* _tmp7_;
		gconstpointer _tmp8_;
		gconstpointer _tmp9_;
		gpointer _tmp10_;
		_tmp6_ = self->priv->_next;
		self->priv->_next = NULL;
		_gee_lazy_unref0 (self->priv->_current);
		self->priv->_current = _tmp6_;
		_tmp7_ = self->priv->_current;
		_tmp8_ = gee_lazy_get_value (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = ((_tmp9_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp9_) : ((gpointer) _tmp9_);
		if (!f (_tmp10_, f_target)) {
			result = FALSE;
			return result;
		}
	} else {
		if (self->priv->_end) {
			result = TRUE;
			return result;
		}
	}
	_tmp11_ = self->priv->_current;
	if (_tmp11_ == NULL) {
		GeeUnfoldFunc _tmp12_;
		gpointer _tmp12__target;
		GeeLazy* _tmp13_;
		GeeLazy* _tmp14_;
		_tmp12_ = self->priv->_func;
		_tmp12__target = self->priv->_func_target;
		_tmp13_ = _tmp12_ (_tmp12__target);
		_gee_lazy_unref0 (self->priv->_current);
		self->priv->_current = _tmp13_;
		_tmp14_ = self->priv->_current;
		if (_tmp14_ == NULL) {
			self->priv->_end = TRUE;
			result = TRUE;
			return result;
		} else {
			GeeLazy* _tmp15_;
			gconstpointer _tmp16_;
			gconstpointer _tmp17_;
			gpointer _tmp18_;
			_tmp15_ = self->priv->_current;
			_tmp16_ = gee_lazy_get_value (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = ((_tmp17_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp17_) : ((gpointer) _tmp17_);
			if (!f (_tmp18_, f_target)) {
				result = FALSE;
				return result;
			}
		}
	}
	while (TRUE) {
		GeeUnfoldFunc _tmp19_;
		gpointer _tmp19__target;
		GeeLazy* _tmp20_;
		GeeLazy* _tmp21_;
		GeeLazy* _tmp22_;
		GeeLazy* _tmp23_;
		gconstpointer _tmp24_;
		gconstpointer _tmp25_;
		gpointer _tmp26_;
		_tmp19_ = self->priv->_func;
		_tmp19__target = self->priv->_func_target;
		_tmp20_ = _tmp19_ (_tmp19__target);
		_gee_lazy_unref0 (self->priv->_next);
		self->priv->_next = _tmp20_;
		_tmp21_ = self->priv->_next;
		if (!(_tmp21_ != NULL)) {
			break;
		}
		_tmp22_ = self->priv->_next;
		self->priv->_next = NULL;
		_gee_lazy_unref0 (self->priv->_current);
		self->priv->_current = _tmp22_;
		_tmp23_ = self->priv->_current;
		_tmp24_ = gee_lazy_get_value (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = ((_tmp25_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp25_) : ((gpointer) _tmp25_);
		if (!f (_tmp26_, f_target)) {
			result = FALSE;
			return result;
		}
	}
	self->priv->_end = TRUE;
	result = TRUE;
	return result;
}

static gboolean
gee_unfold_iterator_real_get_valid (GeeIterator* base)
{
	gboolean result;
	GeeUnfoldIterator* self;
	GeeLazy* _tmp0_;
	self = (GeeUnfoldIterator*) base;
	_tmp0_ = self->priv->_current;
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
gee_unfold_iterator_real_get_read_only (GeeIterator* base)
{
	gboolean result;
	GeeUnfoldIterator* self;
	self = (GeeUnfoldIterator*) base;
	result = TRUE;
	return result;
}

static void
gee_unfold_iterator_class_init (GeeUnfoldIteratorClass * klass,
                                gpointer klass_data)
{
	gee_unfold_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GeeUnfoldIterator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_unfold_iterator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_unfold_iterator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_unfold_iterator_finalize;
	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_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	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_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	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_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_VALID_PROPERTY, gee_unfold_iterator_properties[GEE_UNFOLD_ITERATOR_VALID_PROPERTY] = g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_UNFOLD_ITERATOR_READ_ONLY_PROPERTY, gee_unfold_iterator_properties[GEE_UNFOLD_ITERATOR_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
gee_unfold_iterator_gee_traversable_get_g_type (GeeUnfoldIterator* self)
{
	return self->priv->g_type;
}

static GBoxedCopyFunc
gee_unfold_iterator_gee_traversable_get_g_dup_func (GeeUnfoldIterator* self)
{
	return self->priv->g_dup_func;
}

static GDestroyNotify
gee_unfold_iterator_gee_traversable_get_g_destroy_func (GeeUnfoldIterator* self)
{
	return self->priv->g_destroy_func;
}

static void
gee_unfold_iterator_gee_traversable_interface_init (GeeTraversableIface * iface,
                                                    gpointer iface_data)
{
	gee_unfold_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*) (GeeTraversable*, GeeForallFunc, gpointer)) gee_unfold_iterator_real_foreach;
	iface->get_g_type = (GType (*) (GeeTraversable *)) gee_unfold_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeTraversable *)) gee_unfold_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeTraversable *)) gee_unfold_iterator_gee_traversable_get_g_destroy_func;
}

static void
gee_unfold_iterator_gee_iterator_interface_init (GeeIteratorIface * iface,
                                                 gpointer iface_data)
{
	gee_unfold_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->next = (gboolean (*) (GeeIterator*)) gee_unfold_iterator_real_next;
	iface->has_next = (gboolean (*) (GeeIterator*)) gee_unfold_iterator_real_has_next;
	iface->get = (gpointer (*) (GeeIterator*)) gee_unfold_iterator_real_get;
	iface->remove = (void (*) (GeeIterator*)) gee_unfold_iterator_real_remove;
	iface->get_valid = gee_unfold_iterator_real_get_valid;
	iface->get_read_only = gee_unfold_iterator_real_get_read_only;
}

static void
gee_unfold_iterator_instance_init (GeeUnfoldIterator * self,
                                   gpointer klass)
{
	self->priv = gee_unfold_iterator_get_instance_private (self);
}

static void
gee_unfold_iterator_finalize (GObject * obj)
{
	GeeUnfoldIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator);
	(self->priv->_func_target_destroy_notify == NULL) ? NULL : (self->priv->_func_target_destroy_notify (self->priv->_func_target), NULL);
	self->priv->_func = NULL;
	self->priv->_func_target = NULL;
	self->priv->_func_target_destroy_notify = NULL;
	_gee_lazy_unref0 (self->priv->_current);
	_gee_lazy_unref0 (self->priv->_next);
	G_OBJECT_CLASS (gee_unfold_iterator_parent_class)->finalize (obj);
}

static GType
gee_unfold_iterator_get_type_once (void)
{
	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 };
	static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_unfold_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_unfold_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gee_unfold_iterator_type_id;
	gee_unfold_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeUnfoldIterator", &g_define_type_info, 0);
	g_type_add_interface_static (gee_unfold_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
	g_type_add_interface_static (gee_unfold_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
	GeeUnfoldIterator_private_offset = g_type_add_instance_private (gee_unfold_iterator_type_id, sizeof (GeeUnfoldIteratorPrivate));
	return gee_unfold_iterator_type_id;
}

 G_GNUC_INTERNAL GType
gee_unfold_iterator_get_type (void)
{
	static volatile gsize gee_unfold_iterator_type_id__once = 0;
	if (g_once_init_enter (&gee_unfold_iterator_type_id__once)) {
		GType gee_unfold_iterator_type_id;
		gee_unfold_iterator_type_id = gee_unfold_iterator_get_type_once ();
		g_once_init_leave (&gee_unfold_iterator_type_id__once, gee_unfold_iterator_type_id);
	}
	return gee_unfold_iterator_type_id__once;
}

static void
_vala_gee_unfold_iterator_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GeeUnfoldIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator);
	switch (property_id) {
		case GEE_UNFOLD_ITERATOR_VALID_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
		break;
		case GEE_UNFOLD_ITERATOR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		case GEE_UNFOLD_ITERATOR_G_TYPE:
		g_value_set_gtype (value, self->priv->g_type);
		break;
		case GEE_UNFOLD_ITERATOR_G_DUP_FUNC:
		g_value_set_pointer (value, self->priv->g_dup_func);
		break;
		case GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->g_destroy_func);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gee_unfold_iterator_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	GeeUnfoldIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_UNFOLD_ITERATOR, GeeUnfoldIterator);
	switch (property_id) {
		case GEE_UNFOLD_ITERATOR_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_UNFOLD_ITERATOR_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_UNFOLD_ITERATOR_G_DESTROY_FUNC:
		self->priv->g_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

