1 /* readonlysortedmap.c generated by valac 0.46.6, the Vala compiler
2 * generated from readonlysortedmap.vala, do not modify */
3
4 /* readonlysortedmap.vala
5 *
6 * Copyright (C) 2009-2011 Maciej Piechotka
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 * Author:
23 * Maciej Piechotka <uzytkownik2@gmail.com>
24 */
25
26 #include <glib-object.h>
27 #include <glib.h>
28
29 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
30 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
31 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
32 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
33
34 typedef struct _GeeTraversable GeeTraversable;
35 typedef struct _GeeTraversableIface GeeTraversableIface;
36 typedef gboolean (*GeeForallFunc) (gpointer g, gpointer user_data);
37 typedef enum {
38 GEE_TRAVERSABLE_STREAM_YIELD,
39 GEE_TRAVERSABLE_STREAM_CONTINUE,
40 GEE_TRAVERSABLE_STREAM_END,
41 GEE_TRAVERSABLE_STREAM_WAIT
42 } GeeTraversableStream;
43
44 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
45
46 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
47 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
48 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
49 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
50 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
51 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
52
53 typedef struct _GeeLazy GeeLazy;
54 typedef struct _GeeLazyClass GeeLazyClass;
55 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy* * lazy, gpointer user_data);
56
57 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
58 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
59 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
60 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
61
62 typedef struct _GeeIterator GeeIterator;
63 typedef struct _GeeIteratorIface GeeIteratorIface;
64 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, gpointer user_data);
65 typedef gpointer (*GeeMapFunc) (gpointer g, gpointer user_data);
66 typedef gboolean (*GeePredicate) (gconstpointer g, gpointer user_data);
67 typedef GeeIterator* (*GeeFlatMapFunc) (gpointer g, gpointer user_data);
68
69 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
70 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
71 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
72 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
73
74 typedef struct _GeeIterable GeeIterable;
75 typedef struct _GeeIterableIface GeeIterableIface;
76
77 #define GEE_TYPE_MAP (gee_map_get_type ())
78 #define GEE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP, GeeMap))
79 #define GEE_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP))
80 #define GEE_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP, GeeMapIface))
81
82 typedef struct _GeeMap GeeMap;
83 typedef struct _GeeMapIface GeeMapIface;
84
85 #define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ())
86 #define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator))
87 #define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR))
88 #define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface))
89
90 typedef struct _GeeMapIterator GeeMapIterator;
91 typedef struct _GeeMapIteratorIface GeeMapIteratorIface;
92 typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, gpointer user_data);
93 typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, gpointer user_data);
94
95 #define GEE_TYPE_SET (gee_set_get_type ())
96 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
97 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
98 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
99
100 typedef struct _GeeSet GeeSet;
101 typedef struct _GeeSetIface GeeSetIface;
102
103 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
104 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
105 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
106 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
107
108 typedef struct _GeeCollection GeeCollection;
109 typedef struct _GeeCollectionIface GeeCollectionIface;
110
111 #define GEE_MAP_TYPE_ENTRY (gee_map_entry_get_type ())
112 #define GEE_MAP_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntry))
113 #define GEE_MAP_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass))
114 #define GEE_MAP_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_MAP_TYPE_ENTRY))
115 #define GEE_MAP_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_MAP_TYPE_ENTRY))
116 #define GEE_MAP_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_MAP_TYPE_ENTRY, GeeMapEntryClass))
117
118 typedef struct _GeeMapEntry GeeMapEntry;
119 typedef struct _GeeMapEntryClass GeeMapEntryClass;
120
121 #define GEE_TYPE_READ_ONLY_MAP (gee_read_only_map_get_type ())
122 #define GEE_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMap))
123 #define GEE_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass))
124 #define GEE_IS_READ_ONLY_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MAP))
125 #define GEE_IS_READ_ONLY_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MAP))
126 #define GEE_READ_ONLY_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MAP, GeeReadOnlyMapClass))
127
128 typedef struct _GeeReadOnlyMap GeeReadOnlyMap;
129 typedef struct _GeeReadOnlyMapClass GeeReadOnlyMapClass;
130 typedef struct _GeeReadOnlyMapPrivate GeeReadOnlyMapPrivate;
131
132 #define GEE_TYPE_SORTED_MAP (gee_sorted_map_get_type ())
133 #define GEE_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMap))
134 #define GEE_IS_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_MAP))
135 #define GEE_SORTED_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_MAP, GeeSortedMapIface))
136
137 typedef struct _GeeSortedMap GeeSortedMap;
138 typedef struct _GeeSortedMapIface GeeSortedMapIface;
139
140 #define GEE_TYPE_SORTED_SET (gee_sorted_set_get_type ())
141 #define GEE_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SORTED_SET, GeeSortedSet))
142 #define GEE_IS_SORTED_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SORTED_SET))
143 #define GEE_SORTED_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SORTED_SET, GeeSortedSetIface))
144
145 typedef struct _GeeSortedSet GeeSortedSet;
146 typedef struct _GeeSortedSetIface GeeSortedSetIface;
147
148 #define GEE_TYPE_READ_ONLY_SORTED_MAP (gee_read_only_sorted_map_get_type ())
149 #define GEE_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap))
150 #define GEE_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass))
151 #define GEE_IS_READ_ONLY_SORTED_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP))
152 #define GEE_IS_READ_ONLY_SORTED_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_SORTED_MAP))
153 #define GEE_READ_ONLY_SORTED_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMapClass))
154
155 typedef struct _GeeReadOnlySortedMap GeeReadOnlySortedMap;
156 typedef struct _GeeReadOnlySortedMapClass GeeReadOnlySortedMapClass;
157 typedef struct _GeeReadOnlySortedMapPrivate GeeReadOnlySortedMapPrivate;
158 enum {
159 GEE_READ_ONLY_SORTED_MAP_0_PROPERTY,
160 GEE_READ_ONLY_SORTED_MAP_K_TYPE,
161 GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC,
162 GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC,
163 GEE_READ_ONLY_SORTED_MAP_V_TYPE,
164 GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC,
165 GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC,
166 GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS_PROPERTY,
167 GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES_PROPERTY,
168 GEE_READ_ONLY_SORTED_MAP_READ_ONLY_VIEW_PROPERTY,
169 GEE_READ_ONLY_SORTED_MAP_NUM_PROPERTIES
170 };
171 static GParamSpec* gee_read_only_sorted_map_properties[GEE_READ_ONLY_SORTED_MAP_NUM_PROPERTIES];
172 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
173
174 struct _GeeIteratorIface {
175 GTypeInterface parent_iface;
176 gboolean (*next) (GeeIterator* self);
177 gboolean (*has_next) (GeeIterator* self);
178 gpointer (*get) (GeeIterator* self);
179 void (*remove) (GeeIterator* self);
180 gboolean (*get_valid) (GeeIterator* self);
181 gboolean (*get_read_only) (GeeIterator* self);
182 };
183
184 struct _GeeTraversableIface {
185 GTypeInterface parent_iface;
186 GType (*get_g_type) (GeeTraversable* self);
187 GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
188 GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
189 gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, gpointer f_target);
190 GeeIterator* (*stream) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeStreamFunc f, gpointer f_target, GDestroyNotify f_target_destroy_notify);
191 gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, gpointer f_target, gpointer seed);
192 GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, gpointer f_target);
193 GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, gpointer f_target, gpointer seed);
194 GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
195 GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
196 GType (*get_element_type) (GeeTraversable* self);
197 GeeIterator* (*flat_map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFlatMapFunc f, gpointer f_target, GDestroyNotify f_target_destroy_notify);
198 GeeIterator** (*tee) (GeeTraversable* self, guint forks, gint* result_length1);
199 gpointer (*first_match) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
200 gboolean (*any_match) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
201 gboolean (*all_match) (GeeTraversable* self, GeePredicate pred, gpointer pred_target, GDestroyNotify pred_target_destroy_notify);
202 gpointer (*max) (GeeTraversable* self, GCompareDataFunc compare, gpointer compare_target, GDestroyNotify compare_target_destroy_notify);
203 gpointer (*min) (GeeTraversable* self, GCompareDataFunc compare, gpointer compare_target, GDestroyNotify compare_target_destroy_notify);
204 GeeIterator* (*order_by) (GeeTraversable* self, GCompareDataFunc compare, gpointer compare_target, GDestroyNotify compare_target_destroy_notify);
205 };
206
207 struct _GeeIterableIface {
208 GTypeInterface parent_iface;
209 GType (*get_g_type) (GeeIterable* self);
210 GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
211 GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
212 GeeIterator* (*iterator) (GeeIterable* self);
213 };
214
215 struct _GeeMapIteratorIface {
216 GTypeInterface parent_iface;
217 GType (*get_k_type) (GeeMapIterator* self);
218 GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self);
219 GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self);
220 GType (*get_v_type) (GeeMapIterator* self);
221 GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self);
222 GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self);
223 gboolean (*next) (GeeMapIterator* self);
224 gboolean (*has_next) (GeeMapIterator* self);
225 gpointer (*get_key) (GeeMapIterator* self);
226 gpointer (*get_value) (GeeMapIterator* self);
227 void (*set_value) (GeeMapIterator* self, gconstpointer value);
228 void (*unset) (GeeMapIterator* self);
229 gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, gpointer f_target, gpointer seed);
230 gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, gpointer f_target);
231 gboolean (*get_valid) (GeeMapIterator* self);
232 gboolean (*get_mutable) (GeeMapIterator* self);
233 gboolean (*get_read_only) (GeeMapIterator* self);
234 };
235
236 struct _GeeCollectionIface {
237 GTypeInterface parent_iface;
238 GType (*get_g_type) (GeeCollection* self);
239 GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
240 GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
241 gboolean (*contains) (GeeCollection* self, gconstpointer item);
242 gboolean (*add) (GeeCollection* self, gconstpointer item);
243 gboolean (*remove) (GeeCollection* self, gconstpointer item);
244 void (*clear) (GeeCollection* self);
245 gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
246 gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
247 gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
248 gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
249 gpointer* (*to_array) (GeeCollection* self, gint* result_length1);
250 gint (*get_size) (GeeCollection* self);
251 gboolean (*get_is_empty) (GeeCollection* self);
252 gboolean (*get_read_only) (GeeCollection* self);
253 GeeCollection* (*get_read_only_view) (GeeCollection* self);
254 gboolean (*add_all_array) (GeeCollection* self, gpointer* array, gint array_length1);
255 gboolean (*contains_all_array) (GeeCollection* self, gpointer* array, gint array_length1);
256 gboolean (*remove_all_array) (GeeCollection* self, gpointer* array, gint array_length1);
257 gboolean (*add_all_iterator) (GeeCollection* self, GeeIterator* iter);
258 gboolean (*contains_all_iterator) (GeeCollection* self, GeeIterator* iter);
259 gboolean (*remove_all_iterator) (GeeCollection* self, GeeIterator* iter);
260 };
261
262 struct _GeeSetIface {
263 GTypeInterface parent_iface;
264 GType (*get_g_type) (GeeSet* self);
265 GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
266 GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
267 GeeSet* (*get_read_only_view) (GeeSet* self);
268 };
269
270 struct _GeeMapIface {
271 GTypeInterface parent_iface;
272 GType (*get_k_type) (GeeMap* self);
273 GBoxedCopyFunc (*get_k_dup_func) (GeeMap* self);
274 GDestroyNotify (*get_k_destroy_func) (GeeMap* self);
275 GType (*get_v_type) (GeeMap* self);
276 GBoxedCopyFunc (*get_v_dup_func) (GeeMap* self);
277 GDestroyNotify (*get_v_destroy_func) (GeeMap* self);
278 gboolean (*has_key) (GeeMap* self, gconstpointer key);
279 gboolean (*has) (GeeMap* self, gconstpointer key, gconstpointer value);
280 gpointer (*get) (GeeMap* self, gconstpointer key);
281 void (*set) (GeeMap* self, gconstpointer key, gconstpointer value);
282 gboolean (*unset) (GeeMap* self, gconstpointer key, gpointer* value);
283 void (*clear) (GeeMap* self);
284 GeeMapIterator* (*map_iterator) (GeeMap* self);
285 void (*set_all) (GeeMap* self, GeeMap* map);
286 gboolean (*unset_all) (GeeMap* self, GeeMap* map);
287 gboolean (*has_all) (GeeMap* self, GeeMap* map);
288 gint (*get_size) (GeeMap* self);
289 gboolean (*get_is_empty) (GeeMap* self);
290 gboolean (*get_read_only) (GeeMap* self);
291 GeeSet* (*get_keys) (GeeMap* self);
292 GeeCollection* (*get_values) (GeeMap* self);
293 GeeSet* (*get_entries) (GeeMap* self);
294 GeeMap* (*get_read_only_view) (GeeMap* self);
295 };
296
297 struct _GeeReadOnlyMap {
298 GObject parent_instance;
299 GeeReadOnlyMapPrivate * priv;
300 GeeMap* _map;
301 };
302
303 struct _GeeReadOnlyMapClass {
304 GObjectClass parent_class;
305 GeeMap* (*get_read_only_view) (GeeReadOnlyMap* self);
306 };
307
308 struct _GeeSortedSetIface {
309 GTypeInterface parent_iface;
310 GType (*get_g_type) (GeeSortedSet* self);
311 GBoxedCopyFunc (*get_g_dup_func) (GeeSortedSet* self);
312 GDestroyNotify (*get_g_destroy_func) (GeeSortedSet* self);
313 gpointer (*first) (GeeSortedSet* self);
314 gpointer (*last) (GeeSortedSet* self);
315 GeeIterator* (*iterator_at) (GeeSortedSet* self, gconstpointer element);
316 gpointer (*lower) (GeeSortedSet* self, gconstpointer element);
317 gpointer (*higher) (GeeSortedSet* self, gconstpointer element);
318 gpointer (*floor) (GeeSortedSet* self, gconstpointer element);
319 gpointer (*ceil) (GeeSortedSet* self, gconstpointer element);
320 GeeSortedSet* (*head_set) (GeeSortedSet* self, gconstpointer before);
321 GeeSortedSet* (*tail_set) (GeeSortedSet* self, gconstpointer after);
322 GeeSortedSet* (*sub_set) (GeeSortedSet* self, gconstpointer from, gconstpointer to);
323 GeeSortedSet* (*get_read_only_view) (GeeSortedSet* self);
324 };
325
326 struct _GeeSortedMapIface {
327 GTypeInterface parent_iface;
328 GeeSortedMap* (*head_map) (GeeSortedMap* self, gconstpointer before);
329 GeeSortedMap* (*tail_map) (GeeSortedMap* self, gconstpointer after);
330 GeeSortedMap* (*sub_map) (GeeSortedMap* self, gconstpointer before, gconstpointer after);
331 GeeSortedSet* (*get_ascending_keys) (GeeSortedMap* self);
332 GeeSortedSet* (*get_ascending_entries) (GeeSortedMap* self);
333 GeeSortedMap* (*get_read_only_view) (GeeSortedMap* self);
334 };
335
336 struct _GeeReadOnlySortedMap {
337 GeeReadOnlyMap parent_instance;
338 GeeReadOnlySortedMapPrivate * priv;
339 };
340
341 struct _GeeReadOnlySortedMapClass {
342 GeeReadOnlyMapClass parent_class;
343 };
344
345 struct _GeeReadOnlySortedMapPrivate {
346 GType k_type;
347 GBoxedCopyFunc k_dup_func;
348 GDestroyNotify k_destroy_func;
349 GType v_type;
350 GBoxedCopyFunc v_dup_func;
351 GDestroyNotify v_destroy_func;
352 };
353
354 static gint GeeReadOnlySortedMap_private_offset;
355 static gpointer gee_read_only_sorted_map_parent_class = NULL;
356 static GeeSortedMapIface * gee_read_only_sorted_map_gee_sorted_map_parent_iface = NULL;
357
358 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
359 gpointer gee_lazy_ref (gpointer instance);
360 void gee_lazy_unref (gpointer instance);
361 GParamSpec* gee_param_spec_lazy (const gchar* name,
362 const gchar* nick,
363 const gchar* blurb,
364 GType object_type,
365 GParamFlags flags);
366 void gee_value_set_lazy (GValue* value,
367 gpointer v_object);
368 void gee_value_take_lazy (GValue* value,
369 gpointer v_object);
370 gpointer gee_value_get_lazy (const GValue* value);
371 GType gee_lazy_get_type (void) G_GNUC_CONST;
372 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeLazy, gee_lazy_unref)
373 GType gee_iterator_get_type (void) G_GNUC_CONST;
374 GType gee_traversable_get_type (void) G_GNUC_CONST;
375 GType gee_iterable_get_type (void) G_GNUC_CONST;
376 GType gee_map_iterator_get_type (void) G_GNUC_CONST;
377 GType gee_collection_get_type (void) G_GNUC_CONST;
378 GType gee_set_get_type (void) G_GNUC_CONST;
379 GType gee_map_entry_get_type (void) G_GNUC_CONST;
380 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeMapEntry, g_object_unref)
381 GType gee_map_get_type (void) G_GNUC_CONST;
382 G_GNUC_INTERNAL GType gee_read_only_map_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
383 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeReadOnlyMap, g_object_unref)
384 GType gee_sorted_set_get_type (void) G_GNUC_CONST;
385 GType gee_sorted_map_get_type (void) G_GNUC_CONST;
386 G_GNUC_INTERNAL GType gee_read_only_sorted_map_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
387 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeReadOnlySortedMap, g_object_unref)
388 G_GNUC_INTERNAL GeeReadOnlySortedMap* gee_read_only_sorted_map_new (GType k_type,
389 GBoxedCopyFunc k_dup_func,
390 GDestroyNotify k_destroy_func,
391 GType v_type,
392 GBoxedCopyFunc v_dup_func,
393 GDestroyNotify v_destroy_func,
394 GeeMap* map);
395 G_GNUC_INTERNAL GeeReadOnlySortedMap* gee_read_only_sorted_map_construct (GType object_type,
396 GType k_type,
397 GBoxedCopyFunc k_dup_func,
398 GDestroyNotify k_destroy_func,
399 GType v_type,
400 GBoxedCopyFunc v_dup_func,
401 GDestroyNotify v_destroy_func,
402 GeeMap* map);
403 G_GNUC_INTERNAL GeeReadOnlyMap* gee_read_only_map_new (GType k_type,
404 GBoxedCopyFunc k_dup_func,
405 GDestroyNotify k_destroy_func,
406 GType v_type,
407 GBoxedCopyFunc v_dup_func,
408 GDestroyNotify v_destroy_func,
409 GeeMap* map);
410 G_GNUC_INTERNAL GeeReadOnlyMap* gee_read_only_map_construct (GType object_type,
411 GType k_type,
412 GBoxedCopyFunc k_dup_func,
413 GDestroyNotify k_destroy_func,
414 GType v_type,
415 GBoxedCopyFunc v_dup_func,
416 GDestroyNotify v_destroy_func,
417 GeeMap* map);
418 static GeeSortedMap* gee_read_only_sorted_map_real_head_map (GeeSortedMap* base,
419 gconstpointer before);
420 GeeSortedMap* gee_sorted_map_head_map (GeeSortedMap* self,
421 gconstpointer before);
422 GeeSortedMap* gee_sorted_map_get_read_only_view (GeeSortedMap* self);
423 static GeeSortedMap* gee_read_only_sorted_map_real_tail_map (GeeSortedMap* base,
424 gconstpointer after);
425 GeeSortedMap* gee_sorted_map_tail_map (GeeSortedMap* self,
426 gconstpointer after);
427 static GeeSortedMap* gee_read_only_sorted_map_real_sub_map (GeeSortedMap* base,
428 gconstpointer from,
429 gconstpointer to);
430 GeeSortedMap* gee_sorted_map_sub_map (GeeSortedMap* self,
431 gconstpointer before,
432 gconstpointer after);
433 GeeSortedSet* gee_sorted_map_get_ascending_keys (GeeSortedMap* self);
434 GeeSortedSet* gee_sorted_set_get_read_only_view (GeeSortedSet* self);
435 GeeSortedSet* gee_sorted_map_get_ascending_entries (GeeSortedMap* self);
436 static void _vala_gee_read_only_sorted_map_get_property (GObject * object,
437 guint property_id,
438 GValue * value,
439 GParamSpec * pspec);
440 static void _vala_gee_read_only_sorted_map_set_property (GObject * object,
441 guint property_id,
442 const GValue * value,
443 GParamSpec * pspec);
444
445 static inline gpointer
gee_read_only_sorted_map_get_instance_private(GeeReadOnlySortedMap * self)446 gee_read_only_sorted_map_get_instance_private (GeeReadOnlySortedMap* self)
447 {
448 return G_STRUCT_MEMBER_P (self, GeeReadOnlySortedMap_private_offset);
449 }
450
451 /**
452 * Constructs a read-only map that mirrors the content of the specified map.
453 *
454 * @param map the map to decorate.
455 */
456 G_GNUC_INTERNAL GeeReadOnlySortedMap*
gee_read_only_sorted_map_construct(GType object_type,GType k_type,GBoxedCopyFunc k_dup_func,GDestroyNotify k_destroy_func,GType v_type,GBoxedCopyFunc v_dup_func,GDestroyNotify v_destroy_func,GeeMap * map)457 gee_read_only_sorted_map_construct (GType object_type,
458 GType k_type,
459 GBoxedCopyFunc k_dup_func,
460 GDestroyNotify k_destroy_func,
461 GType v_type,
462 GBoxedCopyFunc v_dup_func,
463 GDestroyNotify v_destroy_func,
464 GeeMap* map)
465 {
466 GeeReadOnlySortedMap * self = NULL;
467 g_return_val_if_fail (map != NULL, NULL);
468 self = (GeeReadOnlySortedMap*) gee_read_only_map_construct (object_type, k_type, (GBoxedCopyFunc) k_dup_func, (GDestroyNotify) k_destroy_func, v_type, (GBoxedCopyFunc) v_dup_func, (GDestroyNotify) v_destroy_func, map);
469 self->priv->k_type = k_type;
470 self->priv->k_dup_func = k_dup_func;
471 self->priv->k_destroy_func = k_destroy_func;
472 self->priv->v_type = v_type;
473 self->priv->v_dup_func = v_dup_func;
474 self->priv->v_destroy_func = v_destroy_func;
475 return self;
476 }
477
478 G_GNUC_INTERNAL GeeReadOnlySortedMap*
gee_read_only_sorted_map_new(GType k_type,GBoxedCopyFunc k_dup_func,GDestroyNotify k_destroy_func,GType v_type,GBoxedCopyFunc v_dup_func,GDestroyNotify v_destroy_func,GeeMap * map)479 gee_read_only_sorted_map_new (GType k_type,
480 GBoxedCopyFunc k_dup_func,
481 GDestroyNotify k_destroy_func,
482 GType v_type,
483 GBoxedCopyFunc v_dup_func,
484 GDestroyNotify v_destroy_func,
485 GeeMap* map)
486 {
487 return gee_read_only_sorted_map_construct (GEE_TYPE_READ_ONLY_SORTED_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, map);
488 }
489
490 /**
491 * {@inheritDoc}
492 */
493 static GeeSortedMap*
gee_read_only_sorted_map_real_head_map(GeeSortedMap * base,gconstpointer before)494 gee_read_only_sorted_map_real_head_map (GeeSortedMap* base,
495 gconstpointer before)
496 {
497 GeeReadOnlySortedMap * self;
498 GeeMap* _tmp0_;
499 GeeSortedMap* _tmp1_;
500 GeeSortedMap* _tmp2_;
501 GeeSortedMap* _tmp3_;
502 GeeSortedMap* _tmp4_;
503 GeeSortedMap* _tmp5_;
504 GeeSortedMap* result = NULL;
505 self = (GeeReadOnlySortedMap*) base;
506 _tmp0_ = ((GeeReadOnlyMap*) self)->_map;
507 _tmp1_ = gee_sorted_map_head_map (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_MAP, GeeSortedMap), before);
508 _tmp2_ = _tmp1_;
509 _tmp3_ = gee_sorted_map_get_read_only_view (_tmp2_);
510 _tmp4_ = _tmp3_;
511 _tmp5_ = _tmp4_;
512 _g_object_unref0 (_tmp2_);
513 result = _tmp5_;
514 return result;
515 }
516
517 /**
518 * {@inheritDoc}
519 */
520 static GeeSortedMap*
gee_read_only_sorted_map_real_tail_map(GeeSortedMap * base,gconstpointer after)521 gee_read_only_sorted_map_real_tail_map (GeeSortedMap* base,
522 gconstpointer after)
523 {
524 GeeReadOnlySortedMap * self;
525 GeeMap* _tmp0_;
526 GeeSortedMap* _tmp1_;
527 GeeSortedMap* _tmp2_;
528 GeeSortedMap* _tmp3_;
529 GeeSortedMap* _tmp4_;
530 GeeSortedMap* _tmp5_;
531 GeeSortedMap* result = NULL;
532 self = (GeeReadOnlySortedMap*) base;
533 _tmp0_ = ((GeeReadOnlyMap*) self)->_map;
534 _tmp1_ = gee_sorted_map_tail_map (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_MAP, GeeSortedMap), after);
535 _tmp2_ = _tmp1_;
536 _tmp3_ = gee_sorted_map_get_read_only_view (_tmp2_);
537 _tmp4_ = _tmp3_;
538 _tmp5_ = _tmp4_;
539 _g_object_unref0 (_tmp2_);
540 result = _tmp5_;
541 return result;
542 }
543
544 /**
545 * {@inheritDoc}
546 */
547 static GeeSortedMap*
gee_read_only_sorted_map_real_sub_map(GeeSortedMap * base,gconstpointer from,gconstpointer to)548 gee_read_only_sorted_map_real_sub_map (GeeSortedMap* base,
549 gconstpointer from,
550 gconstpointer to)
551 {
552 GeeReadOnlySortedMap * self;
553 GeeMap* _tmp0_;
554 GeeSortedMap* _tmp1_;
555 GeeSortedMap* _tmp2_;
556 GeeSortedMap* _tmp3_;
557 GeeSortedMap* _tmp4_;
558 GeeSortedMap* _tmp5_;
559 GeeSortedMap* result = NULL;
560 self = (GeeReadOnlySortedMap*) base;
561 _tmp0_ = ((GeeReadOnlyMap*) self)->_map;
562 _tmp1_ = gee_sorted_map_sub_map (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_MAP, GeeSortedMap), from, to);
563 _tmp2_ = _tmp1_;
564 _tmp3_ = gee_sorted_map_get_read_only_view (_tmp2_);
565 _tmp4_ = _tmp3_;
566 _tmp5_ = _tmp4_;
567 _g_object_unref0 (_tmp2_);
568 result = _tmp5_;
569 return result;
570 }
571
572 static GeeSortedSet*
gee_read_only_sorted_map_real_get_ascending_keys(GeeSortedMap * base)573 gee_read_only_sorted_map_real_get_ascending_keys (GeeSortedMap* base)
574 {
575 GeeSortedSet* result;
576 GeeReadOnlySortedMap* self;
577 GeeMap* _tmp0_;
578 GeeSortedSet* _tmp1_;
579 GeeSortedSet* _tmp2_;
580 GeeSortedSet* _tmp3_;
581 GeeSortedSet* _tmp4_;
582 GeeSortedSet* _tmp5_;
583 GeeSortedSet* _tmp6_;
584 self = (GeeReadOnlySortedMap*) base;
585 _tmp0_ = ((GeeReadOnlyMap*) self)->_map;
586 _tmp1_ = gee_sorted_map_get_ascending_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_MAP, GeeSortedMap));
587 _tmp2_ = _tmp1_;
588 _tmp3_ = _tmp2_;
589 _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_);
590 _tmp5_ = _tmp4_;
591 _tmp6_ = _tmp5_;
592 _g_object_unref0 (_tmp3_);
593 result = _tmp6_;
594 return result;
595 }
596
597 static GeeSortedSet*
gee_read_only_sorted_map_real_get_ascending_entries(GeeSortedMap * base)598 gee_read_only_sorted_map_real_get_ascending_entries (GeeSortedMap* base)
599 {
600 GeeSortedSet* result;
601 GeeReadOnlySortedMap* self;
602 GeeMap* _tmp0_;
603 GeeSortedSet* _tmp1_;
604 GeeSortedSet* _tmp2_;
605 GeeSortedSet* _tmp3_;
606 GeeSortedSet* _tmp4_;
607 GeeSortedSet* _tmp5_;
608 GeeSortedSet* _tmp6_;
609 self = (GeeReadOnlySortedMap*) base;
610 _tmp0_ = ((GeeReadOnlyMap*) self)->_map;
611 _tmp1_ = gee_sorted_map_get_ascending_entries (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_MAP, GeeSortedMap));
612 _tmp2_ = _tmp1_;
613 _tmp3_ = _tmp2_;
614 _tmp4_ = gee_sorted_set_get_read_only_view (_tmp3_);
615 _tmp5_ = _tmp4_;
616 _tmp6_ = _tmp5_;
617 _g_object_unref0 (_tmp3_);
618 result = _tmp6_;
619 return result;
620 }
621
622 static gpointer
_g_object_ref0(gpointer self)623 _g_object_ref0 (gpointer self)
624 {
625 return self ? g_object_ref (self) : NULL;
626 }
627
628 static GeeSortedMap*
gee_read_only_sorted_map_real_get_read_only_view(GeeSortedMap * base)629 gee_read_only_sorted_map_real_get_read_only_view (GeeSortedMap* base)
630 {
631 GeeSortedMap* result;
632 GeeReadOnlySortedMap* self;
633 GeeSortedMap* _tmp0_;
634 self = (GeeReadOnlySortedMap*) base;
635 _tmp0_ = _g_object_ref0 ((GeeSortedMap*) self);
636 result = _tmp0_;
637 return result;
638 }
639
640 static void
gee_read_only_sorted_map_class_init(GeeReadOnlySortedMapClass * klass,gpointer klass_data)641 gee_read_only_sorted_map_class_init (GeeReadOnlySortedMapClass * klass,
642 gpointer klass_data)
643 {
644 gee_read_only_sorted_map_parent_class = g_type_class_peek_parent (klass);
645 g_type_class_adjust_private_offset (klass, &GeeReadOnlySortedMap_private_offset);
646 G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_sorted_map_get_property;
647 G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_sorted_map_set_property;
648 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_K_TYPE, g_param_spec_gtype ("k-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
649 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
650 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
651 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_V_TYPE, g_param_spec_gtype ("v-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
652 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
653 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
654 /**
655 * {@inheritDoc}
656 */
657 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS_PROPERTY, gee_read_only_sorted_map_properties[GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS_PROPERTY] = g_param_spec_object ("ascending-keys", "ascending-keys", "ascending-keys", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
658 /**
659 * {@inheritDoc}
660 */
661 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES_PROPERTY, gee_read_only_sorted_map_properties[GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES_PROPERTY] = g_param_spec_object ("ascending-entries", "ascending-entries", "ascending-entries", GEE_TYPE_SORTED_SET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
662 /**
663 * {@inheritDoc}
664 */
665 g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_SORTED_MAP_READ_ONLY_VIEW_PROPERTY, gee_read_only_sorted_map_properties[GEE_READ_ONLY_SORTED_MAP_READ_ONLY_VIEW_PROPERTY] = g_param_spec_object ("read-only-view", "read-only-view", "read-only-view", GEE_TYPE_SORTED_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
666 }
667
668 static void
gee_read_only_sorted_map_gee_sorted_map_interface_init(GeeSortedMapIface * iface,gpointer iface_data)669 gee_read_only_sorted_map_gee_sorted_map_interface_init (GeeSortedMapIface * iface,
670 gpointer iface_data)
671 {
672 gee_read_only_sorted_map_gee_sorted_map_parent_iface = g_type_interface_peek_parent (iface);
673 iface->head_map = (GeeSortedMap* (*) (GeeSortedMap*, gconstpointer)) gee_read_only_sorted_map_real_head_map;
674 iface->tail_map = (GeeSortedMap* (*) (GeeSortedMap*, gconstpointer)) gee_read_only_sorted_map_real_tail_map;
675 iface->sub_map = (GeeSortedMap* (*) (GeeSortedMap*, gconstpointer, gconstpointer)) gee_read_only_sorted_map_real_sub_map;
676 iface->get_ascending_keys = gee_read_only_sorted_map_real_get_ascending_keys;
677 iface->get_ascending_entries = gee_read_only_sorted_map_real_get_ascending_entries;
678 iface->get_read_only_view = gee_read_only_sorted_map_real_get_read_only_view;
679 }
680
681 static void
gee_read_only_sorted_map_instance_init(GeeReadOnlySortedMap * self,gpointer klass)682 gee_read_only_sorted_map_instance_init (GeeReadOnlySortedMap * self,
683 gpointer klass)
684 {
685 self->priv = gee_read_only_sorted_map_get_instance_private (self);
686 }
687
688 /**
689 * Read-only view for {@link SortedMap} collections.
690 *
691 * This class decorates any class which implements the {@link SortedMap} interface
692 * by making it read only. Any method which normally modify data will throw an
693 * error.
694 *
695 * @see SortedMap
696 */
697 G_GNUC_INTERNAL GType
gee_read_only_sorted_map_get_type(void)698 gee_read_only_sorted_map_get_type (void)
699 {
700 static volatile gsize gee_read_only_sorted_map_type_id__volatile = 0;
701 if (g_once_init_enter (&gee_read_only_sorted_map_type_id__volatile)) {
702 static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlySortedMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_sorted_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlySortedMap), 0, (GInstanceInitFunc) gee_read_only_sorted_map_instance_init, NULL };
703 static const GInterfaceInfo gee_sorted_map_info = { (GInterfaceInitFunc) gee_read_only_sorted_map_gee_sorted_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
704 GType gee_read_only_sorted_map_type_id;
705 gee_read_only_sorted_map_type_id = g_type_register_static (GEE_TYPE_READ_ONLY_MAP, "GeeReadOnlySortedMap", &g_define_type_info, 0);
706 g_type_add_interface_static (gee_read_only_sorted_map_type_id, GEE_TYPE_SORTED_MAP, &gee_sorted_map_info);
707 GeeReadOnlySortedMap_private_offset = g_type_add_instance_private (gee_read_only_sorted_map_type_id, sizeof (GeeReadOnlySortedMapPrivate));
708 g_once_init_leave (&gee_read_only_sorted_map_type_id__volatile, gee_read_only_sorted_map_type_id);
709 }
710 return gee_read_only_sorted_map_type_id__volatile;
711 }
712
713 static void
_vala_gee_read_only_sorted_map_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)714 _vala_gee_read_only_sorted_map_get_property (GObject * object,
715 guint property_id,
716 GValue * value,
717 GParamSpec * pspec)
718 {
719 GeeReadOnlySortedMap * self;
720 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap);
721 switch (property_id) {
722 case GEE_READ_ONLY_SORTED_MAP_ASCENDING_KEYS_PROPERTY:
723 g_value_take_object (value, gee_sorted_map_get_ascending_keys ((GeeSortedMap*) self));
724 break;
725 case GEE_READ_ONLY_SORTED_MAP_ASCENDING_ENTRIES_PROPERTY:
726 g_value_take_object (value, gee_sorted_map_get_ascending_entries ((GeeSortedMap*) self));
727 break;
728 case GEE_READ_ONLY_SORTED_MAP_READ_ONLY_VIEW_PROPERTY:
729 g_value_take_object (value, gee_sorted_map_get_read_only_view ((GeeSortedMap*) self));
730 break;
731 case GEE_READ_ONLY_SORTED_MAP_K_TYPE:
732 g_value_set_gtype (value, self->priv->k_type);
733 break;
734 case GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC:
735 g_value_set_pointer (value, self->priv->k_dup_func);
736 break;
737 case GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC:
738 g_value_set_pointer (value, self->priv->k_destroy_func);
739 break;
740 case GEE_READ_ONLY_SORTED_MAP_V_TYPE:
741 g_value_set_gtype (value, self->priv->v_type);
742 break;
743 case GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC:
744 g_value_set_pointer (value, self->priv->v_dup_func);
745 break;
746 case GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC:
747 g_value_set_pointer (value, self->priv->v_destroy_func);
748 break;
749 default:
750 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
751 break;
752 }
753 }
754
755 static void
_vala_gee_read_only_sorted_map_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)756 _vala_gee_read_only_sorted_map_set_property (GObject * object,
757 guint property_id,
758 const GValue * value,
759 GParamSpec * pspec)
760 {
761 GeeReadOnlySortedMap * self;
762 self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_SORTED_MAP, GeeReadOnlySortedMap);
763 switch (property_id) {
764 case GEE_READ_ONLY_SORTED_MAP_K_TYPE:
765 self->priv->k_type = g_value_get_gtype (value);
766 break;
767 case GEE_READ_ONLY_SORTED_MAP_K_DUP_FUNC:
768 self->priv->k_dup_func = g_value_get_pointer (value);
769 break;
770 case GEE_READ_ONLY_SORTED_MAP_K_DESTROY_FUNC:
771 self->priv->k_destroy_func = g_value_get_pointer (value);
772 break;
773 case GEE_READ_ONLY_SORTED_MAP_V_TYPE:
774 self->priv->v_type = g_value_get_gtype (value);
775 break;
776 case GEE_READ_ONLY_SORTED_MAP_V_DUP_FUNC:
777 self->priv->v_dup_func = g_value_get_pointer (value);
778 break;
779 case GEE_READ_ONLY_SORTED_MAP_V_DESTROY_FUNC:
780 self->priv->v_destroy_func = g_value_get_pointer (value);
781 break;
782 default:
783 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
784 break;
785 }
786 }
787
788