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 /** */
32 public struct DataSet
33 {
34 
35 	/**
36 	 * Destroys the dataset, freeing all memory allocated, and calling any
37 	 * destroy functions set for data elements.
38 	 *
39 	 * Params:
40 	 *     datasetLocation = the location identifying the dataset.
41 	 */
42 	public static void destroy(void* datasetLocation)
43 	{
44 		g_dataset_destroy(datasetLocation);
45 	}
46 
47 	/**
48 	 * Calls the given function for each data element which is associated
49 	 * with the given location. Note that this function is NOT thread-safe.
50 	 * So unless @datalist can be protected from any modifications during
51 	 * invocation of this function, it should not be called.
52 	 *
53 	 * Params:
54 	 *     datasetLocation = the location identifying the dataset.
55 	 *     func = the function to call for each data element.
56 	 *     userData = user data to pass to the function.
57 	 */
58 	public static void foreac(void* datasetLocation, GDataForeachFunc func, void* userData)
59 	{
60 		g_dataset_foreach(datasetLocation, func, userData);
61 	}
62 
63 	/**
64 	 * Gets the data element corresponding to a #GQuark.
65 	 *
66 	 * Params:
67 	 *     datasetLocation = the location identifying the dataset.
68 	 *     keyId = the #GQuark id to identify the data element.
69 	 *
70 	 * Return: the data element corresponding to the #GQuark, or %NULL if
71 	 *     it is not found.
72 	 */
73 	public static void* idGetData(void* datasetLocation, GQuark keyId)
74 	{
75 		return g_dataset_id_get_data(datasetLocation, keyId);
76 	}
77 
78 	/**
79 	 * Removes an element, without calling its destroy notification
80 	 * function.
81 	 *
82 	 * Params:
83 	 *     datasetLocation = the location identifying the dataset.
84 	 *     keyId = the #GQuark ID identifying the data element.
85 	 *
86 	 * Return: the data previously stored at @key_id, or %NULL if none.
87 	 */
88 	public static void* idRemoveNoNotify(void* datasetLocation, GQuark keyId)
89 	{
90 		return g_dataset_id_remove_no_notify(datasetLocation, keyId);
91 	}
92 
93 	/**
94 	 * Sets the data element associated with the given #GQuark id, and also
95 	 * the function to call when the data element is destroyed. Any
96 	 * previous data with the same key is removed, and its destroy function
97 	 * is called.
98 	 *
99 	 * Params:
100 	 *     datasetLocation = the location identifying the dataset.
101 	 *     keyId = the #GQuark id to identify the data element.
102 	 *     data = the data element.
103 	 *     destroyFunc = the function to call when the data element is
104 	 *         removed. This function will be called with the data
105 	 *         element and can be used to free any memory allocated
106 	 *         for it.
107 	 */
108 	public static void idSetDataFull(void* datasetLocation, GQuark keyId, void* data, GDestroyNotify destroyFunc)
109 	{
110 		g_dataset_id_set_data_full(datasetLocation, keyId, data, destroyFunc);
111 	}
112 }