Update Changelog
[profile/ivi/libgee.git] / gee / readonlymultimap.c
1 /* readonlymultimap.c generated by valac 0.18.0, the Vala compiler
2  * generated from readonlymultimap.vala, do not modify */
3
4 /* readonlymultimap.vala
5  *
6  * Copyright (C) 2013  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.h>
27 #include <glib-object.h>
28
29
30 #define GEE_TYPE_MULTI_MAP (gee_multi_map_get_type ())
31 #define GEE_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMap))
32 #define GEE_IS_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_MAP))
33 #define GEE_MULTI_MAP_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_MAP, GeeMultiMapIface))
34
35 typedef struct _GeeMultiMap GeeMultiMap;
36 typedef struct _GeeMultiMapIface GeeMultiMapIface;
37
38 #define GEE_TYPE_TRAVERSABLE (gee_traversable_get_type ())
39 #define GEE_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversable))
40 #define GEE_IS_TRAVERSABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TRAVERSABLE))
41 #define GEE_TRAVERSABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_TRAVERSABLE, GeeTraversableIface))
42
43 typedef struct _GeeTraversable GeeTraversable;
44 typedef struct _GeeTraversableIface GeeTraversableIface;
45
46 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
47
48 #define GEE_TYPE_LAZY (gee_lazy_get_type ())
49 #define GEE_LAZY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_LAZY, GeeLazy))
50 #define GEE_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_LAZY, GeeLazyClass))
51 #define GEE_IS_LAZY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_LAZY))
52 #define GEE_IS_LAZY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_LAZY))
53 #define GEE_LAZY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_LAZY, GeeLazyClass))
54
55 typedef struct _GeeLazy GeeLazy;
56 typedef struct _GeeLazyClass GeeLazyClass;
57
58 #define GEE_TYPE_ITERATOR (gee_iterator_get_type ())
59 #define GEE_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERATOR, GeeIterator))
60 #define GEE_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERATOR))
61 #define GEE_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERATOR, GeeIteratorIface))
62
63 typedef struct _GeeIterator GeeIterator;
64 typedef struct _GeeIteratorIface GeeIteratorIface;
65
66 #define GEE_TYPE_ITERABLE (gee_iterable_get_type ())
67 #define GEE_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_ITERABLE, GeeIterable))
68 #define GEE_IS_ITERABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_ITERABLE))
69 #define GEE_ITERABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_ITERABLE, GeeIterableIface))
70
71 typedef struct _GeeIterable GeeIterable;
72 typedef struct _GeeIterableIface GeeIterableIface;
73
74 #define GEE_TYPE_COLLECTION (gee_collection_get_type ())
75 #define GEE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_COLLECTION, GeeCollection))
76 #define GEE_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_COLLECTION))
77 #define GEE_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_COLLECTION, GeeCollectionIface))
78
79 typedef struct _GeeCollection GeeCollection;
80 typedef struct _GeeCollectionIface GeeCollectionIface;
81
82 #define GEE_TYPE_SET (gee_set_get_type ())
83 #define GEE_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_SET, GeeSet))
84 #define GEE_IS_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_SET))
85 #define GEE_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_SET, GeeSetIface))
86
87 typedef struct _GeeSet GeeSet;
88 typedef struct _GeeSetIface GeeSetIface;
89
90 #define GEE_TYPE_MULTI_SET (gee_multi_set_get_type ())
91 #define GEE_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MULTI_SET, GeeMultiSet))
92 #define GEE_IS_MULTI_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MULTI_SET))
93 #define GEE_MULTI_SET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MULTI_SET, GeeMultiSetIface))
94
95 typedef struct _GeeMultiSet GeeMultiSet;
96 typedef struct _GeeMultiSetIface GeeMultiSetIface;
97
98 #define GEE_TYPE_MAP_ITERATOR (gee_map_iterator_get_type ())
99 #define GEE_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIterator))
100 #define GEE_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_MAP_ITERATOR))
101 #define GEE_MAP_ITERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_TYPE_MAP_ITERATOR, GeeMapIteratorIface))
102
103 typedef struct _GeeMapIterator GeeMapIterator;
104 typedef struct _GeeMapIteratorIface GeeMapIteratorIface;
105
106 #define GEE_TYPE_READ_ONLY_MULTI_MAP (gee_read_only_multi_map_get_type ())
107 #define GEE_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap))
108 #define GEE_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass))
109 #define GEE_IS_READ_ONLY_MULTI_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP))
110 #define GEE_IS_READ_ONLY_MULTI_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_READ_ONLY_MULTI_MAP))
111 #define GEE_READ_ONLY_MULTI_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapClass))
112
113 typedef struct _GeeReadOnlyMultiMap GeeReadOnlyMultiMap;
114 typedef struct _GeeReadOnlyMultiMapClass GeeReadOnlyMultiMapClass;
115 typedef struct _GeeReadOnlyMultiMapPrivate GeeReadOnlyMultiMapPrivate;
116 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
117
118 #define GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR (gee_read_only_map_map_iterator_get_type ())
119 #define GEE_READ_ONLY_MAP_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIterator))
120 #define GEE_READ_ONLY_MAP_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass))
121 #define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR))
122 #define GEE_READ_ONLY_MAP_IS_MAP_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR))
123 #define GEE_READ_ONLY_MAP_MAP_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_READ_ONLY_MAP_TYPE_MAP_ITERATOR, GeeReadOnlyMapMapIteratorClass))
124
125 typedef struct _GeeReadOnlyMapMapIterator GeeReadOnlyMapMapIterator;
126 typedef struct _GeeReadOnlyMapMapIteratorClass GeeReadOnlyMapMapIteratorClass;
127
128 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
129 typedef enum  {
130         GEE_TRAVERSABLE_STREAM_YIELD,
131         GEE_TRAVERSABLE_STREAM_CONTINUE,
132         GEE_TRAVERSABLE_STREAM_END
133 } GeeTraversableStream;
134
135 typedef GeeTraversableStream (*GeeStreamFunc) (GeeTraversableStream state, GeeLazy* g, GeeLazy** lazy, void* user_data);
136 struct _GeeIteratorIface {
137         GTypeInterface parent_iface;
138         gboolean (*next) (GeeIterator* self);
139         gboolean (*has_next) (GeeIterator* self);
140         gpointer (*get) (GeeIterator* self);
141         void (*remove) (GeeIterator* self);
142         gboolean (*get_valid) (GeeIterator* self);
143         gboolean (*get_read_only) (GeeIterator* self);
144 };
145
146 typedef gpointer (*GeeFoldFunc) (gpointer g, gpointer a, void* user_data);
147 typedef gpointer (*GeeMapFunc) (gpointer g, void* user_data);
148 typedef gboolean (*GeePredicate) (gconstpointer g, void* user_data);
149 struct _GeeTraversableIface {
150         GTypeInterface parent_iface;
151         GType (*get_g_type) (GeeTraversable* self);
152         GBoxedCopyFunc (*get_g_dup_func) (GeeTraversable* self);
153         GDestroyNotify (*get_g_destroy_func) (GeeTraversable* self);
154         gboolean (*foreach) (GeeTraversable* self, GeeForallFunc f, void* f_target);
155         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);
156         gpointer (*fold) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
157         GeeIterator* (*map) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeMapFunc f, void* f_target);
158         GeeIterator* (*scan) (GeeTraversable* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldFunc f, void* f_target, gpointer seed);
159         GeeIterator* (*filter) (GeeTraversable* self, GeePredicate pred, void* pred_target, GDestroyNotify pred_target_destroy_notify);
160         GeeIterator* (*chop) (GeeTraversable* self, gint offset, gint length);
161         GType (*get_element_type) (GeeTraversable* self);
162 };
163
164 struct _GeeIterableIface {
165         GTypeInterface parent_iface;
166         GType (*get_g_type) (GeeIterable* self);
167         GBoxedCopyFunc (*get_g_dup_func) (GeeIterable* self);
168         GDestroyNotify (*get_g_destroy_func) (GeeIterable* self);
169         GeeIterator* (*iterator) (GeeIterable* self);
170 };
171
172 struct _GeeCollectionIface {
173         GTypeInterface parent_iface;
174         GType (*get_g_type) (GeeCollection* self);
175         GBoxedCopyFunc (*get_g_dup_func) (GeeCollection* self);
176         GDestroyNotify (*get_g_destroy_func) (GeeCollection* self);
177         gboolean (*contains) (GeeCollection* self, gconstpointer item);
178         gboolean (*add) (GeeCollection* self, gconstpointer item);
179         gboolean (*remove) (GeeCollection* self, gconstpointer item);
180         void (*clear) (GeeCollection* self);
181         gboolean (*add_all) (GeeCollection* self, GeeCollection* collection);
182         gboolean (*contains_all) (GeeCollection* self, GeeCollection* collection);
183         gboolean (*remove_all) (GeeCollection* self, GeeCollection* collection);
184         gboolean (*retain_all) (GeeCollection* self, GeeCollection* collection);
185         gpointer* (*to_array) (GeeCollection* self, int* result_length1);
186         gint (*get_size) (GeeCollection* self);
187         gboolean (*get_is_empty) (GeeCollection* self);
188         gboolean (*get_read_only) (GeeCollection* self);
189         GeeCollection* (*get_read_only_view) (GeeCollection* self);
190 };
191
192 struct _GeeSetIface {
193         GTypeInterface parent_iface;
194         GType (*get_g_type) (GeeSet* self);
195         GBoxedCopyFunc (*get_g_dup_func) (GeeSet* self);
196         GDestroyNotify (*get_g_destroy_func) (GeeSet* self);
197         GeeSet* (*get_read_only_view) (GeeSet* self);
198 };
199
200 struct _GeeMultiSetIface {
201         GTypeInterface parent_iface;
202         GType (*get_g_type) (GeeMultiSet* self);
203         GBoxedCopyFunc (*get_g_dup_func) (GeeMultiSet* self);
204         GDestroyNotify (*get_g_destroy_func) (GeeMultiSet* self);
205         gint (*count) (GeeMultiSet* self, gconstpointer item);
206         GeeMultiSet* (*get_read_only_view) (GeeMultiSet* self);
207 };
208
209 typedef gpointer (*GeeFoldMapFunc) (gconstpointer k, gconstpointer v, gpointer a, void* user_data);
210 typedef gboolean (*GeeForallMapFunc) (gconstpointer k, gconstpointer v, void* user_data);
211 struct _GeeMapIteratorIface {
212         GTypeInterface parent_iface;
213         GType (*get_k_type) (GeeMapIterator* self);
214         GBoxedCopyFunc (*get_k_dup_func) (GeeMapIterator* self);
215         GDestroyNotify (*get_k_destroy_func) (GeeMapIterator* self);
216         GType (*get_v_type) (GeeMapIterator* self);
217         GBoxedCopyFunc (*get_v_dup_func) (GeeMapIterator* self);
218         GDestroyNotify (*get_v_destroy_func) (GeeMapIterator* self);
219         gboolean (*next) (GeeMapIterator* self);
220         gboolean (*has_next) (GeeMapIterator* self);
221         gpointer (*get_key) (GeeMapIterator* self);
222         gpointer (*get_value) (GeeMapIterator* self);
223         void (*set_value) (GeeMapIterator* self, gconstpointer value);
224         void (*unset) (GeeMapIterator* self);
225         gpointer (*fold) (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed);
226         gboolean (*foreach) (GeeMapIterator* self, GeeForallMapFunc f, void* f_target);
227         gboolean (*get_valid) (GeeMapIterator* self);
228         gboolean (*get_mutable) (GeeMapIterator* self);
229         gboolean (*get_read_only) (GeeMapIterator* self);
230 };
231
232 struct _GeeMultiMapIface {
233         GTypeInterface parent_iface;
234         GType (*get_k_type) (GeeMultiMap* self);
235         GBoxedCopyFunc (*get_k_dup_func) (GeeMultiMap* self);
236         GDestroyNotify (*get_k_destroy_func) (GeeMultiMap* self);
237         GType (*get_v_type) (GeeMultiMap* self);
238         GBoxedCopyFunc (*get_v_dup_func) (GeeMultiMap* self);
239         GDestroyNotify (*get_v_destroy_func) (GeeMultiMap* self);
240         GeeSet* (*get_keys) (GeeMultiMap* self);
241         GeeMultiSet* (*get_all_keys) (GeeMultiMap* self);
242         GeeCollection* (*get_values) (GeeMultiMap* self);
243         gboolean (*contains) (GeeMultiMap* self, gconstpointer key);
244         GeeCollection* (*get) (GeeMultiMap* self, gconstpointer key);
245         void (*set) (GeeMultiMap* self, gconstpointer key, gconstpointer value);
246         gboolean (*remove) (GeeMultiMap* self, gconstpointer key, gconstpointer value);
247         gboolean (*remove_all) (GeeMultiMap* self, gconstpointer key);
248         void (*clear) (GeeMultiMap* self);
249         GeeMapIterator* (*map_iterator) (GeeMultiMap* self);
250         gint (*get_size) (GeeMultiMap* self);
251         gboolean (*get_read_only) (GeeMultiMap* self);
252         GeeMultiMap* (*get_read_only_view) (GeeMultiMap* self);
253 };
254
255 struct _GeeReadOnlyMultiMap {
256         GObject parent_instance;
257         GeeReadOnlyMultiMapPrivate * priv;
258 };
259
260 struct _GeeReadOnlyMultiMapClass {
261         GObjectClass parent_class;
262         GeeMultiMap* (*get_read_only_view) (GeeReadOnlyMultiMap* self);
263 };
264
265 struct _GeeReadOnlyMultiMapPrivate {
266         GType k_type;
267         GBoxedCopyFunc k_dup_func;
268         GDestroyNotify k_destroy_func;
269         GType v_type;
270         GBoxedCopyFunc v_dup_func;
271         GDestroyNotify v_destroy_func;
272         GeeMultiMap* _multimap;
273 };
274
275
276 static gpointer gee_read_only_multi_map_parent_class = NULL;
277 static GeeMultiMapIface* gee_read_only_multi_map_gee_multi_map_parent_iface = NULL;
278
279 GType gee_traversable_stream_get_type (void) G_GNUC_CONST;
280 gpointer gee_lazy_ref (gpointer instance);
281 void gee_lazy_unref (gpointer instance);
282 GParamSpec* gee_param_spec_lazy (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
283 void gee_value_set_lazy (GValue* value, gpointer v_object);
284 void gee_value_take_lazy (GValue* value, gpointer v_object);
285 gpointer gee_value_get_lazy (const GValue* value);
286 GType gee_lazy_get_type (void) G_GNUC_CONST;
287 GType gee_iterator_get_type (void) G_GNUC_CONST;
288 GType gee_traversable_get_type (void) G_GNUC_CONST;
289 GType gee_iterable_get_type (void) G_GNUC_CONST;
290 GType gee_collection_get_type (void) G_GNUC_CONST;
291 GType gee_set_get_type (void) G_GNUC_CONST;
292 GType gee_multi_set_get_type (void) G_GNUC_CONST;
293 GType gee_map_iterator_get_type (void) G_GNUC_CONST;
294 GType gee_multi_map_get_type (void) G_GNUC_CONST;
295 GType gee_read_only_multi_map_get_type (void) G_GNUC_CONST;
296 #define GEE_READ_ONLY_MULTI_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMapPrivate))
297 enum  {
298         GEE_READ_ONLY_MULTI_MAP_DUMMY_PROPERTY,
299         GEE_READ_ONLY_MULTI_MAP_K_TYPE,
300         GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC,
301         GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC,
302         GEE_READ_ONLY_MULTI_MAP_V_TYPE,
303         GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC,
304         GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC,
305         GEE_READ_ONLY_MULTI_MAP_SIZE,
306         GEE_READ_ONLY_MULTI_MAP_READ_ONLY
307 };
308 GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap);
309 GeeReadOnlyMultiMap* gee_read_only_multi_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, GeeMultiMap* multimap);
310 static GeeSet* gee_read_only_multi_map_real_get_keys (GeeMultiMap* base);
311 GeeSet* gee_multi_map_get_keys (GeeMultiMap* self);
312 static GeeMultiSet* gee_read_only_multi_map_real_get_all_keys (GeeMultiMap* base);
313 GeeMultiSet* gee_multi_map_get_all_keys (GeeMultiMap* self);
314 static GeeCollection* gee_read_only_multi_map_real_get_values (GeeMultiMap* base);
315 GeeCollection* gee_multi_map_get_values (GeeMultiMap* self);
316 static gboolean gee_read_only_multi_map_real_contains (GeeMultiMap* base, gconstpointer key);
317 gboolean gee_multi_map_contains (GeeMultiMap* self, gconstpointer key);
318 static GeeCollection* gee_read_only_multi_map_real_get (GeeMultiMap* base, gconstpointer key);
319 GeeCollection* gee_multi_map_get (GeeMultiMap* self, gconstpointer key);
320 static void gee_read_only_multi_map_real_set (GeeMultiMap* base, gconstpointer key, gconstpointer value);
321 static gboolean gee_read_only_multi_map_real_remove (GeeMultiMap* base, gconstpointer key, gconstpointer value);
322 static gboolean gee_read_only_multi_map_real_remove_all (GeeMultiMap* base, gconstpointer key);
323 static void gee_read_only_multi_map_real_clear (GeeMultiMap* base);
324 static GeeMapIterator* gee_read_only_multi_map_real_map_iterator (GeeMultiMap* base);
325 GeeMapIterator* gee_multi_map_map_iterator (GeeMultiMap* self);
326 GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMapIterator* iterator);
327 GeeReadOnlyMapMapIterator* gee_read_only_map_map_iterator_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, GeeMapIterator* iterator);
328 GType gee_read_only_map_map_iterator_get_type (void) G_GNUC_CONST;
329 gint gee_multi_map_get_size (GeeMultiMap* self);
330 GeeMultiMap* gee_read_only_multi_map_get_read_only_view (GeeReadOnlyMultiMap* self);
331 static void gee_read_only_multi_map_finalize (GObject* obj);
332 gboolean gee_multi_map_get_read_only (GeeMultiMap* self);
333 static void _vala_gee_read_only_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
334 static void _vala_gee_read_only_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
335
336
337 /**
338  * Constructs a read-only multi-set that mirrors the content of the specified
339  * list.
340  *
341  * @param multiset the multi-set to decorate.
342  */
343 static gpointer _g_object_ref0 (gpointer self) {
344         return self ? g_object_ref (self) : NULL;
345 }
346
347
348 GeeReadOnlyMultiMap* gee_read_only_multi_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, GeeMultiMap* multimap) {
349         GeeReadOnlyMultiMap * self = NULL;
350         GeeMultiMap* _tmp0_;
351         GeeMultiMap* _tmp1_;
352         g_return_val_if_fail (multimap != NULL, NULL);
353         self = (GeeReadOnlyMultiMap*) g_object_new (object_type, NULL);
354         self->priv->k_type = k_type;
355         self->priv->k_dup_func = k_dup_func;
356         self->priv->k_destroy_func = k_destroy_func;
357         self->priv->v_type = v_type;
358         self->priv->v_dup_func = v_dup_func;
359         self->priv->v_destroy_func = v_destroy_func;
360         _tmp0_ = multimap;
361         _tmp1_ = _g_object_ref0 (_tmp0_);
362         _g_object_unref0 (self->priv->_multimap);
363         self->priv->_multimap = _tmp1_;
364         return self;
365 }
366
367
368 GeeReadOnlyMultiMap* gee_read_only_multi_map_new (GType k_type, GBoxedCopyFunc k_dup_func, GDestroyNotify k_destroy_func, GType v_type, GBoxedCopyFunc v_dup_func, GDestroyNotify v_destroy_func, GeeMultiMap* multimap) {
369         return gee_read_only_multi_map_construct (GEE_TYPE_READ_ONLY_MULTI_MAP, k_type, k_dup_func, k_destroy_func, v_type, v_dup_func, v_destroy_func, multimap);
370 }
371
372
373 /**
374  * {@inheritDoc}
375  */
376 static GeeSet* gee_read_only_multi_map_real_get_keys (GeeMultiMap* base) {
377         GeeReadOnlyMultiMap * self;
378         GeeSet* result = NULL;
379         GeeMultiMap* _tmp0_;
380         GeeSet* _tmp1_ = NULL;
381         self = (GeeReadOnlyMultiMap*) base;
382         _tmp0_ = self->priv->_multimap;
383         _tmp1_ = gee_multi_map_get_keys (_tmp0_);
384         result = _tmp1_;
385         return result;
386 }
387
388
389 /**
390  * {@inheritDoc}
391  */
392 static GeeMultiSet* gee_read_only_multi_map_real_get_all_keys (GeeMultiMap* base) {
393         GeeReadOnlyMultiMap * self;
394         GeeMultiSet* result = NULL;
395         GeeMultiMap* _tmp0_;
396         GeeMultiSet* _tmp1_ = NULL;
397         self = (GeeReadOnlyMultiMap*) base;
398         _tmp0_ = self->priv->_multimap;
399         _tmp1_ = gee_multi_map_get_all_keys (_tmp0_);
400         result = _tmp1_;
401         return result;
402 }
403
404
405 /**
406  * {@inheritDoc}
407  */
408 static GeeCollection* gee_read_only_multi_map_real_get_values (GeeMultiMap* base) {
409         GeeReadOnlyMultiMap * self;
410         GeeCollection* result = NULL;
411         GeeMultiMap* _tmp0_;
412         GeeCollection* _tmp1_ = NULL;
413         self = (GeeReadOnlyMultiMap*) base;
414         _tmp0_ = self->priv->_multimap;
415         _tmp1_ = gee_multi_map_get_values (_tmp0_);
416         result = _tmp1_;
417         return result;
418 }
419
420
421 /**
422  * {@inheritDoc}
423  */
424 static gboolean gee_read_only_multi_map_real_contains (GeeMultiMap* base, gconstpointer key) {
425         GeeReadOnlyMultiMap * self;
426         gboolean result = FALSE;
427         GeeMultiMap* _tmp0_;
428         gconstpointer _tmp1_;
429         gboolean _tmp2_ = FALSE;
430         self = (GeeReadOnlyMultiMap*) base;
431         _tmp0_ = self->priv->_multimap;
432         _tmp1_ = key;
433         _tmp2_ = gee_multi_map_contains (_tmp0_, _tmp1_);
434         result = _tmp2_;
435         return result;
436 }
437
438
439 /**
440  * {@inheritDoc}
441  */
442 static GeeCollection* gee_read_only_multi_map_real_get (GeeMultiMap* base, gconstpointer key) {
443         GeeReadOnlyMultiMap * self;
444         GeeCollection* result = NULL;
445         GeeMultiMap* _tmp0_;
446         gconstpointer _tmp1_;
447         GeeCollection* _tmp2_ = NULL;
448         self = (GeeReadOnlyMultiMap*) base;
449         _tmp0_ = self->priv->_multimap;
450         _tmp1_ = key;
451         _tmp2_ = gee_multi_map_get (_tmp0_, _tmp1_);
452         result = _tmp2_;
453         return result;
454 }
455
456
457 /**
458  * {@inheritDoc}
459  */
460 static void gee_read_only_multi_map_real_set (GeeMultiMap* base, gconstpointer key, gconstpointer value) {
461         GeeReadOnlyMultiMap * self;
462         self = (GeeReadOnlyMultiMap*) base;
463         g_assert_not_reached ();
464 }
465
466
467 /**
468  * {@inheritDoc}
469  */
470 static gboolean gee_read_only_multi_map_real_remove (GeeMultiMap* base, gconstpointer key, gconstpointer value) {
471         GeeReadOnlyMultiMap * self;
472         gboolean result = FALSE;
473         self = (GeeReadOnlyMultiMap*) base;
474         g_assert_not_reached ();
475         return result;
476 }
477
478
479 /**
480  * {@inheritDoc}
481  */
482 static gboolean gee_read_only_multi_map_real_remove_all (GeeMultiMap* base, gconstpointer key) {
483         GeeReadOnlyMultiMap * self;
484         gboolean result = FALSE;
485         self = (GeeReadOnlyMultiMap*) base;
486         g_assert_not_reached ();
487         return result;
488 }
489
490
491 /**
492  * {@inheritDoc}
493  */
494 static void gee_read_only_multi_map_real_clear (GeeMultiMap* base) {
495         GeeReadOnlyMultiMap * self;
496         self = (GeeReadOnlyMultiMap*) base;
497         g_assert_not_reached ();
498 }
499
500
501 /**
502  * {@inheritDoc}
503  */
504 static GeeMapIterator* gee_read_only_multi_map_real_map_iterator (GeeMultiMap* base) {
505         GeeReadOnlyMultiMap * self;
506         GeeMapIterator* result = NULL;
507         GeeMultiMap* _tmp0_;
508         GeeMapIterator* _tmp1_ = NULL;
509         GeeMapIterator* _tmp2_;
510         GeeReadOnlyMapMapIterator* _tmp3_;
511         GeeMapIterator* _tmp4_;
512         self = (GeeReadOnlyMultiMap*) base;
513         _tmp0_ = self->priv->_multimap;
514         _tmp1_ = gee_multi_map_map_iterator (_tmp0_);
515         _tmp2_ = _tmp1_;
516         _tmp3_ = gee_read_only_map_map_iterator_new (self->priv->k_type, (GBoxedCopyFunc) self->priv->k_dup_func, self->priv->k_destroy_func, self->priv->v_type, (GBoxedCopyFunc) self->priv->v_dup_func, self->priv->v_destroy_func, _tmp2_);
517         _tmp4_ = (GeeMapIterator*) _tmp3_;
518         _g_object_unref0 (_tmp2_);
519         result = _tmp4_;
520         return result;
521 }
522
523
524 static gint gee_read_only_multi_map_real_get_size (GeeMultiMap* base) {
525         gint result;
526         GeeReadOnlyMultiMap* self;
527         GeeMultiMap* _tmp0_;
528         gint _tmp1_;
529         gint _tmp2_;
530         self = (GeeReadOnlyMultiMap*) base;
531         _tmp0_ = self->priv->_multimap;
532         _tmp1_ = gee_multi_map_get_size (_tmp0_);
533         _tmp2_ = _tmp1_;
534         result = _tmp2_;
535         return result;
536 }
537
538
539 static gboolean gee_read_only_multi_map_real_get_read_only (GeeMultiMap* base) {
540         gboolean result;
541         GeeReadOnlyMultiMap* self;
542         self = (GeeReadOnlyMultiMap*) base;
543         result = TRUE;
544         return result;
545 }
546
547
548 GeeMultiMap* gee_read_only_multi_map_get_read_only_view (GeeReadOnlyMultiMap* self) {
549         g_return_val_if_fail (self != NULL, NULL);
550         return GEE_READ_ONLY_MULTI_MAP_GET_CLASS (self)->get_read_only_view (self);
551 }
552
553
554 static GeeMultiMap* gee_read_only_multi_map_real_get_read_only_view (GeeReadOnlyMultiMap* base) {
555         GeeMultiMap* result;
556         GeeReadOnlyMultiMap* self;
557         GeeMultiMap* _tmp0_;
558         self = base;
559         _tmp0_ = _g_object_ref0 ((GeeMultiMap*) self);
560         result = _tmp0_;
561         return result;
562 }
563
564
565 static void gee_read_only_multi_map_class_init (GeeReadOnlyMultiMapClass * klass) {
566         gee_read_only_multi_map_parent_class = g_type_class_peek_parent (klass);
567         g_type_class_add_private (klass, sizeof (GeeReadOnlyMultiMapPrivate));
568         GEE_READ_ONLY_MULTI_MAP_CLASS (klass)->get_read_only_view = gee_read_only_multi_map_real_get_read_only_view;
569         G_OBJECT_CLASS (klass)->get_property = _vala_gee_read_only_multi_map_get_property;
570         G_OBJECT_CLASS (klass)->set_property = _vala_gee_read_only_multi_map_set_property;
571         G_OBJECT_CLASS (klass)->finalize = gee_read_only_multi_map_finalize;
572         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_K_TYPE, g_param_spec_gtype ("k-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));
573         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC, g_param_spec_pointer ("k-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));
574         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC, g_param_spec_pointer ("k-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));
575         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_V_TYPE, g_param_spec_gtype ("v-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));
576         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC, g_param_spec_pointer ("v-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));
577         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC, g_param_spec_pointer ("v-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));
578         /**
579          * {@inheritDoc}
580          */
581         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_SIZE, g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
582         /**
583          * {@inheritDoc}
584          */
585         g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_READ_ONLY_MULTI_MAP_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));
586 }
587
588
589 static GType gee_read_only_multi_map_gee_multi_map_get_k_type (GeeReadOnlyMultiMap* self) {
590         return self->priv->k_type;
591 }
592
593
594 static GBoxedCopyFunc gee_read_only_multi_map_gee_multi_map_get_k_dup_func (GeeReadOnlyMultiMap* self) {
595         return self->priv->k_dup_func;
596 }
597
598
599 static GDestroyNotify gee_read_only_multi_map_gee_multi_map_get_k_destroy_func (GeeReadOnlyMultiMap* self) {
600         return self->priv->k_destroy_func;
601 }
602
603
604 static GType gee_read_only_multi_map_gee_multi_map_get_v_type (GeeReadOnlyMultiMap* self) {
605         return self->priv->v_type;
606 }
607
608
609 static GBoxedCopyFunc gee_read_only_multi_map_gee_multi_map_get_v_dup_func (GeeReadOnlyMultiMap* self) {
610         return self->priv->v_dup_func;
611 }
612
613
614 static GDestroyNotify gee_read_only_multi_map_gee_multi_map_get_v_destroy_func (GeeReadOnlyMultiMap* self) {
615         return self->priv->v_destroy_func;
616 }
617
618
619 static void gee_read_only_multi_map_gee_multi_map_interface_init (GeeMultiMapIface * iface) {
620         gee_read_only_multi_map_gee_multi_map_parent_iface = g_type_interface_peek_parent (iface);
621         iface->get_keys = (GeeSet* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_get_keys;
622         iface->get_all_keys = (GeeMultiSet* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_get_all_keys;
623         iface->get_values = (GeeCollection* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_get_values;
624         iface->contains = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_read_only_multi_map_real_contains;
625         iface->get = (GeeCollection* (*)(GeeMultiMap*, gconstpointer)) gee_read_only_multi_map_real_get;
626         iface->set = (void (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_read_only_multi_map_real_set;
627         iface->remove = (gboolean (*)(GeeMultiMap*, gconstpointer, gconstpointer)) gee_read_only_multi_map_real_remove;
628         iface->remove_all = (gboolean (*)(GeeMultiMap*, gconstpointer)) gee_read_only_multi_map_real_remove_all;
629         iface->clear = (void (*)(GeeMultiMap*)) gee_read_only_multi_map_real_clear;
630         iface->map_iterator = (GeeMapIterator* (*)(GeeMultiMap*)) gee_read_only_multi_map_real_map_iterator;
631         iface->get_k_type = (GType(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_k_type;
632         iface->get_k_dup_func = (GBoxedCopyFunc(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_k_dup_func;
633         iface->get_k_destroy_func = (GDestroyNotify(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_k_destroy_func;
634         iface->get_v_type = (GType(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_v_type;
635         iface->get_v_dup_func = (GBoxedCopyFunc(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_v_dup_func;
636         iface->get_v_destroy_func = (GDestroyNotify(*)(GeeMultiMap*)) gee_read_only_multi_map_gee_multi_map_get_v_destroy_func;
637         iface->get_size = gee_read_only_multi_map_real_get_size;
638         iface->get_read_only = gee_read_only_multi_map_real_get_read_only;
639         iface->get_read_only_view = (GeeMultiMap* (*) (GeeMultiMap *)) gee_read_only_multi_map_get_read_only_view;
640 }
641
642
643 static void gee_read_only_multi_map_instance_init (GeeReadOnlyMultiMap * self) {
644         self->priv = GEE_READ_ONLY_MULTI_MAP_GET_PRIVATE (self);
645 }
646
647
648 static void gee_read_only_multi_map_finalize (GObject* obj) {
649         GeeReadOnlyMultiMap * self;
650         self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap);
651         _g_object_unref0 (self->priv->_multimap);
652         G_OBJECT_CLASS (gee_read_only_multi_map_parent_class)->finalize (obj);
653 }
654
655
656 /**
657  * Read-only view for {@link MultiMap} collections.
658  *
659  * This class decorates any class which implements the {@link MultiMap}
660  * interface by making it read only. Any method which normally modify data will
661  * throw an error.
662  *
663  * @see MultiMap
664  */
665 GType gee_read_only_multi_map_get_type (void) {
666         static volatile gsize gee_read_only_multi_map_type_id__volatile = 0;
667         if (g_once_init_enter (&gee_read_only_multi_map_type_id__volatile)) {
668                 static const GTypeInfo g_define_type_info = { sizeof (GeeReadOnlyMultiMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_read_only_multi_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeReadOnlyMultiMap), 0, (GInstanceInitFunc) gee_read_only_multi_map_instance_init, NULL };
669                 static const GInterfaceInfo gee_multi_map_info = { (GInterfaceInitFunc) gee_read_only_multi_map_gee_multi_map_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
670                 GType gee_read_only_multi_map_type_id;
671                 gee_read_only_multi_map_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeReadOnlyMultiMap", &g_define_type_info, 0);
672                 g_type_add_interface_static (gee_read_only_multi_map_type_id, GEE_TYPE_MULTI_MAP, &gee_multi_map_info);
673                 g_once_init_leave (&gee_read_only_multi_map_type_id__volatile, gee_read_only_multi_map_type_id);
674         }
675         return gee_read_only_multi_map_type_id__volatile;
676 }
677
678
679 static void _vala_gee_read_only_multi_map_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
680         GeeReadOnlyMultiMap * self;
681         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap);
682         switch (property_id) {
683                 case GEE_READ_ONLY_MULTI_MAP_SIZE:
684                 g_value_set_int (value, gee_multi_map_get_size ((GeeMultiMap*) self));
685                 break;
686                 case GEE_READ_ONLY_MULTI_MAP_READ_ONLY:
687                 g_value_set_boolean (value, gee_multi_map_get_read_only ((GeeMultiMap*) self));
688                 break;
689                 default:
690                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
691                 break;
692         }
693 }
694
695
696 static void _vala_gee_read_only_multi_map_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
697         GeeReadOnlyMultiMap * self;
698         self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_READ_ONLY_MULTI_MAP, GeeReadOnlyMultiMap);
699         switch (property_id) {
700                 case GEE_READ_ONLY_MULTI_MAP_K_TYPE:
701                 self->priv->k_type = g_value_get_gtype (value);
702                 break;
703                 case GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC:
704                 self->priv->k_dup_func = g_value_get_pointer (value);
705                 break;
706                 case GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC:
707                 self->priv->k_destroy_func = g_value_get_pointer (value);
708                 break;
709                 case GEE_READ_ONLY_MULTI_MAP_V_TYPE:
710                 self->priv->v_type = g_value_get_gtype (value);
711                 break;
712                 case GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC:
713                 self->priv->v_dup_func = g_value_get_pointer (value);
714                 break;
715                 case GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC:
716                 self->priv->v_destroy_func = g_value_get_pointer (value);
717                 break;
718                 default:
719                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
720                 break;
721         }
722 }
723
724
725