/* teeiterator.c generated by valac 0.34.0.46-213c, the Vala compiler
 * generated from teeiterator.vala, do not modify */

/* teeiterator.vala
 *
 * Copyright (C) 2013  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.h>
#include <glib-object.h>
#include <gobject/gvaluecollector.h>


#define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
#define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
#define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
#define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))

typedef struct _GeeTraversable GeeTraversable;
typedef struct _GeeTraversableIface GeeTraversableIface;

#define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())

#define GEE_TYPE_LAZY (gee_lazy_get_type ())
#define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
#define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
#define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
#define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
#define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))

typedef struct _GeeLazy GeeLazy;
typedef struct _GeeLazyClass GeeLazyClass;

#define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
#define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
#define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
#define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))

typedef struct _GeeIterator GeeIterator;
typedef struct _GeeIteratorIface GeeIteratorIface;

#define GEE_TYPE_TEE_ITERATOR (gee_tee_iterator_get_type ())
#define GEE_TEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEE_ITERATOR, GeeTeeIterator))
#define GEE_TEE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEE_ITERATOR, GeeTeeIteratorClass))
#define GEE_IS_TEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEE_ITERATOR))
#define GEE_IS_TEE_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEE_ITERATOR))
#define GEE_TEE_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEE_ITERATOR, GeeTeeIteratorClass))

typedef struct _GeeTeeIterator GeeTeeIterator;
typedef struct _GeeTeeIteratorClass GeeTeeIteratorClass;
typedef struct _GeeTeeIteratorPrivate GeeTeeIteratorPrivate;

#define GEE_TEE_ITERATOR_TYPE_NODE (gee_tee_iterator_node_get_type ())
#define GEE_TEE_ITERATOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNode))
#define GEE_TEE_ITERATOR_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNodeClass))
#define GEE_TEE_ITERATOR_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TEE_ITERATOR_TYPE_NODE))
#define GEE_TEE_ITERATOR_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TEE_ITERATOR_TYPE_NODE))
#define GEE_TEE_ITERATOR_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNodeClass))

typedef struct _GeeTeeIteratorNode GeeTeeIteratorNode;
typedef struct _GeeTeeIteratorNodeClass GeeTeeIteratorNodeClass;
#define _gee_tee_iterator_node_unref0(var) ((var == NULL) ? NULL : (var = (gee_tee_iterator_node_unref (var), NULL)))
typedef struct _GeeTeeIteratorNodePrivate GeeTeeIteratorNodePrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _gee_lazy_unref0(var) ((var == NULL) ? NULL : (var = (gee_lazy_unref (var), NULL)))
typedef struct _Block13Data Block13Data;
typedef struct _Block14Data Block14Data;
typedef struct _GeeTeeIteratorParamSpecNode GeeTeeIteratorParamSpecNode;

typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
typedef enum  {
	GEE_TRAVERSABLE_STREAM_YIELD,
	GEE_TRAVERSABLE_STREAM_CONTINUE,
	GEE_TRAVERSABLE_STREAM_END,
	GEE_TRAVERSABLE_STREAM_WAIT
} GeeTraversableStream;

typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
struct _GeeIteratorIface {
	GTypeInterface parent_iface;
	gboolean (*next) (GeeIterator* self);
	gboolean (*has_next) (GeeIterator* self);
	gpointer (*get) (GeeIterator* self);
	void (*remove) (GeeIterator* self);
	gboolean (*get_valid) (GeeIterator* self);
	gboolean (*get_read_only) (GeeIterator* self);
};

typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
typedef GeeIterator* (*GeeFlatMapFunc) (gpointer g, void* user_data);
struct _GeeTraversableIface {
	GTypeInterface parent_iface;
	GType (*get_g_type) (GeeTraversable* self);
	GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
	GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
	gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
	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);
	gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
	GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
	GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
	GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
	GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
	GType (*get_element_type) (GeeTraversable* self);
	GeeIterator* (*flat_map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFlatMapFunc f, void* f_target, GDestroyNotify f_target_destroy_notify);
	GeeIterator** (*tee) (GeeTraversable* self, guint forks, int* result_length1);
};

struct _GeeTeeIterator {
	GObject parent_instance;
	GeeTeeIteratorPrivate * priv;
};

struct _GeeTeeIteratorClass {
	GObjectClass parent_class;
};

struct _GeeTeeIteratorPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeTeeIteratorNode* _head;
	gboolean _valid;
};

struct _GeeTeeIteratorNode {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeeTeeIteratorNodePrivate * priv;
	GeeLazy* _data;
	GeeLazy* _next;
};

struct _GeeTeeIteratorNodeClass {
	GTypeClass parent_class;
	void (*finalize) (GeeTeeIteratorNode *self);
};

struct _Block13Data {
	int _ref_count_;
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeIterator* iterator;
	GeeLazy* dependent;
};

struct _Block14Data {
	int _ref_count_;
	Block13Data * _data13_;
};

typedef gpointer (*GeeLazyFunc) (void* user_data);
struct _GeeTeeIteratorNodePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeeTeeIteratorParamSpecNode {
	GParamSpec parent_instance;
};


static gpointer gee_tee_iterator_parent_class = NULL;
static gpointer gee_tee_iterator_node_parent_class = NULL;
static GeeTraversableIface* gee_tee_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface* gee_tee_iterator_gee_iterator_parent_iface = NULL;

GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
gpointer gee_lazy_ref (gpointer instance);
void gee_lazy_unref (gpointer instance);
GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void gee_value_set_lazy (GValue* value, gpointer v_object);
void gee_value_take_lazy (GValue* value, gpointer v_object);
gpointer gee_value_get_lazy (const GValue* value);
GType gee_lazy_get_type (void) G_GNUC_CONST;
GType gee_iterator_get_type (void) G_GNUC_CONST;
GType gee_traversable_get_type (void) G_GNUC_CONST;
G_GNUC_INTERNAL GType gee_tee_iterator_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
G_GNUC_INTERNAL gpointer gee_tee_iterator_node_ref (gpointer instance);
G_GNUC_INTERNAL void gee_tee_iterator_node_unref (gpointer instance);
G_GNUC_INTERNAL GParamSpec* gee_tee_iterator_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
G_GNUC_INTERNAL void gee_tee_iterator_value_set_node (GValue* value, gpointer v_object) G_GNUC_UNUSED;
G_GNUC_INTERNAL void gee_tee_iterator_value_take_node (GValue* value, gpointer v_object);
G_GNUC_INTERNAL gpointer gee_tee_iterator_value_get_node (const GValue* value) G_GNUC_UNUSED;
G_GNUC_INTERNAL GType gee_tee_iterator_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define GEE_TEE_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_TEE_ITERATOR, GeeTeeIteratorPrivate))
enum  {
	GEE_TEE_ITERATOR_DUMMY_PROPERTY,
	GEE_TEE_ITERATOR_G_TYPE,
	GEE_TEE_ITERATOR_G_DUP_FUNC,
	GEE_TEE_ITERATOR_G_DESTROY_FUNC,
	GEE_TEE_ITERATOR_VALID,
	GEE_TEE_ITERATOR_READ_ONLY
};
G_GNUC_INTERNAL GeeTeeIterator* gee_tee_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTeeIteratorNode* head, gboolean valid);
G_GNUC_INTERNAL GeeTeeIterator* gee_tee_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTeeIteratorNode* head, gboolean valid);
static gboolean gee_tee_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target);
gpointer gee_lazy_get (GeeLazy* self);
gconstpointer gee_lazy_get_value (GeeLazy* self);
static GeeIterator** gee_tee_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1);
static gboolean gee_tee_iterator_real_next (GeeIterator* base);
static gboolean gee_tee_iterator_real_has_next (GeeIterator* base);
static gpointer gee_tee_iterator_real_get (GeeIterator* base);
static void gee_tee_iterator_real_remove (GeeIterator* base);
G_GNUC_INTERNAL GeeLazy* gee_tee_iterator_create_nodes (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator, GeeLazy* dependent);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static GeeTeeIteratorNode* __lambda23_ (Block13Data* _data13_);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
void gee_lazy_eval (GeeLazy* self);
gboolean gee_iterator_next (GeeIterator* self);
static gpointer __lambda24_ (Block14Data* _data14_);
gpointer gee_iterator_get (GeeIterator* self);
static gpointer ___lambda24__gee_lazy_func (gpointer self);
GeeLazy* gee_lazy_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
GeeLazy* gee_lazy_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazyFunc func, void* func_target, GDestroyNotify func_target_destroy_notify);
G_GNUC_INTERNAL GeeTeeIteratorNode* gee_tee_iterator_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazy* data, GeeLazy* next);
G_GNUC_INTERNAL GeeTeeIteratorNode* gee_tee_iterator_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazy* data, GeeLazy* next);
static gpointer ___lambda23__gee_lazy_func (gpointer self);
#define GEE_TEE_ITERATOR_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNodePrivate))
enum  {
	GEE_TEE_ITERATOR_NODE_DUMMY_PROPERTY
};
static void gee_tee_iterator_node_finalize (GeeTeeIteratorNode* obj);
static void gee_tee_iterator_finalize (GObject* obj);
gboolean gee_iterator_get_valid (GeeIterator* self);
gboolean gee_iterator_get_read_only (GeeIterator* self);
static void _vala_gee_tee_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_gee_tee_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gpointer _gee_tee_iterator_node_ref0 (gpointer self) {
	return self ? gee_tee_iterator_node_ref (self) : NULL;
}


G_GNUC_INTERNAL GeeTeeIterator* gee_tee_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTeeIteratorNode* head, gboolean valid) {
	GeeTeeIterator * self = NULL;
	GeeTeeIteratorNode* _tmp0_ = NULL;
	GeeTeeIteratorNode* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	self = (GeeTeeIterator*) g_object_new (object_type, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = head;
	_tmp1_ = _gee_tee_iterator_node_ref0 (_tmp0_);
	_gee_tee_iterator_node_unref0 (self->priv->_head);
	self->priv->_head = _tmp1_;
	_tmp2_ = valid;
	self->priv->_valid = _tmp2_;
	return self;
}


G_GNUC_INTERNAL GeeTeeIterator* gee_tee_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeTeeIteratorNode* head, gboolean valid) {
	return gee_tee_iterator_construct (GEE_TYPE_TEE_ITERATOR, g_type, g_dup_func, g_destroy_func, head, valid);
}


static gboolean gee_tee_iterator_real_foreach (GeeTraversable* base, GeeForallFunc f, void* f_target) {
	GeeTeeIterator * self;
	gboolean result = FALSE;
	GeeTeeIteratorNode* head = NULL;
	GeeTeeIteratorNode* _tmp0_ = NULL;
	gboolean valid = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	GeeTeeIteratorNode* next_head = NULL;
	GeeTeeIteratorNode* _tmp8_ = NULL;
	GeeLazy* _tmp9_ = NULL;
	gconstpointer _tmp10_ = NULL;
	GeeTeeIteratorNode* _tmp11_ = NULL;
	GeeTeeIteratorNode* _tmp22_ = NULL;
	gboolean _tmp23_ = FALSE;
	self = (GeeTeeIterator*) base;
	_tmp0_ = self->priv->_head;
	self->priv->_head = NULL;
	head = _tmp0_;
	_tmp1_ = self->priv->_valid;
	valid = _tmp1_;
	_tmp2_ = valid;
	if (_tmp2_) {
		GeeForallFunc _tmp3_ = NULL;
		void* _tmp3__target = NULL;
		GeeTeeIteratorNode* _tmp4_ = NULL;
		GeeLazy* _tmp5_ = NULL;
		gpointer _tmp6_ = NULL;
		gboolean _tmp7_ = FALSE;
		_tmp3_ = f;
		_tmp3__target = f_target;
		_tmp4_ = head;
		_tmp5_ = _tmp4_->_data;
		_tmp6_ = gee_lazy_get (_tmp5_);
		_tmp7_ = _tmp3_ (_tmp6_, _tmp3__target);
		if (!_tmp7_) {
			result = FALSE;
			_gee_tee_iterator_node_unref0 (head);
			return result;
		}
	}
	_tmp8_ = head;
	_tmp9_ = _tmp8_->_next;
	_tmp10_ = gee_lazy_get_value (_tmp9_);
	_tmp11_ = _tmp10_;
	next_head = (GeeTeeIteratorNode*) _tmp11_;
	while (TRUE) {
		GeeTeeIteratorNode* _tmp12_ = NULL;
		GeeTeeIteratorNode* _tmp13_ = NULL;
		GeeTeeIteratorNode* _tmp14_ = NULL;
		GeeForallFunc _tmp15_ = NULL;
		void* _tmp15__target = NULL;
		GeeTeeIteratorNode* _tmp16_ = NULL;
		GeeLazy* _tmp17_ = NULL;
		gpointer _tmp18_ = NULL;
		gboolean _tmp19_ = FALSE;
		_tmp12_ = next_head;
		if (!(_tmp12_ != NULL)) {
			break;
		}
		_tmp13_ = next_head;
		_tmp14_ = _gee_tee_iterator_node_ref0 (_tmp13_);
		_gee_tee_iterator_node_unref0 (head);
		head = _tmp14_;
		valid = TRUE;
		_tmp15_ = f;
		_tmp15__target = f_target;
		_tmp16_ = head;
		_tmp17_ = _tmp16_->_data;
		_tmp18_ = gee_lazy_get (_tmp17_);
		_tmp19_ = _tmp15_ (_tmp18_, _tmp15__target);
		if (!_tmp19_) {
			GeeTeeIteratorNode* _tmp20_ = NULL;
			gboolean _tmp21_ = FALSE;
			_tmp20_ = head;
			head = NULL;
			_gee_tee_iterator_node_unref0 (self->priv->_head);
			self->priv->_head = _tmp20_;
			_tmp21_ = valid;
			self->priv->_valid = _tmp21_;
			result = FALSE;
			_gee_tee_iterator_node_unref0 (head);
			return result;
		}
	}
	_tmp22_ = head;
	head = NULL;
	_gee_tee_iterator_node_unref0 (self->priv->_head);
	self->priv->_head = _tmp22_;
	_tmp23_ = valid;
	self->priv->_valid = _tmp23_;
	result = TRUE;
	_gee_tee_iterator_node_unref0 (head);
	return result;
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static GeeIterator** gee_tee_iterator_real_tee (GeeTraversable* base, guint forks, int* result_length1) {
	GeeTeeIterator * self;
	GeeIterator** result = NULL;
	guint _tmp0_ = 0U;
	self = (GeeTeeIterator*) base;
	_tmp0_ = forks;
	if (_tmp0_ == ((guint) 0)) {
		GeeIterator** _tmp1_ = NULL;
		GeeIterator** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		_tmp1_ = g_new0 (GeeIterator*, 0 + 1);
		_tmp2_ = _tmp1_;
		_tmp2__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp2__length1;
		}
		result = _tmp2_;
		return result;
	} else {
		GeeIterator** _result_ = NULL;
		guint _tmp3_ = 0U;
		GeeIterator** _tmp4_ = NULL;
		gint _result__length1 = 0;
		gint __result__size_ = 0;
		GeeIterator** _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		GeeIterator* _tmp6_ = NULL;
		GeeIterator* _tmp7_ = NULL;
		GeeIterator** _tmp18_ = NULL;
		gint _tmp18__length1 = 0;
		_tmp3_ = forks;
		_tmp4_ = g_new0 (GeeIterator*, _tmp3_ + 1);
		_result_ = _tmp4_;
		_result__length1 = _tmp3_;
		__result__size_ = _result__length1;
		_tmp5_ = _result_;
		_tmp5__length1 = _result__length1;
		_tmp6_ = _g_object_ref0 ((GeeIterator*) self);
		_g_object_unref0 (_tmp5_[0]);
		_tmp5_[0] = _tmp6_;
		_tmp7_ = _tmp5_[0];
		{
			guint i = 0U;
			i = (guint) 1;
			{
				gboolean _tmp8_ = FALSE;
				_tmp8_ = TRUE;
				while (TRUE) {
					guint _tmp10_ = 0U;
					guint _tmp11_ = 0U;
					GeeIterator** _tmp12_ = NULL;
					gint _tmp12__length1 = 0;
					guint _tmp13_ = 0U;
					GeeTeeIteratorNode* _tmp14_ = NULL;
					gboolean _tmp15_ = FALSE;
					GeeTeeIterator* _tmp16_ = NULL;
					GeeIterator* _tmp17_ = NULL;
					if (!_tmp8_) {
						guint _tmp9_ = 0U;
						_tmp9_ = i;
						i = _tmp9_ + 1;
					}
					_tmp8_ = FALSE;
					_tmp10_ = i;
					_tmp11_ = forks;
					if (!(_tmp10_ < _tmp11_)) {
						break;
					}
					_tmp12_ = _result_;
					_tmp12__length1 = _result__length1;
					_tmp13_ = i;
					_tmp14_ = self->priv->_head;
					_tmp15_ = self->priv->_valid;
					_tmp16_ = gee_tee_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp14_, _tmp15_);
					_g_object_unref0 (_tmp12_[_tmp13_]);
					_tmp12_[_tmp13_] = (GeeIterator*) _tmp16_;
					_tmp17_ = _tmp12_[_tmp13_];
				}
			}
		}
		_tmp18_ = _result_;
		_tmp18__length1 = _result__length1;
		if (result_length1) {
			*result_length1 = _tmp18__length1;
		}
		result = _tmp18_;
		return result;
	}
}


static gboolean gee_tee_iterator_real_next (GeeIterator* base) {
	GeeTeeIterator * self;
	gboolean result = FALSE;
	GeeTeeIteratorNode* next = NULL;
	GeeTeeIteratorNode* _tmp0_ = NULL;
	GeeLazy* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	GeeTeeIteratorNode* _tmp3_ = NULL;
	GeeTeeIteratorNode* _tmp4_ = NULL;
	self = (GeeTeeIterator*) base;
	_tmp0_ = self->priv->_head;
	_tmp1_ = _tmp0_->_next;
	_tmp2_ = gee_lazy_get_value (_tmp1_);
	_tmp3_ = _tmp2_;
	next = (GeeTeeIteratorNode*) _tmp3_;
	_tmp4_ = next;
	if (_tmp4_ != NULL) {
		GeeTeeIteratorNode* _tmp5_ = NULL;
		GeeTeeIteratorNode* _tmp6_ = NULL;
		_tmp5_ = next;
		_tmp6_ = _gee_tee_iterator_node_ref0 (_tmp5_);
		_gee_tee_iterator_node_unref0 (self->priv->_head);
		self->priv->_head = _tmp6_;
		self->priv->_valid = TRUE;
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}


static gboolean gee_tee_iterator_real_has_next (GeeIterator* base) {
	GeeTeeIterator * self;
	gboolean result = FALSE;
	GeeTeeIteratorNode* _tmp0_ = NULL;
	GeeLazy* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	GeeTeeIteratorNode* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	self = (GeeTeeIterator*) base;
	_tmp0_ = self->priv->_head;
	_tmp1_ = _tmp0_->_next;
	_tmp2_ = gee_lazy_get (_tmp1_);
	_tmp3_ = (GeeTeeIteratorNode*) _tmp2_;
	_tmp4_ = _tmp3_ != NULL;
	_gee_tee_iterator_node_unref0 (_tmp3_);
	result = _tmp4_;
	return result;
}


static gpointer gee_tee_iterator_real_get (GeeIterator* base) {
	GeeTeeIterator * self;
	gpointer result = NULL;
	GeeTeeIteratorNode* _tmp0_ = NULL;
	GeeLazy* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	self = (GeeTeeIterator*) base;
	_tmp0_ = self->priv->_head;
	_tmp1_ = _tmp0_->_data;
	_tmp2_ = gee_lazy_get (_tmp1_);
	result = _tmp2_;
	return result;
}


static void gee_tee_iterator_real_remove (GeeIterator* base) {
	GeeTeeIterator * self;
	self = (GeeTeeIterator*) base;
	g_assert_not_reached ();
}


static gpointer _gee_lazy_ref0 (gpointer self) {
	return self ? gee_lazy_ref (self) : NULL;
}


static Block13Data* block13_data_ref (Block13Data* _data13_) {
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}


static void block13_data_unref (void * _userdata_) {
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		GType g_type;
		GBoxedCopyFunc g_dup_func;
		GDestroyNotify g_destroy_func;
		g_type = _data13_->g_type;
		g_dup_func = _data13_->g_dup_func;
		g_destroy_func = _data13_->g_destroy_func;
		_g_object_unref0 (_data13_->iterator);
		_gee_lazy_unref0 (_data13_->dependent);
		g_slice_free (Block13Data, _data13_);
	}
}


static Block14Data* block14_data_ref (Block14Data* _data14_) {
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}


static void block14_data_unref (void * _userdata_) {
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		GType g_type;
		GBoxedCopyFunc g_dup_func;
		GDestroyNotify g_destroy_func;
		g_type = _data14_->_data13_->g_type;
		g_dup_func = _data14_->_data13_->g_dup_func;
		g_destroy_func = _data14_->_data13_->g_destroy_func;
		block13_data_unref (_data14_->_data13_);
		_data14_->_data13_ = NULL;
		g_slice_free (Block14Data, _data14_);
	}
}


static gpointer __lambda24_ (Block14Data* _data14_) {
	Block13Data* _data13_;
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	gpointer result = NULL;
	GeeIterator* _tmp0_ = NULL;
	gpointer _tmp1_ = NULL;
	_data13_ = _data14_->_data13_;
	g_type = _data13_->g_type;
	g_dup_func = _data13_->g_dup_func;
	g_destroy_func = _data13_->g_destroy_func;
	_tmp0_ = _data13_->iterator;
	_tmp1_ = gee_iterator_get (_tmp0_);
	result = _tmp1_;
	return result;
}


static gpointer ___lambda24__gee_lazy_func (gpointer self) {
	gpointer result;
	result = __lambda24_ (self);
	return result;
}


static GeeTeeIteratorNode* __lambda23_ (Block13Data* _data13_) {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeTeeIteratorNode* result = NULL;
	Block14Data* _data14_;
	GeeLazy* _tmp0_ = NULL;
	GeeIterator* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	GeeLazy* data = NULL;
	GeeLazy* _tmp3_ = NULL;
	GeeLazy* next = NULL;
	GeeIterator* _tmp4_ = NULL;
	GeeLazy* _tmp5_ = NULL;
	GeeLazy* _tmp6_ = NULL;
	GeeLazy* _tmp7_ = NULL;
	GeeLazy* _tmp8_ = NULL;
	GeeTeeIteratorNode* _tmp9_ = NULL;
	g_type = _data13_->g_type;
	g_dup_func = _data13_->g_dup_func;
	g_destroy_func = _data13_->g_destroy_func;
	_data14_ = g_slice_new0 (Block14Data);
	_data14_->_ref_count_ = 1;
	_data14_->_data13_ = block13_data_ref (_data13_);
	_tmp0_ = _data13_->dependent;
	gee_lazy_eval (_tmp0_);
	_tmp1_ = _data13_->iterator;
	_tmp2_ = gee_iterator_next (_tmp1_);
	if (!_tmp2_) {
		result = NULL;
		block14_data_unref (_data14_);
		_data14_ = NULL;
		return result;
	}
	_tmp3_ = gee_lazy_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, ___lambda24__gee_lazy_func, block14_data_ref (_data14_), block14_data_unref);
	data = _tmp3_;
	_tmp4_ = _data13_->iterator;
	_tmp5_ = data;
	_tmp6_ = gee_tee_iterator_create_nodes (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp4_, _tmp5_);
	next = _tmp6_;
	_tmp7_ = data;
	data = NULL;
	_tmp8_ = next;
	next = NULL;
	_tmp9_ = gee_tee_iterator_node_new (g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, _tmp7_, _tmp8_);
	result = _tmp9_;
	_gee_lazy_unref0 (next);
	_gee_lazy_unref0 (data);
	block14_data_unref (_data14_);
	_data14_ = NULL;
	return result;
}


static gpointer ___lambda23__gee_lazy_func (gpointer self) {
	gpointer result;
	result = __lambda23_ (self);
	return result;
}


G_GNUC_INTERNAL GeeLazy* gee_tee_iterator_create_nodes (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator, GeeLazy* dependent) {
	GeeLazy* result = NULL;
	Block13Data* _data13_;
	GeeIterator* _tmp0_ = NULL;
	GeeIterator* _tmp1_ = NULL;
	GeeLazy* _tmp2_ = NULL;
	GeeLazy* _tmp3_ = NULL;
	GeeLazy* _tmp4_ = NULL;
	g_return_val_if_fail (iterator != NULL, NULL);
	g_return_val_if_fail (dependent != NULL, NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->g_type = g_type;
	_data13_->g_dup_func = g_dup_func;
	_data13_->g_destroy_func = g_destroy_func;
	_tmp0_ = iterator;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data13_->iterator);
	_data13_->iterator = _tmp1_;
	_tmp2_ = dependent;
	_tmp3_ = _gee_lazy_ref0 (_tmp2_);
	_gee_lazy_unref0 (_data13_->dependent);
	_data13_->dependent = _tmp3_;
	_tmp4_ = gee_lazy_new (GEE_TEE_ITERATOR_TYPE_NODE, (GBoxedCopyFunc) gee_tee_iterator_node_ref, gee_tee_iterator_node_unref, ___lambda23__gee_lazy_func, block13_data_ref (_data13_), block13_data_unref);
	result = _tmp4_;
	block13_data_unref (_data13_);
	_data13_ = NULL;
	return result;
}


static gboolean gee_tee_iterator_real_get_valid (GeeIterator* base) {
	gboolean result;
	GeeTeeIterator* self;
	gboolean _tmp0_ = FALSE;
	self = (GeeTeeIterator*) base;
	_tmp0_ = self->priv->_valid;
	result = _tmp0_;
	return result;
}


static gboolean gee_tee_iterator_real_get_read_only (GeeIterator* base) {
	gboolean result;
	GeeTeeIterator* self;
	self = (GeeTeeIterator*) base;
	result = TRUE;
	return result;
}


G_GNUC_INTERNAL GeeTeeIteratorNode* gee_tee_iterator_node_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazy* data, GeeLazy* next) {
	GeeTeeIteratorNode* self = NULL;
	GeeLazy* _tmp0_ = NULL;
	GeeLazy* _tmp1_ = NULL;
	g_return_val_if_fail (data != NULL, NULL);
	g_return_val_if_fail (next != NULL, NULL);
	self = (GeeTeeIteratorNode*) g_type_create_instance (object_type);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = data;
	data = NULL;
	_gee_lazy_unref0 (self->_data);
	self->_data = _tmp0_;
	_tmp1_ = next;
	next = NULL;
	_gee_lazy_unref0 (self->_next);
	self->_next = _tmp1_;
	_gee_lazy_unref0 (data);
	_gee_lazy_unref0 (next);
	return self;
}


G_GNUC_INTERNAL GeeTeeIteratorNode* gee_tee_iterator_node_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeLazy* data, GeeLazy* next) {
	return gee_tee_iterator_node_construct (GEE_TEE_ITERATOR_TYPE_NODE, g_type, g_dup_func, g_destroy_func, data, next);
}


static void gee_tee_iterator_value_node_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void gee_tee_iterator_value_node_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		gee_tee_iterator_node_unref (value->data[0].v_pointer);
	}
}


static void gee_tee_iterator_value_node_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gee_tee_iterator_node_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer gee_tee_iterator_value_node_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* gee_tee_iterator_value_node_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		GeeTeeIteratorNode* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gee_tee_iterator_node_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* gee_tee_iterator_value_node_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	GeeTeeIteratorNode** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gee_tee_iterator_node_ref (value->data[0].v_pointer);
	}
	return NULL;
}


G_GNUC_INTERNAL GParamSpec* gee_tee_iterator_param_spec_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	GeeTeeIteratorParamSpecNode* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GEE_TEE_ITERATOR_TYPE_NODE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


G_GNUC_INTERNAL gpointer gee_tee_iterator_value_get_node (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TEE_ITERATOR_TYPE_NODE), NULL);
	return value->data[0].v_pointer;
}


G_GNUC_INTERNAL void gee_tee_iterator_value_set_node (GValue* value, gpointer v_object) {
	GeeTeeIteratorNode* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TEE_ITERATOR_TYPE_NODE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TEE_ITERATOR_TYPE_NODE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gee_tee_iterator_node_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_tee_iterator_node_unref (old);
	}
}


G_GNUC_INTERNAL void gee_tee_iterator_value_take_node (GValue* value, gpointer v_object) {
	GeeTeeIteratorNode* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_TEE_ITERATOR_TYPE_NODE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_TEE_ITERATOR_TYPE_NODE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_tee_iterator_node_unref (old);
	}
}


static void gee_tee_iterator_node_class_init (GeeTeeIteratorNodeClass * klass) {
	gee_tee_iterator_node_parent_class = g_type_class_peek_parent (klass);
	((GeeTeeIteratorNodeClass *) klass)->finalize = gee_tee_iterator_node_finalize;
	g_type_class_add_private (klass, sizeof (GeeTeeIteratorNodePrivate));
}


static void gee_tee_iterator_node_instance_init (GeeTeeIteratorNode * self) {
	self->priv = GEE_TEE_ITERATOR_NODE_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void gee_tee_iterator_node_finalize (GeeTeeIteratorNode* obj) {
	GeeTeeIteratorNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TEE_ITERATOR_TYPE_NODE, GeeTeeIteratorNode);
	g_signal_handlers_destroy (self);
	_gee_lazy_unref0 (self->_data);
	_gee_lazy_unref0 (self->_next);
}


G_GNUC_INTERNAL GType gee_tee_iterator_node_get_type (void) {
	static volatile gsize gee_tee_iterator_node_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tee_iterator_node_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { gee_tee_iterator_value_node_init, gee_tee_iterator_value_node_free_value, gee_tee_iterator_value_node_copy_value, gee_tee_iterator_value_node_peek_pointer, "p", gee_tee_iterator_value_node_collect_value, "p", gee_tee_iterator_value_node_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (GeeTeeIteratorNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tee_iterator_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTeeIteratorNode), 0, (GInstanceInitFunc) gee_tee_iterator_node_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType gee_tee_iterator_node_type_id;
		gee_tee_iterator_node_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeTeeIteratorNode", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&gee_tee_iterator_node_type_id__volatile, gee_tee_iterator_node_type_id);
	}
	return gee_tee_iterator_node_type_id__volatile;
}


G_GNUC_INTERNAL gpointer gee_tee_iterator_node_ref (gpointer instance) {
	GeeTeeIteratorNode* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


G_GNUC_INTERNAL void gee_tee_iterator_node_unref (gpointer instance) {
	GeeTeeIteratorNode* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GEE_TEE_ITERATOR_NODE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void gee_tee_iterator_class_init (GeeTeeIteratorClass * klass) {
	gee_tee_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GeeTeeIteratorPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_tee_iterator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_tee_iterator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_tee_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TEE_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TEE_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TEE_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TEE_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_TEE_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));
}


static GType gee_tee_iterator_gee_traversable_get_g_type (GeeTeeIterator* self) {
	return self->priv->g_type;
}


static GBoxedCopyFunc gee_tee_iterator_gee_traversable_get_g_dup_func (GeeTeeIterator* self) {
	return self->priv->g_dup_func;
}


static GDestroyNotify gee_tee_iterator_gee_traversable_get_g_destroy_func (GeeTeeIterator* self) {
	return self->priv->g_destroy_func;
}


static void gee_tee_iterator_gee_traversable_interface_init (GeeTraversableIface * iface) {
	gee_tee_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_tee_iterator_real_foreach;
	iface->tee = (GeeIterator** (*)(GeeTraversable*, guint, int*)) gee_tee_iterator_real_tee;
	iface->get_g_type = (GType(*)(GeeTraversable*)) gee_tee_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_tee_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_tee_iterator_gee_traversable_get_g_destroy_func;
}


static void gee_tee_iterator_gee_iterator_interface_init (GeeIteratorIface * iface) {
	gee_tee_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->next = (gboolean (*)(GeeIterator*)) gee_tee_iterator_real_next;
	iface->has_next = (gboolean (*)(GeeIterator*)) gee_tee_iterator_real_has_next;
	iface->get = (gpointer (*)(GeeIterator*)) gee_tee_iterator_real_get;
	iface->remove = (void (*)(GeeIterator*)) gee_tee_iterator_real_remove;
	iface->get_valid = gee_tee_iterator_real_get_valid;
	iface->get_read_only = gee_tee_iterator_real_get_read_only;
}


static void gee_tee_iterator_instance_init (GeeTeeIterator * self) {
	self->priv = GEE_TEE_ITERATOR_GET_PRIVATE (self);
}


static void gee_tee_iterator_finalize (GObject* obj) {
	GeeTeeIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_TEE_ITERATOR, GeeTeeIterator);
	_gee_tee_iterator_node_unref0 (self->priv->_head);
	G_OBJECT_CLASS (gee_tee_iterator_parent_class)->finalize (obj);
}


G_GNUC_INTERNAL GType gee_tee_iterator_get_type (void) {
	static volatile gsize gee_tee_iterator_type_id__volatile = 0;
	if (g_once_init_enter (&gee_tee_iterator_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GeeTeeIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_tee_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeTeeIterator), 0, (GInstanceInitFunc) gee_tee_iterator_instance_init, NULL };
		static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_tee_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_tee_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gee_tee_iterator_type_id;
		gee_tee_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeTeeIterator", &g_define_type_info, 0);
		g_type_add_interface_static (gee_tee_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
		g_type_add_interface_static (gee_tee_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
		g_once_init_leave (&gee_tee_iterator_type_id__volatile, gee_tee_iterator_type_id);
	}
	return gee_tee_iterator_type_id__volatile;
}


static void _vala_gee_tee_iterator_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GeeTeeIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TEE_ITERATOR, GeeTeeIterator);
	switch (property_id) {
		case GEE_TEE_ITERATOR_VALID:
		g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
		break;
		case GEE_TEE_ITERATOR_READ_ONLY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gee_tee_iterator_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GeeTeeIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_TEE_ITERATOR, GeeTeeIterator);
	switch (property_id) {
		case GEE_TEE_ITERATOR_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_TEE_ITERATOR_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_TEE_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;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



