1 /* readonlysortedset.c generated by valac 0.18.0, the Vala compiler
2 * generated from readonlysortedset.vala, do not modify */
4 /* readonlysortedset.vala
6 * Copyright (C) 2009 Didier Villevalois, Maciej Piechotka
7 * Copyright (C) 2011 Maciej Piechotka
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 * Maciej Piechotka <uzytkownik2@gmail.com>
28 #include <glib-object.h>
31 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
32 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
33 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
34 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
36 typedef struct _GeeTraversable GeeTraversable;
37 typedef struct _GeeTraversableIface GeeTraversableIface;
39 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
41 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
42 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
43 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
44 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
45 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
46 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
48 typedef struct _GeeLazy GeeLazy;
49 typedef struct _GeeLazyClass GeeLazyClass;
51 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
52 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
53 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
54 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
56 typedef struct _GeeIterator GeeIterator;
57 typedef struct _GeeIteratorIface GeeIteratorIface;
59 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
60 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
61 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
62 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
64 typedef struct _GeeIterable GeeIterable;
65 typedef struct _GeeIterableIface GeeIterableIface;
67 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
68 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
69 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
70 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
72 typedef struct _GeeCollection GeeCollection;
73 typedef struct _GeeCollectionIface GeeCollectionIface;
75 #define GEE_TYPE_READ_ONLY_COLLECTION (gee_read_only_collection_get_type ())
76 #define GEE_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollection))
77 #define GEE_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass))
78 #define GEE_IS_READ_ONLY_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_COLLECTION))
79 #define GEE_IS_READ_ONLY_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_COLLECTION))
80 #define GEE_READ_ONLY_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_COLLECTION, GeeReadOnlyCollectionClass))
82 typedef struct _GeeReadOnlyCollection GeeReadOnlyCollection;
83 typedef struct _GeeReadOnlyCollectionClass GeeReadOnlyCollectionClass;
84 typedef struct _GeeReadOnlyCollectionPrivate GeeReadOnlyCollectionPrivate;
86 #define GEE_TYPE_SET (gee_set_get_type ())
87 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
88 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
89 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
91 typedef struct _GeeSet GeeSet;
92 typedef struct _GeeSetIface GeeSetIface;
94 #define GEE_TYPE_READ_ONLY_SET (gee_read_only_set_get_type ())
95 #define GEE_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySet))
96 #define GEE_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass))
97 #define GEE_IS_READ_ONLY_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SET))
98 #define GEE_IS_READ_ONLY_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SET))
99 #define GEE_READ_ONLY_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SET, GeeReadOnlySetClass))
101 typedef struct _GeeReadOnlySet GeeReadOnlySet;
102 typedef struct _GeeReadOnlySetClass GeeReadOnlySetClass;
103 typedef struct _GeeReadOnlySetPrivate GeeReadOnlySetPrivate;
105 #define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ())
106 #define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet))
107 #define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET))
108 #define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface))
110 typedef struct _GeeSortedSet GeeSortedSet;
111 typedef struct _GeeSortedSetIface GeeSortedSetIface;
113 #define GEE_TYPE_READ_ONLY_SORTED_SET (gee_read_only_sorted_set_get_type ())
114 #define GEE_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet))
115 #define GEE_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass))
116 #define GEE_IS_READ_ONLY_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_SET))
117 #define GEE_IS_READ_ONLY_SORTED_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_SET))
118 #define GEE_READ_ONLY_SORTED_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetClass))
120 typedef struct _GeeReadOnlySortedSet GeeReadOnlySortedSet;
121 typedef struct _GeeReadOnlySortedSetClass GeeReadOnlySortedSetClass;
122 typedef struct _GeeReadOnlySortedSetPrivate GeeReadOnlySortedSetPrivate;
124 #define GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR (gee_read_only_collection_iterator_get_type ())
125 #define GEE_READ_ONLY_COLLECTION_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIterator))
126 #define GEE_READ_ONLY_COLLECTION_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass))
127 #define GEE_READ_ONLY_COLLECTION_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR))
128 #define GEE_READ_ONLY_COLLECTION_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR))
129 #define GEE_READ_ONLY_COLLECTION_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_COLLECTION_TYPE_ITERATOR, GeeReadOnlyCollectionIteratorClass))
131 typedef struct _GeeReadOnlyCollectionIterator GeeReadOnlyCollectionIterator;
132 typedef struct _GeeReadOnlyCollectionIteratorClass GeeReadOnlyCollectionIteratorClass;
133 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
135 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
137 GEE_TRAVERSABLE_STREAM_YIELD,
138 GEE_TRAVERSABLE_STREAM_CONTINUE,
139 GEE_TRAVERSABLE_STREAM_END
140 } GeeTraversableStream;
142 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
143 struct _GeeIteratorIface {
144 GTypeInterface parent_iface;
145 gboolean (*next) (GeeIterator* self);
146 gboolean (*has_next) (GeeIterator* self);
147 gpointer (*get) (GeeIterator* self);
148 void (*remove) (GeeIterator* self);
149 gboolean (*get_valid) (GeeIterator* self);
150 gboolean (*get_read_only) (GeeIterator* self);
153 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
154 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
155 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
156 struct _GeeTraversableIface {
157 GTypeInterface parent_iface;
158 GType (*get_g_type) (GeeTraversable* self);
159 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
160 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
161 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
162 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);
163 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
164 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
165 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
166 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
167 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
168 GType (*get_element_type) (GeeTraversable* self);
171 struct _GeeIterableIface {
172 GTypeInterface parent_iface;
173 GType (*get_g_type) (GeeIterable* self);
174 GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
175 GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
176 GeeIterator* (*iterator) (GeeIterable* self);
179 struct _GeeCollectionIface {
180 GTypeInterface parent_iface;
181 GType (*get_g_type) (GeeCollection* self);
182 GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
183 GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
184 gboolean (*contains) (GeeCollection* self, gconstpointer item);
185 gboolean (*add) (GeeCollection* self, gconstpointer item);
186 gboolean (*remove) (GeeCollection* self, gconstpointer item);
187 void (*clear) (GeeCollection* self);
188 gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
189 gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
190 gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
191 gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
192 gpointer* (*to_array) (GeeCollection* self, int* result_length1);
193 gint (*get_size) (GeeCollection* self);
194 gboolean (*get_is_empty) (GeeCollection* self);
195 gboolean (*get_read_only) (GeeCollection* self);
196 GeeCollection* (*get_read_only_view) (GeeCollection* self);
199 struct _GeeReadOnlyCollection {
200 GObject parent_instance;
201 GeeReadOnlyCollectionPrivate * priv;
202 GeeCollection* _collection;
205 struct _GeeReadOnlyCollectionClass {
206 GObjectClass parent_class;
207 GeeCollection* (*get_read_only_view) (GeeReadOnlyCollection* self);
210 struct _GeeSetIface {
211 GTypeInterface parent_iface;
212 GType (*get_g_type) (GeeSet* self);
213 GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
214 GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
215 GeeSet* (*get_read_only_view) (GeeSet* self);
218 struct _GeeReadOnlySet {
219 GeeReadOnlyCollection parent_instance;
220 GeeReadOnlySetPrivate * priv;
223 struct _GeeReadOnlySetClass {
224 GeeReadOnlyCollectionClass parent_class;
225 GeeSet* (*get_read_only_view) (GeeReadOnlySet* self);
228 struct _GeeSortedSetIface {
229 GTypeInterface parent_iface;
230 GType (*get_g_type) (GeeSortedSet* self);
231 GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self);
232 GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self);
233 gpointer (*first) (GeeSortedSet* self);
234 gpointer (*last) (GeeSortedSet* self);
235 GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element);
236 gpointer (*lower) (GeeSortedSet* self, gconstpointer element);
237 gpointer (*higher) (GeeSortedSet* self, gconstpointer element);
238 gpointer (*floor) (GeeSortedSet* self, gconstpointer element);
239 gpointer (*ceil) (GeeSortedSet* self, gconstpointer element);
240 GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before);
241 GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after);
242 GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to);
243 GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self);
246 struct _GeeReadOnlySortedSet {
247 GeeReadOnlySet parent_instance;
248 GeeReadOnlySortedSetPrivate * priv;
251 struct _GeeReadOnlySortedSetClass {
252 GeeReadOnlySetClass parent_class;
255 struct _GeeReadOnlySortedSetPrivate {
257 GBoxedCopyFunc g_dup_func;
258 GDestroyNotify g_destroy_func;
262 static gpointer gee_read_only_sorted_set_parent_class = NULL;
263 static GeeSortedSetIface* gee_read_only_sorted_set_gee_sorted_set_parent_iface = NULL;
265 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
266 gpointer gee_lazy_ref (gpointer instance);
267 void gee_lazy_unref (gpointer instance);
268 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
269 void gee_value_set_lazy (GValue* value, gpointer v_object);
270 void gee_value_take_lazy (GValue* value, gpointer v_object);
271 gpointer gee_value_get_lazy (const GValue* value);
272 GType gee_lazy_get_type (void) G_GNUC_CONST;
273 GType gee_iterator_get_type (void) G_GNUC_CONST;
274 GType gee_traversable_get_type (void) G_GNUC_CONST;
275 GType gee_iterable_get_type (void) G_GNUC_CONST;
276 GType gee_collection_get_type (void) G_GNUC_CONST;
277 GType gee_read_only_collection_get_type (void) G_GNUC_CONST;
278 GType gee_set_get_type (void) G_GNUC_CONST;
279 GType gee_read_only_set_get_type (void) G_GNUC_CONST;
280 GType gee_sorted_set_get_type (void) G_GNUC_CONST;
281 GType gee_read_only_sorted_set_get_type (void) G_GNUC_CONST;
282 #define GEE_READ_ONLY_SORTED_SET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSetPrivate))
284 GEE_READ_ONLY_SORTED_SET_DUMMY_PROPERTY,
285 GEE_READ_ONLY_SORTED_SET_G_TYPE,
286 GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC,
287 GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC,
288 GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW
290 GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set);
291 GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set);
292 GeeReadOnlySet* gee_read_only_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSet* set);
293 GeeReadOnlySet* gee_read_only_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSet* set);
294 static gpointer gee_read_only_sorted_set_real_first (GeeSortedSet* base);
295 gpointer gee_sorted_set_first (GeeSortedSet* self);
296 static gpointer gee_read_only_sorted_set_real_last (GeeSortedSet* base);
297 gpointer gee_sorted_set_last (GeeSortedSet* self);
298 static GeeIterator* gee_read_only_sorted_set_real_iterator_at (GeeSortedSet* base, gconstpointer element);
299 GeeIterator* gee_sorted_set_iterator_at (GeeSortedSet* self, gconstpointer element);
300 GType gee_read_only_collection_iterator_get_type (void) G_GNUC_CONST;
301 GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator);
302 GeeReadOnlyCollectionIterator* gee_read_only_collection_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeIterator* iterator);
303 static gpointer gee_read_only_sorted_set_real_lower (GeeSortedSet* base, gconstpointer element);
304 gpointer gee_sorted_set_lower (GeeSortedSet* self, gconstpointer element);
305 static gpointer gee_read_only_sorted_set_real_higher (GeeSortedSet* base, gconstpointer element);
306 gpointer gee_sorted_set_higher (GeeSortedSet* self, gconstpointer element);
307 static gpointer gee_read_only_sorted_set_real_floor (GeeSortedSet* base, gconstpointer element);
308 gpointer gee_sorted_set_floor (GeeSortedSet* self, gconstpointer element);
309 static gpointer gee_read_only_sorted_set_real_ceil (GeeSortedSet* base, gconstpointer element);
310 gpointer gee_sorted_set_ceil (GeeSortedSet* self, gconstpointer element);
311 static GeeSortedSet* gee_read_only_sorted_set_real_head_set (GeeSortedSet* base, gconstpointer before);
312 GeeSortedSet* gee_sorted_set_head_set (GeeSortedSet* self, gconstpointer before);
313 GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self);
314 static GeeSortedSet* gee_read_only_sorted_set_real_tail_set (GeeSortedSet* base, gconstpointer after);
315 GeeSortedSet* gee_sorted_set_tail_set (GeeSortedSet* self, gconstpointer after);
316 static GeeSortedSet* gee_read_only_sorted_set_real_sub_set (GeeSortedSet* base, gconstpointer from, gconstpointer to);
317 GeeSortedSet* gee_sorted_set_sub_set (GeeSortedSet* self, gconstpointer from, gconstpointer to);
318 static void _vala_gee_read_only_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
319 static void _vala_gee_read_only_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
323 * Constructs a read-only set that mirrors the content of the specified set.
325 * @param set the set to decorate.
327 GeeReadOnlySortedSet* gee_read_only_sorted_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set) {
328 GeeReadOnlySortedSet * self = NULL;
329 GeeSortedSet* _tmp0_;
330 g_return_val_if_fail (set != NULL, NULL);
332 self = (GeeReadOnlySortedSet*) gee_read_only_set_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, g_destroy_func, (GeeSet*) _tmp0_);
333 self->priv->g_type = g_type;
334 self->priv->g_dup_func = g_dup_func;
335 self->priv->g_destroy_func = g_destroy_func;
340 GeeReadOnlySortedSet* gee_read_only_sorted_set_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeSortedSet* set) {
341 return gee_read_only_sorted_set_construct (GEE_TYPE_READ_ONLY_SORTED_SET, g_type, g_dup_func, g_destroy_func, set);
348 static gpointer gee_read_only_sorted_set_real_first (GeeSortedSet* base) {
349 GeeReadOnlySortedSet * self;
350 gpointer result = NULL;
351 GeeCollection* _tmp0_;
352 gpointer _tmp1_ = NULL;
353 self = (GeeReadOnlySortedSet*) base;
354 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
355 _tmp1_ = gee_sorted_set_first (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL);
364 static gpointer gee_read_only_sorted_set_real_last (GeeSortedSet* base) {
365 GeeReadOnlySortedSet * self;
366 gpointer result = NULL;
367 GeeCollection* _tmp0_;
368 gpointer _tmp1_ = NULL;
369 self = (GeeReadOnlySortedSet*) base;
370 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
371 _tmp1_ = gee_sorted_set_last (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL);
380 static GeeIterator* gee_read_only_sorted_set_real_iterator_at (GeeSortedSet* base, gconstpointer element) {
381 GeeReadOnlySortedSet * self;
382 GeeIterator* result = NULL;
383 GeeCollection* _tmp0_;
384 gconstpointer _tmp1_;
385 GeeIterator* _tmp2_ = NULL;
387 GeeReadOnlyCollectionIterator* _tmp3_ = NULL;
389 self = (GeeReadOnlySortedSet*) base;
390 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
392 _tmp2_ = gee_sorted_set_iterator_at (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
395 if (_tmp4_ != NULL) {
397 GeeReadOnlyCollectionIterator* _tmp6_;
399 _tmp6_ = gee_read_only_collection_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, self->priv->g_destroy_func, _tmp5_);
400 _g_object_unref0 (_tmp3_);
403 _g_object_unref0 (_tmp3_);
406 result = (GeeIterator*) _tmp3_;
407 _g_object_unref0 (iter);
415 static gpointer gee_read_only_sorted_set_real_lower (GeeSortedSet* base, gconstpointer element) {
416 GeeReadOnlySortedSet * self;
417 gpointer result = NULL;
418 GeeCollection* _tmp0_;
419 gconstpointer _tmp1_;
420 gpointer _tmp2_ = NULL;
421 self = (GeeReadOnlySortedSet*) base;
422 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
424 _tmp2_ = gee_sorted_set_lower (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
433 static gpointer gee_read_only_sorted_set_real_higher (GeeSortedSet* base, gconstpointer element) {
434 GeeReadOnlySortedSet * self;
435 gpointer result = NULL;
436 GeeCollection* _tmp0_;
437 gconstpointer _tmp1_;
438 gpointer _tmp2_ = NULL;
439 self = (GeeReadOnlySortedSet*) base;
440 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
442 _tmp2_ = gee_sorted_set_higher (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
451 static gpointer gee_read_only_sorted_set_real_floor (GeeSortedSet* base, gconstpointer element) {
452 GeeReadOnlySortedSet * self;
453 gpointer result = NULL;
454 GeeCollection* _tmp0_;
455 gconstpointer _tmp1_;
456 gpointer _tmp2_ = NULL;
457 self = (GeeReadOnlySortedSet*) base;
458 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
460 _tmp2_ = gee_sorted_set_floor (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
469 static gpointer gee_read_only_sorted_set_real_ceil (GeeSortedSet* base, gconstpointer element) {
470 GeeReadOnlySortedSet * self;
471 gpointer result = NULL;
472 GeeCollection* _tmp0_;
473 gconstpointer _tmp1_;
474 gpointer _tmp2_ = NULL;
475 self = (GeeReadOnlySortedSet*) base;
476 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
478 _tmp2_ = gee_sorted_set_ceil (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
487 static GeeSortedSet* gee_read_only_sorted_set_real_head_set (GeeSortedSet* base, gconstpointer before) {
488 GeeReadOnlySortedSet * self;
489 GeeSortedSet* result = NULL;
490 GeeCollection* _tmp0_;
491 gconstpointer _tmp1_;
492 GeeSortedSet* _tmp2_ = NULL;
493 GeeSortedSet* _tmp3_;
494 GeeSortedSet* _tmp4_;
495 GeeSortedSet* _tmp5_;
496 GeeSortedSet* _tmp6_;
497 self = (GeeReadOnlySortedSet*) base;
498 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
500 _tmp2_ = gee_sorted_set_head_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
502 _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_);
505 _g_object_unref0 (_tmp3_);
514 static GeeSortedSet* gee_read_only_sorted_set_real_tail_set (GeeSortedSet* base, gconstpointer after) {
515 GeeReadOnlySortedSet * self;
516 GeeSortedSet* result = NULL;
517 GeeCollection* _tmp0_;
518 gconstpointer _tmp1_;
519 GeeSortedSet* _tmp2_ = NULL;
520 GeeSortedSet* _tmp3_;
521 GeeSortedSet* _tmp4_;
522 GeeSortedSet* _tmp5_;
523 GeeSortedSet* _tmp6_;
524 self = (GeeReadOnlySortedSet*) base;
525 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
527 _tmp2_ = gee_sorted_set_tail_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_);
529 _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_);
532 _g_object_unref0 (_tmp3_);
541 static GeeSortedSet* gee_read_only_sorted_set_real_sub_set (GeeSortedSet* base, gconstpointer from, gconstpointer to) {
542 GeeReadOnlySortedSet * self;
543 GeeSortedSet* result = NULL;
544 GeeCollection* _tmp0_;
545 gconstpointer _tmp1_;
546 gconstpointer _tmp2_;
547 GeeSortedSet* _tmp3_ = NULL;
548 GeeSortedSet* _tmp4_;
549 GeeSortedSet* _tmp5_;
550 GeeSortedSet* _tmp6_;
551 GeeSortedSet* _tmp7_;
552 self = (GeeReadOnlySortedSet*) base;
553 _tmp0_ = ((GeeReadOnlyCollection*) self)->_collection;
556 _tmp3_ = gee_sorted_set_sub_set (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_SORTED_SET) ? ((GeeSortedSet*) _tmp0_) : NULL, _tmp1_, _tmp2_);
558 _tmp5_ = gee_sorted_set_get_read_only_view (_tmp4_);
561 _g_object_unref0 (_tmp4_);
567 static gpointer _g_object_ref0 (gpointer self) {
568 return self ? g_object_ref (self) : NULL;
572 static GeeSortedSet* gee_read_only_sorted_set_real_get_read_only_view (GeeSortedSet* base) {
573 GeeSortedSet* result;
574 GeeReadOnlySortedSet* self;
575 GeeSortedSet* _tmp0_;
576 self = (GeeReadOnlySortedSet*) base;
577 _tmp0_ = _g_object_ref0 ((GeeSortedSet*) self);
583 static void gee_read_only_sorted_set_class_init (GeeReadOnlySortedSetClass * klass) {
584 gee_read_only_sorted_set_parent_class = g_type_class_peek_parent (klass);
585 g_type_class_add_private (klass, sizeof (GeeReadOnlySortedSetPrivate));
586 G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_sorted_set_get_property;
587 G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_sorted_set_set_property;
588 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_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));
589 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_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));
590 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_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));
594 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW, g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
598 static GType gee_read_only_sorted_set_gee_sorted_set_get_g_type (GeeReadOnlySortedSet* self) {
599 return self->priv->g_type;
603 static GBoxedCopyFunc gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func (GeeReadOnlySortedSet* self) {
604 return self->priv->g_dup_func;
608 static GDestroyNotify gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func (GeeReadOnlySortedSet* self) {
609 return self->priv->g_destroy_func;
613 static void gee_read_only_sorted_set_gee_sorted_set_interface_init (GeeSortedSetIface * iface) {
614 gee_read_only_sorted_set_gee_sorted_set_parent_iface = g_type_interface_peek_parent (iface);
615 iface->first = (gpointer (*)(GeeSortedSet*)) gee_read_only_sorted_set_real_first;
616 iface->last = (gpointer (*)(GeeSortedSet*)) gee_read_only_sorted_set_real_last;
617 iface->iterator_at = (GeeIterator* (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_iterator_at;
618 iface->lower = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_lower;
619 iface->higher = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_higher;
620 iface->floor = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_floor;
621 iface->ceil = (gpointer (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_ceil;
622 iface->head_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_head_set;
623 iface->tail_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer)) gee_read_only_sorted_set_real_tail_set;
624 iface->sub_set = (GeeSortedSet* (*)(GeeSortedSet*, gconstpointer, gconstpointer)) gee_read_only_sorted_set_real_sub_set;
625 iface->get_g_type = (GType(*)(GeeSortedSet*)) gee_read_only_sorted_set_gee_sorted_set_get_g_type;
626 iface->get_g_dup_func = (GBoxedCopyFunc(*)(GeeSortedSet*)) gee_read_only_sorted_set_gee_sorted_set_get_g_dup_func;
627 iface->get_g_destroy_func = (GDestroyNotify(*)(GeeSortedSet*)) gee_read_only_sorted_set_gee_sorted_set_get_g_destroy_func;
628 iface->get_read_only_view = gee_read_only_sorted_set_real_get_read_only_view;
632 static void gee_read_only_sorted_set_instance_init (GeeReadOnlySortedSet * self) {
633 self->priv = GEE_READ_ONLY_SORTED_SET_GET_PRIVATE (self);
638 * Read-only view for {@link SortedSet} collections.
640 * This class decorates any class which implements the {@link SortedSet} interface
641 * by making it read only. Any method which normally modify data will throw an
646 GType gee_read_only_sorted_set_get_type (void) {
647 static volatile gsize gee_read_only_sorted_set_type_id__volatile = 0;
648 if (g_once_init_enter (&gee_read_only_sorted_set_type_id__volatile)) {
649 static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlySortedSetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_sorted_set_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlySortedSet), 0, (GInstanceInitFunc) gee_read_only_sorted_set_instance_init, NULL };
650 static const GInterfaceInfo gee_sorted_set_info = { (GInterfaceInitFunc) gee_read_only_sorted_set_gee_sorted_set_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
651 GType gee_read_only_sorted_set_type_id;
652 gee_read_only_sorted_set_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_SET, "GeeReadOnlySortedSet", &g_define_type_info, 0);
653 g_type_add_interface_static (gee_read_only_sorted_set_type_id, GEE_TYPE_SORTED_SET, &gee_sorted_set_info);
654 g_once_init_leave (&gee_read_only_sorted_set_type_id__volatile, gee_read_only_sorted_set_type_id);
656 return gee_read_only_sorted_set_type_id__volatile;
660 static void _vala_gee_read_only_sorted_set_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
661 GeeReadOnlySortedSet * self;
662 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet);
663 switch (property_id) {
664 case GEE_READ_ONLY_SORTED_SET_READ_ONLY_VIEW:
665 g_value_take_object (value, gee_sorted_set_get_read_only_view ((GeeSortedSet*) self));
668 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
674 static void _vala_gee_read_only_sorted_set_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
675 GeeReadOnlySortedSet * self;
676 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_SET, GeeReadOnlySortedSet);
677 switch (property_id) {
678 case GEE_READ_ONLY_SORTED_SET_G_TYPE:
679 self->priv->g_type = g_value_get_gtype (value);
681 case GEE_READ_ONLY_SORTED_SET_G_DUP_FUNC:
682 self->priv->g_dup_func = g_value_get_pointer (value);
684 case GEE_READ_ONLY_SORTED_SET_G_DESTROY_FUNC:
685 self->priv->g_destroy_func = g_value_get_pointer (value);
688 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);