1 /* readonlymultimap.c generated by valac 0.18.0, the Vala compiler
2 * generated from readonlymultimap.vala, do not modify */
4 /* readonlymultimap.vala
6 * Copyright (C) 2013 Maciej Piechotka
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.
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.
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
23 * Maciej Piechotka <uzytkownik2@gmail.com>
27 #include <glib-object.h>
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))
35 typedef struct _GeeMultiMap GeeMultiMap;
36 typedef struct _GeeMultiMapIface GeeMultiMapIface;
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))
43 typedef struct _GeeTraversable GeeTraversable;
44 typedef struct _GeeTraversableIface GeeTraversableIface;
46 #define GEE_TRAVERSABLE_TYPE_STREAM (gee_traversable_stream_get_type ())
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))
55 typedef struct _GeeLazy GeeLazy;
56 typedef struct _GeeLazyClass GeeLazyClass;
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))
63 typedef struct _GeeIterator GeeIterator;
64 typedef struct _GeeIteratorIface GeeIteratorIface;
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))
71 typedef struct _GeeIterable GeeIterable;
72 typedef struct _GeeIterableIface GeeIterableIface;
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))
79 typedef struct _GeeCollection GeeCollection;
80 typedef struct _GeeCollectionIface GeeCollectionIface;
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))
87 typedef struct _GeeSet GeeSet;
88 typedef struct _GeeSetIface GeeSetIface;
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))
95 typedef struct _GeeMultiSet GeeMultiSet;
96 typedef struct _GeeMultiSetIface GeeMultiSetIface;
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))
103 typedef struct _GeeMapIterator GeeMapIterator;
104 typedef struct _GeeMapIteratorIface GeeMapIteratorIface;
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))
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)))
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))
125 typedef struct _GeeReadOnlyMapMapIterator GeeReadOnlyMapMapIterator;
126 typedef struct _GeeReadOnlyMapMapIteratorClass GeeReadOnlyMapMapIteratorClass;
128 typedef gboolean (*GeeForallFunc) (gpointer g, void* user_data);
130 GEE_TRAVERSABLE_STREAM_YIELD,
131 GEE_TRAVERSABLE_STREAM_CONTINUE,
132 GEE_TRAVERSABLE_STREAM_END
133 } GeeTraversableStream;
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);
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);
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);
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);
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);
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);
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);
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);
255 struct _GeeReadOnlyMultiMap {
256 GObject parent_instance;
257 GeeReadOnlyMultiMapPrivate * priv;
260 struct _GeeReadOnlyMultiMapClass {
261 GObjectClass parent_class;
262 GeeMultiMap* (*get_read_only_view) (GeeReadOnlyMultiMap* self);
265 struct _GeeReadOnlyMultiMapPrivate {
267 GBoxedCopyFunc k_dup_func;
268 GDestroyNotify k_destroy_func;
270 GBoxedCopyFunc v_dup_func;
271 GDestroyNotify v_destroy_func;
272 GeeMultiMap* _multimap;
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;
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))
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
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);
338 * Constructs a read-only multi-set that mirrors the content of the specified
341 * @param multiset the multi-set to decorate.
343 static gpointer _g_object_ref0 (gpointer self) {
344 return self ? g_object_ref (self) : NULL;
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;
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;
361 _tmp1_ = _g_object_ref0 (_tmp0_);
362 _g_object_unref0 (self->priv->_multimap);
363 self->priv->_multimap = _tmp1_;
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);
376 static GeeSet* gee_read_only_multi_map_real_get_keys (GeeMultiMap* base) {
377 GeeReadOnlyMultiMap * self;
378 GeeSet* result = NULL;
380 GeeSet* _tmp1_ = NULL;
381 self = (GeeReadOnlyMultiMap*) base;
382 _tmp0_ = self->priv->_multimap;
383 _tmp1_ = gee_multi_map_get_keys (_tmp0_);
392 static GeeMultiSet* gee_read_only_multi_map_real_get_all_keys (GeeMultiMap* base) {
393 GeeReadOnlyMultiMap * self;
394 GeeMultiSet* result = NULL;
396 GeeMultiSet* _tmp1_ = NULL;
397 self = (GeeReadOnlyMultiMap*) base;
398 _tmp0_ = self->priv->_multimap;
399 _tmp1_ = gee_multi_map_get_all_keys (_tmp0_);
408 static GeeCollection* gee_read_only_multi_map_real_get_values (GeeMultiMap* base) {
409 GeeReadOnlyMultiMap * self;
410 GeeCollection* result = NULL;
412 GeeCollection* _tmp1_ = NULL;
413 self = (GeeReadOnlyMultiMap*) base;
414 _tmp0_ = self->priv->_multimap;
415 _tmp1_ = gee_multi_map_get_values (_tmp0_);
424 static gboolean gee_read_only_multi_map_real_contains (GeeMultiMap* base, gconstpointer key) {
425 GeeReadOnlyMultiMap * self;
426 gboolean result = FALSE;
428 gconstpointer _tmp1_;
429 gboolean _tmp2_ = FALSE;
430 self = (GeeReadOnlyMultiMap*) base;
431 _tmp0_ = self->priv->_multimap;
433 _tmp2_ = gee_multi_map_contains (_tmp0_, _tmp1_);
442 static GeeCollection* gee_read_only_multi_map_real_get (GeeMultiMap* base, gconstpointer key) {
443 GeeReadOnlyMultiMap * self;
444 GeeCollection* result = NULL;
446 gconstpointer _tmp1_;
447 GeeCollection* _tmp2_ = NULL;
448 self = (GeeReadOnlyMultiMap*) base;
449 _tmp0_ = self->priv->_multimap;
451 _tmp2_ = gee_multi_map_get (_tmp0_, _tmp1_);
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 ();
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 ();
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 ();
494 static void gee_read_only_multi_map_real_clear (GeeMultiMap* base) {
495 GeeReadOnlyMultiMap * self;
496 self = (GeeReadOnlyMultiMap*) base;
497 g_assert_not_reached ();
504 static GeeMapIterator* gee_read_only_multi_map_real_map_iterator (GeeMultiMap* base) {
505 GeeReadOnlyMultiMap * self;
506 GeeMapIterator* result = NULL;
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_);
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_);
524 static gint gee_read_only_multi_map_real_get_size (GeeMultiMap* base) {
526 GeeReadOnlyMultiMap* self;
530 self = (GeeReadOnlyMultiMap*) base;
531 _tmp0_ = self->priv->_multimap;
532 _tmp1_ = gee_multi_map_get_size (_tmp0_);
539 static gboolean gee_read_only_multi_map_real_get_read_only (GeeMultiMap* base) {
541 GeeReadOnlyMultiMap* self;
542 self = (GeeReadOnlyMultiMap*) base;
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);
554 static GeeMultiMap* gee_read_only_multi_map_real_get_read_only_view (GeeReadOnlyMultiMap* base) {
556 GeeReadOnlyMultiMap* self;
559 _tmp0_ = _g_object_ref0 ((GeeMultiMap*) self);
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));
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));
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));
589 static GType gee_read_only_multi_map_gee_multi_map_get_k_type (GeeReadOnlyMultiMap* self) {
590 return self->priv->k_type;
594 static GBoxedCopyFunc gee_read_only_multi_map_gee_multi_map_get_k_dup_func (GeeReadOnlyMultiMap* self) {
595 return self->priv->k_dup_func;
599 static GDestroyNotify gee_read_only_multi_map_gee_multi_map_get_k_destroy_func (GeeReadOnlyMultiMap* self) {
600 return self->priv->k_destroy_func;
604 static GType gee_read_only_multi_map_gee_multi_map_get_v_type (GeeReadOnlyMultiMap* self) {
605 return self->priv->v_type;
609 static GBoxedCopyFunc gee_read_only_multi_map_gee_multi_map_get_v_dup_func (GeeReadOnlyMultiMap* self) {
610 return self->priv->v_dup_func;
614 static GDestroyNotify gee_read_only_multi_map_gee_multi_map_get_v_destroy_func (GeeReadOnlyMultiMap* self) {
615 return self->priv->v_destroy_func;
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;
643 static void gee_read_only_multi_map_instance_init (GeeReadOnlyMultiMap * self) {
644 self->priv = GEE_READ_ONLY_MULTI_MAP_GET_PRIVATE (self);
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);
657 * Read-only view for {@link MultiMap} collections.
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
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);
675 return gee_read_only_multi_map_type_id__volatile;
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));
686 case GEE_READ_ONLY_MULTI_MAP_READ_ONLY:
687 g_value_set_boolean (value, gee_multi_map_get_read_only ((GeeMultiMap*) self));
690 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
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);
703 case GEE_READ_ONLY_MULTI_MAP_K_DUP_FUNC:
704 self->priv->k_dup_func = g_value_get_pointer (value);
706 case GEE_READ_ONLY_MULTI_MAP_K_DESTROY_FUNC:
707 self->priv->k_destroy_func = g_value_get_pointer (value);
709 case GEE_READ_ONLY_MULTI_MAP_V_TYPE:
710 self->priv->v_type = g_value_get_gtype (value);
712 case GEE_READ_ONLY_MULTI_MAP_V_DUP_FUNC:
713 self->priv->v_dup_func = g_value_get_pointer (value);
715 case GEE_READ_ONLY_MULTI_MAP_V_DESTROY_FUNC:
716 self->priv->v_destroy_func = g_value_get_pointer (value);
719 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);