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