Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / utils / mono-property-hash.h
1 /**
2  * \file
3  * Hash table for (object, property) pairs
4  *
5  * Author:
6  *      Zoltan Varga (vargaz@gmail.com)
7  *
8  * (C) 2008 Novell, Inc
9  */
10
11 /*
12  * This is similar to the GLib hash table, but stores (object, property) pairs. It can
13  * be used to store rarely used fields of runtime structures, decreasing memory usage.
14  * The memory required to store one property is the size of one hash node, about 3
15  * pointers.
16  */
17
18 #ifndef _MONO_PROPERTY_HASH_H_
19 #define _MONO_PROPERTY_HASH_H_
20
21 #include <glib.h>
22 #include <mono/utils/mono-publib.h>
23
24 G_BEGIN_DECLS
25
26 typedef struct _MonoPropertyHash MonoPropertyHash;
27
28 MONO_API MonoPropertyHash* mono_property_hash_new (void);
29
30 MONO_API void mono_property_hash_destroy (MonoPropertyHash *hash);
31
32 MONO_API void mono_property_hash_insert (MonoPropertyHash *hash, gpointer object, guint32 property,
33                                                                 gpointer value);
34
35 /* Remove all properties of OBJECT */
36 MONO_API void mono_property_hash_remove_object (MonoPropertyHash *hash, gpointer object);
37
38 MONO_API gpointer mono_property_hash_lookup (MonoPropertyHash *hash, gpointer object, guint32 property);
39
40 G_END_DECLS
41
42 #endif