~ubuntu-branches/ubuntu/precise/dee/precise

« back to all changes in this revision

Viewing changes to doc/reference/dee-1.0/html/dee-1.0-DeeResourceManager.html

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2012-04-12 11:33:08 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20120412113308-cr9nobarsigs0xak
Tags: 1.0.10-0ubuntu1
* New upstream release.
  - unity-music-daemon crashed with SIGSEGV in find_term_real() from
    dee_tree_index_lookup() from dee_index_lookup() from
    unity_music_lens_rhythmbox_collection_search() (LP: #963991)
  - unity-applications-daemon crashed with SIGSEGV in
    g_variant_get_type_info() (LP: #938382)
  - unity-applications-daemon crashed with SIGSEGV in
    g_variant_type_info_check() (LP: #953978)
* debian/control:
  - update Standards-Version to latest

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>DeeResourceManager</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 
7
<link rel="home" href="index.html" title="Dee Reference Manual">
 
8
<link rel="up" href="ch04.html" title="Resources and Serialization">
 
9
<link rel="prev" href="DeeFileResourceManager.html" title="DeeFileResourceManager">
 
10
<link rel="next" href="dee-1.0-DeeSerializable.html" title="DeeSerializable">
 
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
</head>
 
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
16
<tr valign="middle">
 
17
<td><a accesskey="p" href="DeeFileResourceManager.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
18
<td><a accesskey="u" href="ch04.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
20
<th width="100%" align="center">Dee Reference Manual</th>
 
21
<td><a accesskey="n" href="dee-1.0-DeeSerializable.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
22
</tr>
 
23
<tr><td colspan="5" class="shortcuts">
 
24
<a href="#dee-1.0-DeeResourceManager.synopsis" class="shortcut">Top</a>
 
25
                   | 
 
26
                  <a href="#dee-1.0-DeeResourceManager.description" class="shortcut">Description</a>
 
27
</td></tr>
 
28
</table>
 
29
<div class="refentry">
 
30
<a name="dee-1.0-DeeResourceManager"></a><div class="titlepage"></div>
 
31
<div class="refnamediv"><table width="100%"><tr>
 
32
<td valign="top">
 
33
<h2><span class="refentrytitle"><a name="dee-1.0-DeeResourceManager.top_of_page"></a>DeeResourceManager</span></h2>
 
34
<p>DeeResourceManager — Store and load <a href="/usr/share/gtk-doc/html/dee-1.0/DeeSerializable.html"><span class="type">DeeSerializable</span></a>s by name</p>
 
35
</td>
 
36
<td valign="top" align="right"></td>
 
37
</tr></table></div>
 
38
<div class="refsynopsisdiv">
 
39
<a name="dee-1.0-DeeResourceManager.synopsis"></a><h2>Synopsis</h2>
 
40
<pre class="synopsis">
 
41
#include &lt;dee.h&gt;
 
42
 
 
43
struct              <a class="link" href="dee-1.0-DeeResourceManager.html#DeeResourceManagerIface" title="struct DeeResourceManagerIface">DeeResourceManagerIface</a>;
 
44
<a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="returnvalue">DeeResourceManager</span></a> * <a class="link" href="dee-1.0-DeeResourceManager.html#dee-resource-manager-get-default" title="dee_resource_manager_get_default ()">dee_resource_manager_get_default</a>   (<em class="parameter"><code><span class="type">void</span></code></em>);
 
45
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *           <a class="link" href="dee-1.0-DeeResourceManager.html#dee-resource-manager-load" title="dee_resource_manager_load ()">dee_resource_manager_load</a>           (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="type">DeeResourceManager</span></a> *self</code></em>,
 
46
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_name</code></em>,
 
47
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
 
48
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="dee-1.0-DeeResourceManager.html#dee-resource-manager-store" title="dee_resource_manager_store ()">dee_resource_manager_store</a>          (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="type">DeeResourceManager</span></a> *self</code></em>,
 
49
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/dee-1.0/DeeSerializable.html"><span class="type">DeeSerializable</span></a> *resource</code></em>,
 
50
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_name</code></em>,
 
51
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
 
52
</pre>
 
53
</div>
 
54
<div class="refsect1">
 
55
<a name="dee-1.0-DeeResourceManager.description"></a><h2>Description</h2>
 
56
<p>
 
57
The <a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="type">DeeResourceManager</span></a> API provides a simple API for storing and loading
 
58
DeeSerializables from some persistent storage. The resources
 
59
are stored in a flat structure identified by names that should be chosen
 
60
similarly to DBus names. That is reverse domain names ala
 
61
net.launchpad.Example.MyData.
 
62
</p>
 
63
</div>
 
64
<div class="refsect1">
 
65
<a name="dee-1.0-DeeResourceManager.details"></a><h2>Details</h2>
 
66
<div class="refsect2">
 
67
<a name="DeeResourceManagerIface"></a><h3>struct DeeResourceManagerIface</h3>
 
68
<pre class="programlisting">struct DeeResourceManagerIface {
 
69
  GTypeInterface g_iface;
 
70
 
 
71
  gboolean       (*store)         (DeeResourceManager  *self,
 
72
                                   DeeSerializable     *resource,
 
73
                                   const gchar         *resource_name,
 
74
                                   GError             **error);
 
75
 
 
76
  GObject*       (*load)          (DeeResourceManager  *self,
 
77
                                   const gchar         *resource_name,
 
78
                                   GError             **error);
 
79
};
 
80
</pre>
 
81
<p>
 
82
</p>
 
83
</div>
 
84
<hr>
 
85
<div class="refsect2">
 
86
<a name="dee-resource-manager-get-default"></a><h3>dee_resource_manager_get_default ()</h3>
 
87
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="returnvalue">DeeResourceManager</span></a> * dee_resource_manager_get_default   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 
88
<p>
 
89
Get a pointer to the platform default <a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="type">DeeResourceManager</span></a>.
 
90
</p>
 
91
<div class="variablelist"><table border="0">
 
92
<col align="left" valign="top">
 
93
<tbody><tr>
 
94
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
95
<td>The default resource manager for the platform.
 
96
Do not unreference. If you need to keep the instance around
 
97
you must manually reference it. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
98
</td>
 
99
</tr></tbody>
 
100
</table></div>
 
101
</div>
 
102
<hr>
 
103
<div class="refsect2">
 
104
<a name="dee-resource-manager-load"></a><h3>dee_resource_manager_load ()</h3>
 
105
<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *           dee_resource_manager_load           (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="type">DeeResourceManager</span></a> *self</code></em>,
 
106
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_name</code></em>,
 
107
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
 
108
<p>
 
109
Load a resource from persistent storage. The loaded resource will be of the
 
110
same GType as when it was stored (provided that the same serialization and
 
111
parse functions are registered).
 
112
</p>
 
113
<p>
 
114
In case of an error the error will be in the <a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#GFileError"><span class="type">GFileError</span></a> domain. Specifically
 
115
if there is no resource with the name <em class="parameter"><code>resource_name</code></em> the error code will
 
116
be <a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#G-FILE-ERROR-NOENT:CAPS"><span class="type">G_FILE_ERROR_NOENT</span></a>.
 
117
</p>
 
118
<p>
 
119
Important note: This call may do blocking IO. The resource manager must
 
120
guarantee that this call is reasonably fast, like writing the externalized
 
121
resource to a file, but not blocking IO over a network socket.
 
122
</p>
 
123
<div class="variablelist"><table border="0">
 
124
<col align="left" valign="top">
 
125
<tbody>
 
126
<tr>
 
127
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
128
<td>The resource manager to invoke</td>
 
129
</tr>
 
130
<tr>
 
131
<td><p><span class="term"><em class="parameter"><code>resource_name</code></em> :</span></p></td>
 
132
<td>The name of the resource to retrieve</td>
 
133
</tr>
 
134
<tr>
 
135
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
 
136
<td>A return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer. <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore errors</td>
 
137
</tr>
 
138
<tr>
 
139
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
140
<td>A newly allocated <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> in case of success
 
141
and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> otherwise. In case of a runtime error the <em class="parameter"><code>error</code></em>
 
142
pointer will be set. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
 
143
</td>
 
144
</tr>
 
145
</tbody>
 
146
</table></div>
 
147
</div>
 
148
<hr>
 
149
<div class="refsect2">
 
150
<a name="dee-resource-manager-store"></a><h3>dee_resource_manager_store ()</h3>
 
151
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            dee_resource_manager_store          (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dee-1.0/DeeResourceManager.html"><span class="type">DeeResourceManager</span></a> *self</code></em>,
 
152
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/dee-1.0/DeeSerializable.html"><span class="type">DeeSerializable</span></a> *resource</code></em>,
 
153
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *resource_name</code></em>,
 
154
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
 
155
<p>
 
156
Store a resource under a given name. The resource manager must guarantee
 
157
that the stored data survives system reboots and that you can recreate a
 
158
copy of <em class="parameter"><code>resource</code></em> by calling <a class="link" href="dee-1.0-DeeResourceManager.html#dee-resource-manager-load" title="dee_resource_manager_load ()"><code class="function">dee_resource_manager_load()</code></a> using the
 
159
same <em class="parameter"><code>resource_name</code></em>.
 
160
</p>
 
161
<p>
 
162
Important note: This call may do blocking IO. The resource manager must
 
163
guarantee that this call is reasonably fast, like writing the externalized
 
164
resource to a file, but not blocking IO over a network socket.
 
165
</p>
 
166
<div class="variablelist"><table border="0">
 
167
<col align="left" valign="top">
 
168
<tbody>
 
169
<tr>
 
170
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
171
<td>The resource manager to invoke</td>
 
172
</tr>
 
173
<tr>
 
174
<td><p><span class="term"><em class="parameter"><code>resource</code></em> :</span></p></td>
 
175
<td>A <a href="/usr/share/gtk-doc/html/dee-1.0/DeeSerializable.html"><span class="type">DeeSerializable</span></a> to store under <em class="parameter"><code>resource_name</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
176
</td>
 
177
</tr>
 
178
<tr>
 
179
<td><p><span class="term"><em class="parameter"><code>resource_name</code></em> :</span></p></td>
 
180
<td>The name to store the resource under. Will overwrite any
 
181
existing resource with the same name</td>
 
182
</tr>
 
183
<tr>
 
184
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
 
185
<td>A return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer. <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore errors</td>
 
186
</tr>
 
187
<tr>
 
188
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
189
<td>
 
190
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise. In case of a runtime
 
191
error the <em class="parameter"><code>error</code></em> pointer will point to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> in the
 
192
<span class="type">DeeResourceError</span> domain.</td>
 
193
</tr>
 
194
</tbody>
 
195
</table></div>
 
196
</div>
 
197
</div>
 
198
</div>
 
199
<div class="footer">
 
200
<hr>
 
201
          Generated by GTK-Doc V1.18</div>
 
202
</body>
 
203
</html>
 
 
b'\\ No newline at end of file'