diff options
Diffstat (limited to 'gee/abstractcollection.c')
-rw-r--r-- | gee/abstractcollection.c | 1624 |
1 files changed, 249 insertions, 1375 deletions
diff --git a/gee/abstractcollection.c b/gee/abstractcollection.c index a23fbb2..35ab45e 100644 --- a/gee/abstractcollection.c +++ b/gee/abstractcollection.c @@ -26,18 +26,27 @@ #include <glib.h> #include <glib-object.h> -#include <float.h> -#include <math.h> -#include <string.h> -#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) -#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) -#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) -#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) +#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 _GeeIterable GeeIterable; -typedef struct _GeeIterableIface GeeIterableIface; +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)) @@ -47,6 +56,14 @@ typedef struct _GeeIterableIface GeeIterableIface; typedef struct _GeeIterator GeeIterator; typedef struct _GeeIteratorIface GeeIteratorIface; +#define GEE_TYPE_ITERABLE (gee_iterable_get_type ()) +#define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable)) +#define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE)) +#define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface)) + +typedef struct _GeeIterable GeeIterable; +typedef struct _GeeIterableIface GeeIterableIface; + #define GEE_TYPE_COLLECTION (gee_collection_get_type ()) #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection)) #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION)) @@ -66,7 +83,6 @@ typedef struct _GeeAbstractCollection GeeAbstractCollection; typedef struct _GeeAbstractCollectionClass GeeAbstractCollectionClass; typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) -#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL))) #define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ()) #define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection)) @@ -78,23 +94,55 @@ typedef struct _GeeAbstractCollectionPrivate GeeAbstractCollectionPrivate; typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection; typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass; +typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data); +typedef enum { + GEE_TRAVERSABLE_STREAM_YIELD, + GEE_TRAVERSABLE_STREAM_CONTINUE, + GEE_TRAVERSABLE_STREAM_END +} 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); - gboolean (*first) (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); +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); }; struct _GeeIterableIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeIterable* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self); + GDestroyNotify (*get_g_destroy_func) (GeeIterable* self); GeeIterator* (*iterator) (GeeIterable* self); - GType (*get_element_type) (GeeIterable* self); }; struct _GeeCollectionIface { GTypeInterface parent_iface; + GType (*get_g_type) (GeeCollection* self); + GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self); + GDestroyNotify (*get_g_destroy_func) (GeeCollection* self); gboolean (*contains) (GeeCollection* self, gconstpointer item); gboolean (*add) (GeeCollection* self, gconstpointer item); gboolean (*remove) (GeeCollection* self, gconstpointer item); @@ -106,6 +154,7 @@ struct _GeeCollectionIface { gpointer* (*to_array) (GeeCollection* self, int* result_length1); gint (*get_size) (GeeCollection* self); gboolean (*get_is_empty) (GeeCollection* self); + gboolean (*get_read_only) (GeeCollection* self); GeeCollection* (*get_read_only_view) (GeeCollection* self); }; @@ -120,14 +169,20 @@ struct _GeeAbstractCollectionClass { gboolean (*add) (GeeAbstractCollection* self, gconstpointer item); gboolean (*remove) (GeeAbstractCollection* self, gconstpointer item); void (*clear) (GeeAbstractCollection* self); - gpointer* (*to_array) (GeeAbstractCollection* self, int* result_length1); - gboolean (*add_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*contains_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*remove_all) (GeeAbstractCollection* self, GeeCollection* collection); - gboolean (*retain_all) (GeeAbstractCollection* self, GeeCollection* collection); GeeIterator* (*iterator) (GeeAbstractCollection* self); + gboolean (*foreach) (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); + void (*reserved0) (GeeAbstractCollection* self); + void (*reserved1) (GeeAbstractCollection* self); + void (*reserved2) (GeeAbstractCollection* self); + void (*reserved3) (GeeAbstractCollection* self); + void (*reserved4) (GeeAbstractCollection* self); + void (*reserved5) (GeeAbstractCollection* self); + void (*reserved6) (GeeAbstractCollection* self); + void (*reserved7) (GeeAbstractCollection* self); + void (*reserved8) (GeeAbstractCollection* self); + void (*reserved9) (GeeAbstractCollection* self); gint (*get_size) (GeeAbstractCollection* self); - gboolean (*get_is_empty) (GeeAbstractCollection* self); + gboolean (*get_read_only) (GeeAbstractCollection* self); GeeCollection* (*get_read_only_view) (GeeAbstractCollection* self); }; @@ -140,10 +195,20 @@ struct _GeeAbstractCollectionPrivate { static gpointer gee_abstract_collection_parent_class = NULL; +static GeeTraversableIface* gee_abstract_collection_gee_traversable_parent_iface = NULL; static GeeIterableIface* gee_abstract_collection_gee_iterable_parent_iface = NULL; static GeeCollectionIface* gee_abstract_collection_gee_collection_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; GType gee_iterable_get_type (void) G_GNUC_CONST; GType gee_collection_get_type (void) G_GNUC_CONST; GType gee_abstract_collection_get_type (void) G_GNUC_CONST; @@ -154,8 +219,7 @@ enum { GEE_ABSTRACT_COLLECTION_G_DUP_FUNC, GEE_ABSTRACT_COLLECTION_G_DESTROY_FUNC, GEE_ABSTRACT_COLLECTION_SIZE, - GEE_ABSTRACT_COLLECTION_IS_EMPTY, - GEE_ABSTRACT_COLLECTION_ELEMENT_TYPE, + GEE_ABSTRACT_COLLECTION_READ_ONLY, GEE_ABSTRACT_COLLECTION_READ_ONLY_VIEW }; gboolean gee_abstract_collection_contains (GeeAbstractCollection* self, gconstpointer item); @@ -166,50 +230,41 @@ gboolean gee_abstract_collection_remove (GeeAbstractCollection* self, gconstpoin static gboolean gee_abstract_collection_real_remove (GeeAbstractCollection* self, gconstpointer item); void gee_abstract_collection_clear (GeeAbstractCollection* self); static void gee_abstract_collection_real_clear (GeeAbstractCollection* self); -gpointer* gee_abstract_collection_to_array (GeeAbstractCollection* self, int* result_length1); -static gpointer* gee_abstract_collection_real_to_array (GeeAbstractCollection* self, int* result_length1); -static gboolean* gee_abstract_collection_to_bool_array (GeeCollection* coll, int* result_length1); -static gchar* gee_abstract_collection_to_char_array (GeeCollection* coll, int* result_length1); -static guchar* gee_abstract_collection_to_uchar_array (GeeCollection* coll, int* result_length1); -static gint* gee_abstract_collection_to_int_array (GeeCollection* coll, int* result_length1); -static guint* gee_abstract_collection_to_uint_array (GeeCollection* coll, int* result_length1); -static gint64* gee_abstract_collection_to_int64_array (GeeCollection* coll, int* result_length1); -static guint64* gee_abstract_collection_to_uint64_array (GeeCollection* coll, int* result_length1); -static glong* gee_abstract_collection_to_long_array (GeeCollection* coll, int* result_length1); -static gulong* gee_abstract_collection_to_ulong_array (GeeCollection* coll, int* result_length1); -static gfloat** gee_abstract_collection_to_float_array (GeeCollection* coll, int* result_length1); -static gdouble** gee_abstract_collection_to_double_array (GeeCollection* coll, int* result_length1); -gint gee_collection_get_size (GeeCollection* self); GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self); -gboolean gee_iterator_next (GeeIterator* self); -gpointer gee_iterator_get (GeeIterator* self); -GeeIterator* gee_iterable_iterator (GeeIterable* self); -static gfloat* _float_dup (gfloat* self); -static gdouble* _double_dup (gdouble* self); -gboolean gee_abstract_collection_add_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_add_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_collection_get_is_empty (GeeCollection* self); -gboolean gee_abstract_collection_contains_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_contains_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_remove_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_remove_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_abstract_collection_retain_all (GeeAbstractCollection* self, GeeCollection* collection); -static gboolean gee_abstract_collection_real_retain_all (GeeAbstractCollection* self, GeeCollection* collection); -gboolean gee_collection_contains (GeeCollection* self, gconstpointer item); static GeeIterator* gee_abstract_collection_real_iterator (GeeAbstractCollection* self); +gboolean gee_abstract_collection_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); +static gboolean gee_abstract_collection_real_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target); +gboolean gee_traversable_foreach (GeeTraversable* self, GeeForallFunc f, void* f_target); +void gee_abstract_collection_reserved0 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved0 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved1 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved1 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved2 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved2 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved3 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved3 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved4 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved4 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved5 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved5 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved6 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved6 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved7 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved7 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved8 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved8 (GeeAbstractCollection* self); +void gee_abstract_collection_reserved9 (GeeAbstractCollection* self); +static void gee_abstract_collection_real_reserved9 (GeeAbstractCollection* self); GeeAbstractCollection* gee_abstract_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func); gint gee_abstract_collection_get_size (GeeAbstractCollection* self); -gboolean gee_abstract_collection_get_is_empty (GeeAbstractCollection* self); +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self); GeeCollection* gee_abstract_collection_get_read_only_view (GeeAbstractCollection* self); GeeReadOnlyCollection* gee_read_only_collection_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); GeeReadOnlyCollection* gee_read_only_collection_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeCollection* collection); GType gee_read_only_collection_get_type (void) G_GNUC_CONST; static void gee_abstract_collection_finalize (GObject* obj); -GType gee_iterable_get_element_type (GeeIterable* self); static void _vala_gee_abstract_collection_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_gee_abstract_collection_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); /** @@ -275,1333 +330,141 @@ void gee_abstract_collection_clear (GeeAbstractCollection* self) { /** * {@inheritDoc} */ -static gpointer* gee_abstract_collection_real_to_array (GeeAbstractCollection* self, int* result_length1) { - gpointer* result = NULL; - GType t; - GType _tmp0_; - t = self->priv->g_type; - _tmp0_ = t; - if (_tmp0_ == G_TYPE_BOOLEAN) { - gint _tmp1_ = 0; - gboolean* _tmp2_ = NULL; - gpointer* _tmp3_; - gint _tmp3__length1; - _tmp2_ = gee_abstract_collection_to_bool_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp1_); - _tmp3_ = (gpointer*) _tmp2_; - _tmp3__length1 = (_tmp1_ * sizeof (gboolean)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp3__length1; - } - result = _tmp3_; - return result; - } else { - GType _tmp4_; - _tmp4_ = t; - if (_tmp4_ == G_TYPE_CHAR) { - gint _tmp5_ = 0; - gchar* _tmp6_ = NULL; - gpointer* _tmp7_; - gint _tmp7__length1; - _tmp6_ = gee_abstract_collection_to_char_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp5_); - _tmp7_ = (gpointer*) _tmp6_; - _tmp7__length1 = (_tmp5_ * sizeof (gchar)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp7__length1; - } - result = _tmp7_; - return result; - } else { - GType _tmp8_; - _tmp8_ = t; - if (_tmp8_ == G_TYPE_UCHAR) { - gint _tmp9_ = 0; - guchar* _tmp10_ = NULL; - gpointer* _tmp11_; - gint _tmp11__length1; - _tmp10_ = gee_abstract_collection_to_uchar_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp9_); - _tmp11_ = (gpointer*) _tmp10_; - _tmp11__length1 = (_tmp9_ * sizeof (guchar)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp11__length1; - } - result = _tmp11_; - return result; - } else { - GType _tmp12_; - _tmp12_ = t; - if (_tmp12_ == G_TYPE_INT) { - gint _tmp13_ = 0; - gint* _tmp14_ = NULL; - gpointer* _tmp15_; - gint _tmp15__length1; - _tmp14_ = gee_abstract_collection_to_int_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp13_); - _tmp15_ = (gpointer*) _tmp14_; - _tmp15__length1 = (_tmp13_ * sizeof (gint)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp15__length1; - } - result = _tmp15_; - return result; - } else { - GType _tmp16_; - _tmp16_ = t; - if (_tmp16_ == G_TYPE_UINT) { - gint _tmp17_ = 0; - guint* _tmp18_ = NULL; - gpointer* _tmp19_; - gint _tmp19__length1; - _tmp18_ = gee_abstract_collection_to_uint_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp17_); - _tmp19_ = (gpointer*) _tmp18_; - _tmp19__length1 = (_tmp17_ * sizeof (guint)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp19__length1; - } - result = _tmp19_; - return result; - } else { - GType _tmp20_; - _tmp20_ = t; - if (_tmp20_ == G_TYPE_INT64) { - gint _tmp21_ = 0; - gint64* _tmp22_ = NULL; - gpointer* _tmp23_; - gint _tmp23__length1; - _tmp22_ = gee_abstract_collection_to_int64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp21_); - _tmp23_ = (gpointer*) _tmp22_; - _tmp23__length1 = (_tmp21_ * sizeof (gint64)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp23__length1; - } - result = _tmp23_; - return result; - } else { - GType _tmp24_; - _tmp24_ = t; - if (_tmp24_ == G_TYPE_UINT64) { - gint _tmp25_ = 0; - guint64* _tmp26_ = NULL; - gpointer* _tmp27_; - gint _tmp27__length1; - _tmp26_ = gee_abstract_collection_to_uint64_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp25_); - _tmp27_ = (gpointer*) _tmp26_; - _tmp27__length1 = (_tmp25_ * sizeof (guint64)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp27__length1; - } - result = _tmp27_; - return result; - } else { - GType _tmp28_; - _tmp28_ = t; - if (_tmp28_ == G_TYPE_LONG) { - gint _tmp29_ = 0; - glong* _tmp30_ = NULL; - gpointer* _tmp31_; - gint _tmp31__length1; - _tmp30_ = gee_abstract_collection_to_long_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp29_); - _tmp31_ = (gpointer*) _tmp30_; - _tmp31__length1 = (_tmp29_ * sizeof (glong)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp31__length1; - } - result = _tmp31_; - return result; - } else { - GType _tmp32_; - _tmp32_ = t; - if (_tmp32_ == G_TYPE_ULONG) { - gint _tmp33_ = 0; - gulong* _tmp34_ = NULL; - gpointer* _tmp35_; - gint _tmp35__length1; - _tmp34_ = gee_abstract_collection_to_ulong_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp33_); - _tmp35_ = (gpointer*) _tmp34_; - _tmp35__length1 = (_tmp33_ * sizeof (gulong)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp35__length1; - } - result = _tmp35_; - return result; - } else { - GType _tmp36_; - _tmp36_ = t; - if (_tmp36_ == G_TYPE_FLOAT) { - gint _tmp37_ = 0; - gfloat** _tmp38_ = NULL; - gpointer* _tmp39_; - gint _tmp39__length1; - _tmp38_ = gee_abstract_collection_to_float_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp37_); - _tmp39_ = (gpointer*) _tmp38_; - _tmp39__length1 = (_tmp37_ * sizeof (gfloat*)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp39__length1; - } - result = _tmp39_; - return result; - } else { - GType _tmp40_; - _tmp40_ = t; - if (_tmp40_ == G_TYPE_DOUBLE) { - gint _tmp41_ = 0; - gdouble** _tmp42_ = NULL; - gpointer* _tmp43_; - gint _tmp43__length1; - _tmp42_ = gee_abstract_collection_to_double_array (G_TYPE_CHECK_INSTANCE_CAST (self, GEE_TYPE_COLLECTION, GeeCollection), &_tmp41_); - _tmp43_ = (gpointer*) _tmp42_; - _tmp43__length1 = (_tmp41_ * sizeof (gdouble*)) / sizeof (gpointer); - if (result_length1) { - *result_length1 = _tmp43__length1; - } - result = _tmp43_; - return result; - } else { - gint _tmp44_; - gint _tmp45_; - gpointer* _tmp46_ = NULL; - gpointer* array; - gint array_length1; - gint _array_size_; - gint index; - gpointer* _tmp57_; - gint _tmp57__length1; - _tmp44_ = gee_collection_get_size ((GeeCollection*) self); - _tmp45_ = _tmp44_; - _tmp46_ = g_new0 (gpointer, _tmp45_); - array = _tmp46_; - array_length1 = _tmp45_; - _array_size_ = array_length1; - index = 0; - { - GeeIterator* _tmp47_ = NULL; - GeeIterator* _element_it; - _tmp47_ = gee_abstract_collection_iterator (self); - _element_it = _tmp47_; - while (TRUE) { - GeeIterator* _tmp48_; - gboolean _tmp49_ = FALSE; - GeeIterator* _tmp50_; - gpointer _tmp51_ = NULL; - gpointer element; - gpointer* _tmp52_; - gint _tmp52__length1; - gint _tmp53_; - gconstpointer _tmp54_; - gpointer _tmp55_; - gpointer _tmp56_; - _tmp48_ = _element_it; - _tmp49_ = gee_iterator_next (_tmp48_); - if (!_tmp49_) { - break; - } - _tmp50_ = _element_it; - _tmp51_ = gee_iterator_get (_tmp50_); - element = _tmp51_; - _tmp52_ = array; - _tmp52__length1 = array_length1; - _tmp53_ = index; - index = _tmp53_ + 1; - _tmp54_ = element; - _tmp55_ = ((_tmp54_ != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) _tmp54_) : ((gpointer) _tmp54_); - ((_tmp52_[_tmp53_] == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp52_[_tmp53_] = (self->priv->g_destroy_func (_tmp52_[_tmp53_]), NULL)); - _tmp52_[_tmp53_] = _tmp55_; - _tmp56_ = _tmp52_[_tmp53_]; - ((element == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (element = (self->priv->g_destroy_func (element), NULL)); - } - _g_object_unref0 (_element_it); - } - _tmp57_ = array; - _tmp57__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp57__length1; - } - result = _tmp57_; - return result; - } - } - } - } - } - } - } - } - } - } - } +static GeeIterator* gee_abstract_collection_real_iterator (GeeAbstractCollection* self) { + g_critical ("Type `%s' does not implement abstract method `gee_abstract_collection_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); + return NULL; } -gpointer* gee_abstract_collection_to_array (GeeAbstractCollection* self, int* result_length1) { +GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self) { g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->to_array (self, result_length1); -} - - -static gboolean* gee_abstract_collection_to_bool_array (GeeCollection* coll, int* result_length1) { - gboolean* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gboolean* _tmp3_ = NULL; - gboolean* array; - gint array_length1; - gint _array_size_; - gint index; - gboolean* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gboolean, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gboolean element; - gboolean* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gboolean _tmp12_; - gboolean _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gboolean) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; -} - - -static gchar* gee_abstract_collection_to_char_array (GeeCollection* coll, int* result_length1) { - gchar* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gchar* _tmp3_ = NULL; - gchar* array; - gint array_length1; - gint _array_size_; - gint index; - gchar* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gchar, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gchar element; - gchar* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gchar _tmp12_; - gchar _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gchar) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; + return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->iterator (self); } -static guchar* gee_abstract_collection_to_uchar_array (GeeCollection* coll, int* result_length1) { - guchar* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - guchar* _tmp3_ = NULL; - guchar* array; - gint array_length1; - gint _array_size_; - gint index; - guchar* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (guchar, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - guchar element; - guchar* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - guchar _tmp12_; - guchar _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (guchar) ((guintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; +static gboolean gee_abstract_collection_real_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target) { + gboolean result = FALSE; + GeeIterator* _tmp0_ = NULL; + GeeIterator* _tmp1_; + GeeForallFunc _tmp2_; + void* _tmp2__target; + gboolean _tmp3_ = FALSE; + gboolean _tmp4_; + _tmp0_ = gee_abstract_collection_iterator (self); + _tmp1_ = _tmp0_; + _tmp2_ = f; + _tmp2__target = f_target; + _tmp3_ = gee_traversable_foreach ((GeeTraversable*) _tmp1_, _tmp2_, _tmp2__target); + _tmp4_ = _tmp3_; + _g_object_unref0 (_tmp1_); + result = _tmp4_; return result; } -static gint* gee_abstract_collection_to_int_array (GeeCollection* coll, int* result_length1) { - gint* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gint* _tmp3_ = NULL; - gint* array; - gint array_length1; - gint _array_size_; - gint index; - gint* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gint, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gint element; - gint* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gint _tmp12_; - gint _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gint) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +gboolean gee_abstract_collection_foreach (GeeAbstractCollection* self, GeeForallFunc f, void* f_target) { + g_return_val_if_fail (self != NULL, FALSE); + return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->foreach (self, f, f_target); } -static guint* gee_abstract_collection_to_uint_array (GeeCollection* coll, int* result_length1) { - guint* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - guint* _tmp3_ = NULL; - guint* array; - gint array_length1; - gint _array_size_; - gint index; - guint* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (guint, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - guint element; - guint* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - guint _tmp12_; - guint _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (guint) ((guintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +static void gee_abstract_collection_real_reserved0 (GeeAbstractCollection* self) { } -static gint64* gee_abstract_collection_to_int64_array (GeeCollection* coll, int* result_length1) { - gint64* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gint64* _tmp3_ = NULL; - gint64* array; - gint array_length1; - gint _array_size_; - gint index; - gint64* _tmp16_; - gint _tmp16__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gint64, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gint64* _tmp10_; - gint64 _tmp11_; - gint64 element; - gint64* _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gint64 _tmp14_; - gint64 _tmp15_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (gint64*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp12_[_tmp13_] = _tmp14_; - _tmp15_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp16_ = array; - _tmp16__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp16__length1; - } - result = _tmp16_; - return result; +void gee_abstract_collection_reserved0 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved0 (self); } -static guint64* gee_abstract_collection_to_uint64_array (GeeCollection* coll, int* result_length1) { - guint64* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - guint64* _tmp3_ = NULL; - guint64* array; - gint array_length1; - gint _array_size_; - gint index; - guint64* _tmp16_; - gint _tmp16__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (guint64, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - guint64* _tmp10_; - guint64 _tmp11_; - guint64 element; - guint64* _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - guint64 _tmp14_; - guint64 _tmp15_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (guint64*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp12_[_tmp13_] = _tmp14_; - _tmp15_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp16_ = array; - _tmp16__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp16__length1; - } - result = _tmp16_; - return result; +static void gee_abstract_collection_real_reserved1 (GeeAbstractCollection* self) { } -static glong* gee_abstract_collection_to_long_array (GeeCollection* coll, int* result_length1) { - glong* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - glong* _tmp3_ = NULL; - glong* array; - gint array_length1; - gint _array_size_; - gint index; - glong* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (glong, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - glong element; - glong* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - glong _tmp12_; - glong _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (glong) ((gintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +void gee_abstract_collection_reserved1 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved1 (self); } -static gulong* gee_abstract_collection_to_ulong_array (GeeCollection* coll, int* result_length1) { - gulong* result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gulong* _tmp3_ = NULL; - gulong* array; - gint array_length1; - gint _array_size_; - gint index; - gulong* _tmp14_; - gint _tmp14__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gulong, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gulong element; - gulong* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gulong _tmp12_; - gulong _tmp13_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - element = (gulong) ((guintptr) _tmp9_); - _tmp10_ = array; - _tmp10__length1 = array_length1; - _tmp11_ = index; - index = _tmp11_ + 1; - _tmp12_ = element; - _tmp10_[_tmp11_] = _tmp12_; - _tmp13_ = _tmp10_[_tmp11_]; - } - _g_object_unref0 (_element_it); - } - _tmp14_ = array; - _tmp14__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp14__length1; - } - result = _tmp14_; - return result; +static void gee_abstract_collection_real_reserved2 (GeeAbstractCollection* self) { } -static gfloat* _float_dup (gfloat* self) { - gfloat* dup; - dup = g_new0 (gfloat, 1); - memcpy (dup, self, sizeof (gfloat)); - return dup; +void gee_abstract_collection_reserved2 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved2 (self); } -static gpointer __float_dup0 (gpointer self) { - return self ? _float_dup (self) : NULL; +static void gee_abstract_collection_real_reserved3 (GeeAbstractCollection* self) { } -static gfloat** gee_abstract_collection_to_float_array (GeeCollection* coll, int* result_length1) { - gfloat** result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gfloat** _tmp3_ = NULL; - gfloat** array; - gint array_length1; - gint _array_size_; - gint index; - gfloat** _tmp17_; - gint _tmp17__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gfloat*, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gfloat* _tmp10_; - gfloat _tmp11_; - gfloat element; - gfloat** _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gfloat _tmp14_; - gfloat* _tmp15_; - gfloat* _tmp16_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (gfloat*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp15_ = __float_dup0 (&_tmp14_); - _g_free0 (_tmp12_[_tmp13_]); - _tmp12_[_tmp13_] = _tmp15_; - _tmp16_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp17_ = array; - _tmp17__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp17__length1; - } - result = _tmp17_; - return result; +void gee_abstract_collection_reserved3 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved3 (self); } -static gdouble* _double_dup (gdouble* self) { - gdouble* dup; - dup = g_new0 (gdouble, 1); - memcpy (dup, self, sizeof (gdouble)); - return dup; +static void gee_abstract_collection_real_reserved4 (GeeAbstractCollection* self) { } -static gpointer __double_dup0 (gpointer self) { - return self ? _double_dup (self) : NULL; +void gee_abstract_collection_reserved4 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved4 (self); } -static gdouble** gee_abstract_collection_to_double_array (GeeCollection* coll, int* result_length1) { - gdouble** result = NULL; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gdouble** _tmp3_ = NULL; - gdouble** array; - gint array_length1; - gint _array_size_; - gint index; - gdouble** _tmp17_; - gint _tmp17__length1; - g_return_val_if_fail (coll != NULL, NULL); - _tmp0_ = coll; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = g_new0 (gdouble*, _tmp2_); - array = _tmp3_; - array_length1 = _tmp2_; - _array_size_ = array_length1; - index = 0; - { - GeeCollection* _tmp4_; - GeeIterator* _tmp5_ = NULL; - GeeIterator* _element_it; - _tmp4_ = coll; - _tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_); - _element_it = _tmp5_; - while (TRUE) { - GeeIterator* _tmp6_; - gboolean _tmp7_ = FALSE; - GeeIterator* _tmp8_; - gpointer _tmp9_ = NULL; - gdouble* _tmp10_; - gdouble _tmp11_; - gdouble element; - gdouble** _tmp12_; - gint _tmp12__length1; - gint _tmp13_; - gdouble _tmp14_; - gdouble* _tmp15_; - gdouble* _tmp16_; - _tmp6_ = _element_it; - _tmp7_ = gee_iterator_next (_tmp6_); - if (!_tmp7_) { - break; - } - _tmp8_ = _element_it; - _tmp9_ = gee_iterator_get (_tmp8_); - _tmp10_ = (gdouble*) _tmp9_; - _tmp11_ = *_tmp10_; - _g_free0 (_tmp10_); - element = _tmp11_; - _tmp12_ = array; - _tmp12__length1 = array_length1; - _tmp13_ = index; - index = _tmp13_ + 1; - _tmp14_ = element; - _tmp15_ = __double_dup0 (&_tmp14_); - _g_free0 (_tmp12_[_tmp13_]); - _tmp12_[_tmp13_] = _tmp15_; - _tmp16_ = _tmp12_[_tmp13_]; - } - _g_object_unref0 (_element_it); - } - _tmp17_ = array; - _tmp17__length1 = array_length1; - if (result_length1) { - *result_length1 = _tmp17__length1; - } - result = _tmp17_; - return result; +static void gee_abstract_collection_real_reserved5 (GeeAbstractCollection* self) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_add_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - GeeCollection* _tmp0_; - gboolean _tmp1_; - gboolean _tmp2_; - gboolean changed; - g_return_val_if_fail (collection != NULL, FALSE); - _tmp0_ = collection; - _tmp1_ = gee_collection_get_is_empty (_tmp0_); - _tmp2_ = _tmp1_; - if (_tmp2_) { - result = FALSE; - return result; - } - changed = FALSE; - { - GeeCollection* _tmp3_; - GeeIterator* _tmp4_ = NULL; - GeeIterator* _item_it; - _tmp3_ = collection; - _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_); - _item_it = _tmp4_; - while (TRUE) { - GeeIterator* _tmp5_; - gboolean _tmp6_ = FALSE; - GeeIterator* _tmp7_; - gpointer _tmp8_ = NULL; - gpointer item; - gboolean _tmp9_; - gconstpointer _tmp10_; - gboolean _tmp11_ = FALSE; - _tmp5_ = _item_it; - _tmp6_ = gee_iterator_next (_tmp5_); - if (!_tmp6_) { - break; - } - _tmp7_ = _item_it; - _tmp8_ = gee_iterator_get (_tmp7_); - item = _tmp8_; - _tmp9_ = changed; - _tmp10_ = item; - _tmp11_ = gee_abstract_collection_add (self, _tmp10_); - changed = _tmp9_ | _tmp11_; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - result = changed; - return result; +void gee_abstract_collection_reserved5 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved5 (self); } -gboolean gee_abstract_collection_add_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->add_all (self, collection); +static void gee_abstract_collection_real_reserved6 (GeeAbstractCollection* self) { } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_contains_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - GeeCollection* _tmp0_; - gint _tmp1_; - gint _tmp2_; - gint _tmp3_; - gint _tmp4_; - g_return_val_if_fail (collection != NULL, FALSE); - _tmp0_ = collection; - _tmp1_ = gee_collection_get_size (_tmp0_); - _tmp2_ = _tmp1_; - _tmp3_ = gee_collection_get_size ((GeeCollection*) self); - _tmp4_ = _tmp3_; - if (_tmp2_ > _tmp4_) { - result = FALSE; - return result; - } - { - GeeCollection* _tmp5_; - GeeIterator* _tmp6_ = NULL; - GeeIterator* _item_it; - _tmp5_ = collection; - _tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_); - _item_it = _tmp6_; - while (TRUE) { - GeeIterator* _tmp7_; - gboolean _tmp8_ = FALSE; - GeeIterator* _tmp9_; - gpointer _tmp10_ = NULL; - gpointer item; - gconstpointer _tmp11_; - gboolean _tmp12_ = FALSE; - _tmp7_ = _item_it; - _tmp8_ = gee_iterator_next (_tmp7_); - if (!_tmp8_) { - break; - } - _tmp9_ = _item_it; - _tmp10_ = gee_iterator_get (_tmp9_); - item = _tmp10_; - _tmp11_ = item; - _tmp12_ = gee_abstract_collection_contains (self, _tmp11_); - if (!_tmp12_) { - result = FALSE; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - _g_object_unref0 (_item_it); - return result; - } - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - result = TRUE; - return result; -} - - -gboolean gee_abstract_collection_contains_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->contains_all (self, collection); +void gee_abstract_collection_reserved6 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved6 (self); } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_remove_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - gboolean changed; - g_return_val_if_fail (collection != NULL, FALSE); - changed = FALSE; - { - GeeCollection* _tmp0_; - GeeIterator* _tmp1_ = NULL; - GeeIterator* _item_it; - _tmp0_ = collection; - _tmp1_ = gee_iterable_iterator ((GeeIterable*) _tmp0_); - _item_it = _tmp1_; - while (TRUE) { - GeeIterator* _tmp2_; - gboolean _tmp3_ = FALSE; - GeeIterator* _tmp4_; - gpointer _tmp5_ = NULL; - gpointer item; - gboolean _tmp6_; - gconstpointer _tmp7_; - gboolean _tmp8_ = FALSE; - _tmp2_ = _item_it; - _tmp3_ = gee_iterator_next (_tmp2_); - if (!_tmp3_) { - break; - } - _tmp4_ = _item_it; - _tmp5_ = gee_iterator_get (_tmp4_); - item = _tmp5_; - _tmp6_ = changed; - _tmp7_ = item; - _tmp8_ = gee_abstract_collection_remove (self, _tmp7_); - changed = _tmp6_ | _tmp8_; - ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); - } - _g_object_unref0 (_item_it); - } - result = changed; - return result; +static void gee_abstract_collection_real_reserved7 (GeeAbstractCollection* self) { } -gboolean gee_abstract_collection_remove_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->remove_all (self, collection); +void gee_abstract_collection_reserved7 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved7 (self); } -/** - * {@inheritDoc} - */ -static gboolean gee_abstract_collection_real_retain_all (GeeAbstractCollection* self, GeeCollection* collection) { - gboolean result = FALSE; - gboolean changed; - gint _tmp0_ = 0; - gpointer* _tmp1_ = NULL; - gpointer* items; - gint items_length1; - gint _items_size_; - gint _tmp2_; - gint _tmp3_; - gint size_of_items; - g_return_val_if_fail (collection != NULL, FALSE); - changed = FALSE; - _tmp1_ = gee_abstract_collection_to_array (self, &_tmp0_); - items = _tmp1_; - items_length1 = _tmp0_; - _items_size_ = items_length1; - _tmp2_ = gee_collection_get_size ((GeeCollection*) self); - _tmp3_ = _tmp2_; - size_of_items = _tmp3_; - { - gint index; - index = 0; - { - gboolean _tmp4_; - _tmp4_ = TRUE; - while (TRUE) { - gboolean _tmp5_; - gint _tmp7_; - gint _tmp8_; - GeeCollection* _tmp9_; - gpointer* _tmp10_; - gint _tmp10__length1; - gint _tmp11_; - gconstpointer _tmp12_; - gboolean _tmp13_ = FALSE; - _tmp5_ = _tmp4_; - if (!_tmp5_) { - gint _tmp6_; - _tmp6_ = index; - index = _tmp6_ + 1; - } - _tmp4_ = FALSE; - _tmp7_ = index; - _tmp8_ = size_of_items; - if (!(_tmp7_ < _tmp8_)) { - break; - } - _tmp9_ = collection; - _tmp10_ = items; - _tmp10__length1 = items_length1; - _tmp11_ = index; - _tmp12_ = _tmp10_[_tmp11_]; - _tmp13_ = gee_collection_contains (_tmp9_, _tmp12_); - if (!_tmp13_) { - gboolean _tmp14_; - gpointer* _tmp15_; - gint _tmp15__length1; - gint _tmp16_; - gconstpointer _tmp17_; - gboolean _tmp18_ = FALSE; - _tmp14_ = changed; - _tmp15_ = items; - _tmp15__length1 = items_length1; - _tmp16_ = index; - _tmp17_ = _tmp15_[_tmp16_]; - _tmp18_ = gee_abstract_collection_remove (self, _tmp17_); - changed = _tmp14_ | _tmp18_; - } - } - } - } - result = changed; - items = (_vala_array_free (items, items_length1, (GDestroyNotify) self->priv->g_destroy_func), NULL); - return result; +static void gee_abstract_collection_real_reserved8 (GeeAbstractCollection* self) { } -gboolean gee_abstract_collection_retain_all (GeeAbstractCollection* self, GeeCollection* collection) { - g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->retain_all (self, collection); +void gee_abstract_collection_reserved8 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved8 (self); } -/** - * {@inheritDoc} - */ -static GeeIterator* gee_abstract_collection_real_iterator (GeeAbstractCollection* self) { - g_critical ("Type `%s' does not implement abstract method `gee_abstract_collection_iterator'", g_type_name (G_TYPE_FROM_INSTANCE (self))); - return NULL; +static void gee_abstract_collection_real_reserved9 (GeeAbstractCollection* self) { } -GeeIterator* gee_abstract_collection_iterator (GeeAbstractCollection* self) { - g_return_val_if_fail (self != NULL, NULL); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->iterator (self); +void gee_abstract_collection_reserved9 (GeeAbstractCollection* self) { + g_return_if_fail (self != NULL); + GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->reserved9 (self); } @@ -1621,31 +484,9 @@ gint gee_abstract_collection_get_size (GeeAbstractCollection* self) { } -gboolean gee_abstract_collection_get_is_empty (GeeAbstractCollection* self) { +gboolean gee_abstract_collection_get_read_only (GeeAbstractCollection* self) { g_return_val_if_fail (self != NULL, FALSE); - return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->get_is_empty (self); -} - - -static gboolean gee_abstract_collection_real_get_is_empty (GeeAbstractCollection* base) { - gboolean result; - GeeAbstractCollection* self; - gint _tmp0_; - gint _tmp1_; - self = base; - _tmp0_ = gee_collection_get_size ((GeeCollection*) self); - _tmp1_ = _tmp0_; - result = _tmp1_ == 0; - return result; -} - - -static GType gee_abstract_collection_real_get_element_type (GeeIterable* base) { - GType result; - GeeAbstractCollection* self; - self = (GeeAbstractCollection*) base; - result = self->priv->g_type; - return result; + return GEE_ABSTRACT_COLLECTION_GET_CLASS (self)->get_read_only (self); } @@ -1696,13 +537,18 @@ static void gee_abstract_collection_class_init (GeeAbstractCollectionClass * kla GEE_ABSTRACT_COLLECTION_CLASS (klass)->add = gee_abstract_collection_real_add; GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove = gee_abstract_collection_real_remove; GEE_ABSTRACT_COLLECTION_CLASS (klass)->clear = gee_abstract_collection_real_clear; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->to_array = gee_abstract_collection_real_to_array; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->add_all = gee_abstract_collection_real_add_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->contains_all = gee_abstract_collection_real_contains_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->remove_all = gee_abstract_collection_real_remove_all; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->retain_all = gee_abstract_collection_real_retain_all; GEE_ABSTRACT_COLLECTION_CLASS (klass)->iterator = gee_abstract_collection_real_iterator; - GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_is_empty = gee_abstract_collection_real_get_is_empty; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->foreach = gee_abstract_collection_real_foreach; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved0 = gee_abstract_collection_real_reserved0; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved1 = gee_abstract_collection_real_reserved1; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved2 = gee_abstract_collection_real_reserved2; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved3 = gee_abstract_collection_real_reserved3; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved4 = gee_abstract_collection_real_reserved4; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved5 = gee_abstract_collection_real_reserved5; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved6 = gee_abstract_collection_real_reserved6; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved7 = gee_abstract_collection_real_reserved7; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved8 = gee_abstract_collection_real_reserved8; + GEE_ABSTRACT_COLLECTION_CLASS (klass)->reserved9 = gee_abstract_collection_real_reserved9; GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only_view = gee_abstract_collection_real_get_read_only_view; G_OBJECT_CLASS (klass)->get_property = _vala_gee_abstract_collection_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_gee_abstract_collection_set_property; @@ -1717,11 +563,7 @@ static void gee_abstract_collection_class_init (GeeAbstractCollectionClass * kla /** * {@inheritDoc} */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_COLLECTION_IS_EMPTY, g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE)); - /** - * {@inheritDoc} - */ - g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_ABSTRACT_COLLECTION_ELEMENT_TYPE, g_param_spec_gtype ("element-type", "element-type", "element-type", G_TYPE_NONE, 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_ABSTRACT_COLLECTION_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)); /** * {@inheritDoc} */ @@ -1729,10 +571,66 @@ static void gee_abstract_collection_class_init (GeeAbstractCollectionClass * kla } +static GType gee_abstract_collection_gee_traversable_get_g_type (GeeAbstractCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_collection_gee_traversable_get_g_dup_func (GeeAbstractCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_collection_gee_traversable_get_g_destroy_func (GeeAbstractCollection* self) { + return self->priv->g_destroy_func; +} + + +static void gee_abstract_collection_gee_traversable_interface_init (GeeTraversableIface * iface) { + gee_abstract_collection_gee_traversable_parent_iface = g_type_interface_peek_parent (iface); + iface->foreach = (gboolean (*)(GeeTraversable*, GeeForallFunc, void*)) gee_abstract_collection_foreach; + iface->get_g_type = (GType(*)(GeeTraversable*)) gee_abstract_collection_gee_traversable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeTraversable*)) gee_abstract_collection_gee_traversable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeTraversable*)) gee_abstract_collection_gee_traversable_get_g_destroy_func; +} + + +static GType gee_abstract_collection_gee_iterable_get_g_type (GeeAbstractCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_collection_gee_iterable_get_g_dup_func (GeeAbstractCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_collection_gee_iterable_get_g_destroy_func (GeeAbstractCollection* self) { + return self->priv->g_destroy_func; +} + + static void gee_abstract_collection_gee_iterable_interface_init (GeeIterableIface * iface) { gee_abstract_collection_gee_iterable_parent_iface = g_type_interface_peek_parent (iface); iface->iterator = (GeeIterator* (*)(GeeIterable*)) gee_abstract_collection_iterator; - iface->get_element_type = gee_abstract_collection_real_get_element_type; + iface->get_g_type = (GType(*)(GeeIterable*)) gee_abstract_collection_gee_iterable_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeIterable*)) gee_abstract_collection_gee_iterable_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeIterable*)) gee_abstract_collection_gee_iterable_get_g_destroy_func; +} + + +static GType gee_abstract_collection_gee_collection_get_g_type (GeeAbstractCollection* self) { + return self->priv->g_type; +} + + +static GBoxedCopyFunc gee_abstract_collection_gee_collection_get_g_dup_func (GeeAbstractCollection* self) { + return self->priv->g_dup_func; +} + + +static GDestroyNotify gee_abstract_collection_gee_collection_get_g_destroy_func (GeeAbstractCollection* self) { + return self->priv->g_destroy_func; } @@ -1742,13 +640,11 @@ static void gee_abstract_collection_gee_collection_interface_init (GeeCollection iface->add = (gboolean (*)(GeeCollection*, gconstpointer)) gee_abstract_collection_add; iface->remove = (gboolean (*)(GeeCollection*, gconstpointer)) gee_abstract_collection_remove; iface->clear = (void (*)(GeeCollection*)) gee_abstract_collection_clear; - iface->to_array = (gpointer* (*)(GeeCollection*, int*)) gee_abstract_collection_to_array; - iface->add_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_add_all; - iface->contains_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_contains_all; - iface->remove_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_remove_all; - iface->retain_all = (gboolean (*)(GeeCollection*, GeeCollection*)) gee_abstract_collection_retain_all; + iface->get_g_type = (GType(*)(GeeCollection*)) gee_abstract_collection_gee_collection_get_g_type; + iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeCollection*)) gee_abstract_collection_gee_collection_get_g_dup_func; + iface->get_g_destroy_func = (GDestroyNotify(*)(GeeCollection*)) gee_abstract_collection_gee_collection_get_g_destroy_func; iface->get_size = (gint (*) (GeeCollection *)) gee_abstract_collection_get_size; - iface->get_is_empty = (gboolean (*) (GeeCollection *)) gee_abstract_collection_get_is_empty; + iface->get_read_only = (gboolean (*) (GeeCollection *)) gee_abstract_collection_get_read_only; iface->get_read_only_view = (GeeCollection* (*) (GeeCollection *)) gee_abstract_collection_get_read_only_view; } @@ -1778,10 +674,12 @@ GType gee_abstract_collection_get_type (void) { static volatile gsize gee_abstract_collection_type_id__volatile = 0; if (g_once_init_enter (&gee_abstract_collection_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (GeeAbstractCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_abstract_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeAbstractCollection), 0, (GInstanceInitFunc) gee_abstract_collection_instance_init, NULL }; + static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_abstract_collection_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_iterable_info = { (GInterfaceInitFunc) gee_abstract_collection_gee_iterable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo gee_collection_info = { (GInterfaceInitFunc) gee_abstract_collection_gee_collection_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType gee_abstract_collection_type_id; gee_abstract_collection_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeAbstractCollection", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); + g_type_add_interface_static (gee_abstract_collection_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info); g_type_add_interface_static (gee_abstract_collection_type_id, GEE_TYPE_ITERABLE, &gee_iterable_info); g_type_add_interface_static (gee_abstract_collection_type_id, GEE_TYPE_COLLECTION, &gee_collection_info); g_once_init_leave (&gee_abstract_collection_type_id__volatile, gee_abstract_collection_type_id); @@ -1794,12 +692,6 @@ static void _vala_gee_abstract_collection_get_property (GObject * object, guint GeeAbstractCollection * self; self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection); switch (property_id) { - case GEE_ABSTRACT_COLLECTION_IS_EMPTY: - g_value_set_boolean (value, gee_abstract_collection_get_is_empty (self)); - break; - case GEE_ABSTRACT_COLLECTION_ELEMENT_TYPE: - g_value_set_gtype (value, gee_iterable_get_element_type ((GeeIterable*) self)); - break; case GEE_ABSTRACT_COLLECTION_READ_ONLY_VIEW: g_value_take_object (value, gee_abstract_collection_get_read_only_view (self)); break; @@ -1830,22 +722,4 @@ static void _vala_gee_abstract_collection_set_property (GObject * object, guint } -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); -} - - |