1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module glib.DataSet;
26 
27 private import gtkc.glib;
28 public  import gtkc.glibtypes;
29 
30 
31 public struct DataSet
32 {
33 	/**
34 	 */
35 
36 	/**
37 	 * Destroys the dataset, freeing all memory allocated, and calling any
38 	 * destroy functions set for data elements.
39 	 *
40 	 * Params:
41 	 *     datasetLocation = the location identifying the dataset.
42 	 */
43 	public static void destroy(void* datasetLocation)
44 	{
45 		g_dataset_destroy(datasetLocation);
46 	}
47 
48 	/**
49 	 * Calls the given function for each data element which is associated
50 	 * with the given location. Note that this function is NOT thread-safe.
51 	 * So unless @datalist can be protected from any modifications during
52 	 * invocation of this function, it should not be called.
53 	 *
54 	 * Params:
55 	 *     datasetLocation = the location identifying the dataset.
56 	 *     func = the function to call for each data element.
57 	 *     userData = user data to pass to the function.
58 	 */
59 	public static void foreac(void* datasetLocation, GDataForeachFunc func, void* userData)
60 	{
61 		g_dataset_foreach(datasetLocation, func, userData);
62 	}
63 
64 	/**
65 	 * Gets the data element corresponding to a #GQuark.
66 	 *
67 	 * Params:
68 	 *     datasetLocation = the location identifying the dataset.
69 	 *     keyId = the #GQuark id to identify the data element.
70 	 *
71 	 * Return: the data element corresponding to the #GQuark, or %NULL if
72 	 *     it is not found.
73 	 */
74 	public static void* idGetData(void* datasetLocation, GQuark keyId)
75 	{
76 		return g_dataset_id_get_data(datasetLocation, keyId);
77 	}
78 
79 	/**
80 	 * Removes an element, without calling its destroy notification
81 	 * function.
82 	 *
83 	 * Params:
84 	 *     datasetLocation = the location identifying the dataset.
85 	 *     keyId = the #GQuark ID identifying the data element.
86 	 *
87 	 * Return: the data previously stored at @key_id, or %NULL if none.
88 	 */
89 	public static void* idRemoveNoNotify(void* datasetLocation, GQuark keyId)
90 	{
91 		return g_dataset_id_remove_no_notify(datasetLocation, keyId);
92 	}
93 
94 	/**
95 	 * Sets the data element associated with the given #GQuark id, and also
96 	 * the function to call when the data element is destroyed. Any
97 	 * previous data with the same key is removed, and its destroy function
98 	 * is called.
99 	 *
100 	 * Params:
101 	 *     datasetLocation = the location identifying the dataset.
102 	 *     keyId = the #GQuark id to identify the data element.
103 	 *     data = the data element.
104 	 *     destroyFunc = the function to call when the data element is
105 	 *         removed. This function will be called with the data
106 	 *         element and can be used to free any memory allocated
107 	 *         for it.
108 	 */
109 	public static void idSetDataFull(void* datasetLocation, GQuark keyId, void* data, GDestroyNotify destroyFunc)
110 	{
111 		g_dataset_id_set_data_full(datasetLocation, keyId, data, destroyFunc);
112 	}
113 }