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

« back to all changes in this revision

Viewing changes to doc/reference/dee-1.0/html/DeeSerializable.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>DeeSerializable</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="DeeResourceManager.html" title="DeeResourceManager">
10
 
<link rel="next" href="object-tree.html" title="Object Hierarchy">
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="DeeResourceManager.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="object-tree.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="#DeeSerializable.synopsis" class="shortcut">Top</a>
25
 
                   | 
26
 
                  <a href="#DeeSerializable.description" class="shortcut">Description</a>
27
 
                   | 
28
 
                  <a href="#DeeSerializable.object-hierarchy" class="shortcut">Object Hierarchy</a>
29
 
                   | 
30
 
                  <a href="#DeeSerializable.prerequisites" class="shortcut">Prerequisites</a>
31
 
                   | 
32
 
                  <a href="#DeeSerializable.implementations" class="shortcut">Known Implementations</a>
33
 
</td></tr>
34
 
</table>
35
 
<div class="refentry">
36
 
<a name="DeeSerializable"></a><div class="titlepage"></div>
37
 
<div class="refnamediv"><table width="100%"><tr>
38
 
<td valign="top">
39
 
<h2><span class="refentrytitle"><a name="DeeSerializable.top_of_page"></a>DeeSerializable</span></h2>
40
 
<p>DeeSerializable — Interface for classes that can serialize to and from <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a>s</p>
41
 
</td>
42
 
<td valign="top" align="right"></td>
43
 
</tr></table></div>
44
 
<div class="refsynopsisdiv">
45
 
<a name="DeeSerializable.synopsis"></a><h2>Synopsis</h2>
46
 
<pre class="synopsis">
47
 
#include &lt;dee.h&gt;
48
 
 
49
 
                    <a class="link" href="DeeSerializable.html#DeeSerializable-struct" title="DeeSerializable">DeeSerializable</a>;
50
 
struct              <a class="link" href="DeeSerializable.html#DeeSerializableIface" title="struct DeeSerializableIface">DeeSerializableIface</a>;
51
 
<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="DeeSerializable.html#DeeSerializableParseFunc" title="DeeSerializableParseFunc ()">*DeeSerializableParseFunc</a>)         (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *data</code></em>);
52
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *          <a class="link" href="DeeSerializable.html#dee-serializable-externalize" title="dee_serializable_externalize ()">dee_serializable_externalize</a>        (<em class="parameter"><code><a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> *self</code></em>);
53
 
<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="DeeSerializable.html#dee-serializable-parse" title="dee_serializable_parse ()">dee_serializable_parse</a>              (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *data</code></em>,
54
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>);
55
 
<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="DeeSerializable.html#dee-serializable-parse-external" title="dee_serializable_parse_external ()">dee_serializable_parse_external</a>     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *data</code></em>);
56
 
<span class="returnvalue">void</span>                <a class="link" href="DeeSerializable.html#dee-serializable-register-parser" title="dee_serializable_register_parser ()">dee_serializable_register_parser</a>    (<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
57
 
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> *vtype</code></em>,
58
 
                                                         <em class="parameter"><code><a class="link" href="DeeSerializable.html#DeeSerializableParseFunc" title="DeeSerializableParseFunc ()"><span class="type">DeeSerializableParseFunc</span></a> parse_func</code></em>);
59
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *          <a class="link" href="DeeSerializable.html#dee-serializable-serialize" title="dee_serializable_serialize ()">dee_serializable_serialize</a>          (<em class="parameter"><code><a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> *self</code></em>);
60
 
</pre>
61
 
</div>
62
 
<div class="refsect1">
63
 
<a name="DeeSerializable.object-hierarchy"></a><h2>Object Hierarchy</h2>
64
 
<pre class="synopsis">
65
 
  GInterface
66
 
   +----DeeSerializable
67
 
</pre>
68
 
</div>
69
 
<div class="refsect1">
70
 
<a name="DeeSerializable.prerequisites"></a><h2>Prerequisites</h2>
71
 
<p>
72
 
DeeSerializable requires
73
 
 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p>
74
 
</div>
75
 
<div class="refsect1">
76
 
<a name="DeeSerializable.implementations"></a><h2>Known Implementations</h2>
77
 
<p>
78
 
DeeSerializable is implemented by
79
 
 <a class="link" href="DeeFilterModel.html" title="DeeFilterModel">DeeFilterModel</a>,  <a class="link" href="DeeProxyModel.html" title="DeeProxyModel">DeeProxyModel</a>,  <a class="link" href="DeeSequenceModel.html" title="DeeSequenceModel">DeeSequenceModel</a>,  <a class="link" href="DeeSerializableModel.html" title="DeeSerializableModel">DeeSerializableModel</a>,  <a class="link" href="DeeSharedModel.html" title="DeeSharedModel">DeeSharedModel</a> and  <a class="link" href="DeeTransaction.html" title="DeeTransaction">DeeTransaction</a>.</p>
80
 
</div>
81
 
<div class="refsect1">
82
 
<a name="DeeSerializable.description"></a><h2>Description</h2>
83
 
<p>
84
 
Interface for classes that can serialize to and from <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a>s.
85
 
</p>
86
 
<p>
87
 
There are two serialization concepts supported by this API:
88
 
<span class="emphasis"><em>serialization</em></span> and <span class="emphasis"><em>externalization</em></span>.
89
 
A serialized instance is created with <a class="link" href="DeeSerializable.html#dee-serializable-serialize" title="dee_serializable_serialize ()"><code class="function">dee_serializable_serialize()</code></a> and can
90
 
be read back with <a class="link" href="DeeSerializable.html#dee-serializable-parse" title="dee_serializable_parse ()"><code class="function">dee_serializable_parse()</code></a> provided you know the correct
91
 
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> for the serialized data. The <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> representation of your
92
 
serialized data is guaranteed to be exactly as you implement yourself in the
93
 
<em class="parameter"><code>serialize</code></em> vfunc of the <a class="link" href="DeeSerializable.html#DeeSerializableIface" title="struct DeeSerializableIface"><span class="type">DeeSerializableIface</span></a>.
94
 
</p>
95
 
<p>
96
 
With externalized instances you don't have to know the correct GType to
97
 
recreate the instance. The <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> is encoded in the data itself. When you're
98
 
using <a class="link" href="DeeSerializable.html#dee-serializable-externalize" title="dee_serializable_externalize ()"><code class="function">dee_serializable_externalize()</code></a> your data will be wrapped in a container
99
 
format with the required object metadata to read it back. For this reason
100
 
<a class="link" href="DeeSerializable.html#dee-serializable-parse-external" title="dee_serializable_parse_external ()"><code class="function">dee_serializable_parse_external()</code></a> doesn't require you to pass in the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>
101
 
you want to deserialize.
102
 
</p>
103
 
<p>
104
 
</p>
105
 
<div class="refsect2">
106
 
<a name="dee-1.0-DeeSerializable.on_subclasses"></a><h3>On Subclasses of DeeSerializable Types</h3>
107
 
<p>
108
 
As a rule of thumb you need to re-implement the <a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> interface
109
 
and install parse functions with <a class="link" href="DeeSerializable.html#dee-serializable-register-parser" title="dee_serializable_register_parser ()"><code class="function">dee_serializable_register_parser()</code></a> every
110
 
time you create a new class derived from a <a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> superclass.
111
 
</p>
112
 
<p>
113
 
In case a subclass does not provide it's own serialization interface
114
 
Dee will recurse upwards in the type hierarchy and use the serialization and
115
 
parser implementations of the first superclass with the required behaviour.
116
 
This means that the parsed instance will <span class="emphasis"><em>not</em></span> be an
117
 
instance of the subclass but only of the serializable superclass.
118
 
Caveat emptor.
119
 
</p>
120
 
</div>
121
 
<p>
122
 
</p>
123
 
</div>
124
 
<div class="refsect1">
125
 
<a name="DeeSerializable.details"></a><h2>Details</h2>
126
 
<div class="refsect2">
127
 
<a name="DeeSerializable-struct"></a><h3>DeeSerializable</h3>
128
 
<pre class="programlisting">typedef struct _DeeSerializable DeeSerializable;</pre>
129
 
<p>
130
 
</p>
131
 
</div>
132
 
<hr>
133
 
<div class="refsect2">
134
 
<a name="DeeSerializableIface"></a><h3>struct DeeSerializableIface</h3>
135
 
<pre class="programlisting">struct DeeSerializableIface {
136
 
  GTypeInterface g_iface;
137
 
 
138
 
  GVariant*       (*serialize)         (DeeSerializable *self);
139
 
};
140
 
</pre>
141
 
<p>
142
 
</p>
143
 
</div>
144
 
<hr>
145
 
<div class="refsect2">
146
 
<a name="DeeSerializableParseFunc"></a><h3>DeeSerializableParseFunc ()</h3>
147
 
<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> *           (*DeeSerializableParseFunc)         (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *data</code></em>);</pre>
148
 
<div class="variablelist"><table border="0">
149
 
<col align="left" valign="top">
150
 
<tbody>
151
 
<tr>
152
 
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
153
 
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> with type signature as passed to
154
 
<a class="link" href="DeeSerializable.html#dee-serializable-register-parser" title="dee_serializable_register_parser ()"><code class="function">dee_serializable_register_parser()</code></a> when the parser was registered.
155
 
The variant is not referenced.</td>
156
 
</tr>
157
 
<tr>
158
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
159
 
<td>A newly constructed <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> of the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>
160
 
used when registering the parser. Note that since
161
 
the environment guarantees that the input data is valid
162
 
according to the registration information this function
163
 
can not fail. Thus <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is not a valid return value. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
164
 
</td>
165
 
</tr>
166
 
</tbody>
167
 
</table></div>
168
 
</div>
169
 
<hr>
170
 
<div class="refsect2">
171
 
<a name="dee-serializable-externalize"></a><h3>dee_serializable_externalize ()</h3>
172
 
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *          dee_serializable_externalize        (<em class="parameter"><code><a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> *self</code></em>);</pre>
173
 
<p>
174
 
Build an externalized form of <em class="parameter"><code>self</code></em> which can be used together with
175
 
<a class="link" href="DeeSerializable.html#dee-serializable-parse-external" title="dee_serializable_parse_external ()"><code class="function">dee_serializable_parse_external()</code></a> to rebuild a copy of <em class="parameter"><code>self</code></em>.
176
 
</p>
177
 
<p>
178
 
It is important to note that the variant returned from this method does
179
 
not have the same type signature as returned from a call to
180
 
<a class="link" href="DeeSerializable.html#dee-serializable-serialize" title="dee_serializable_serialize ()"><code class="function">dee_serializable_serialize()</code></a>. Externalization will wrap the serialized data
181
 
in a container format with versioning information and headers with type
182
 
information.
183
 
</p>
184
 
<div class="variablelist"><table border="0">
185
 
<col align="left" valign="top">
186
 
<tbody>
187
 
<tr>
188
 
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
189
 
<td>The instance to externalize</td>
190
 
</tr>
191
 
<tr>
192
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
193
 
<td>A floating reference to a <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> with the externalized data.</td>
194
 
</tr>
195
 
</tbody>
196
 
</table></div>
197
 
</div>
198
 
<hr>
199
 
<div class="refsect2">
200
 
<a name="dee-serializable-parse"></a><h3>dee_serializable_parse ()</h3>
201
 
<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_serializable_parse              (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *data</code></em>,
202
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>);</pre>
203
 
<p>
204
 
Reconstruct a <a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> from <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> data. For this function
205
 
to work you need to register a parser with
206
 
<a class="link" href="DeeSerializable.html#dee-serializable-register-parser" title="dee_serializable_register_parser ()"><code class="function">dee_serializable_register_parser()</code></a>. Any native Dee class will do so
207
 
automatically.
208
 
</p>
209
 
<p>
210
 
This method only works on data created with <a class="link" href="DeeSerializable.html#dee-serializable-serialize" title="dee_serializable_serialize ()"><code class="function">dee_serializable_serialize()</code></a>
211
 
and <span class="emphasis"><em>not</em></span> with data from <a class="link" href="DeeSerializable.html#dee-serializable-externalize" title="dee_serializable_externalize ()"><code class="function">dee_serializable_externalize()</code></a>.
212
 
</p>
213
 
<p>
214
 
Since a <a class="link" href="DeeSerializable.html#DeeSerializableParseFunc" title="DeeSerializableParseFunc ()"><span class="type">DeeSerializableParseFunc</span></a> is not allowed to fail - by contract -
215
 
it can be guaranteed that this function only returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in case there
216
 
is no known parser for <em class="parameter"><code>type</code></em> and <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> signature of <em class="parameter"><code>data</code></em>.
217
 
</p>
218
 
<div class="variablelist"><table border="0">
219
 
<col align="left" valign="top">
220
 
<tbody>
221
 
<tr>
222
 
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
223
 
<td>The <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> data to parse. If this is a floating reference it will
224
 
be consumed</td>
225
 
</tr>
226
 
<tr>
227
 
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
228
 
<td>The <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the class to instantiate from <em class="parameter"><code>data</code></em>
229
 
</td>
230
 
</tr>
231
 
<tr>
232
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
233
 
<td>A newly constructed <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> build from <em class="parameter"><code>data</code></em>
234
 
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in case no parser has been registered for the given
235
 
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> or variant signature. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
236
 
</td>
237
 
</tr>
238
 
</tbody>
239
 
</table></div>
240
 
</div>
241
 
<hr>
242
 
<div class="refsect2">
243
 
<a name="dee-serializable-parse-external"></a><h3>dee_serializable_parse_external ()</h3>
244
 
<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_serializable_parse_external     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *data</code></em>);</pre>
245
 
<p>
246
 
Reconstruct a <a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> from <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> data. For this function
247
 
to work you need to register a parser with
248
 
<a class="link" href="DeeSerializable.html#dee-serializable-register-parser" title="dee_serializable_register_parser ()"><code class="function">dee_serializable_register_parser()</code></a>. Any native Dee class will do so
249
 
automatically.
250
 
</p>
251
 
<p>
252
 
This method only works on data created with <a class="link" href="DeeSerializable.html#dee-serializable-externalize" title="dee_serializable_externalize ()"><code class="function">dee_serializable_externalize()</code></a>
253
 
and <span class="emphasis"><em>not</em></span> with data from  <a class="link" href="DeeSerializable.html#dee-serializable-serialize" title="dee_serializable_serialize ()"><code class="function">dee_serializable_serialize()</code></a>.
254
 
</p>
255
 
<p>
256
 
Since a <a class="link" href="DeeSerializable.html#DeeSerializableParseFunc" title="DeeSerializableParseFunc ()"><span class="type">DeeSerializableParseFunc</span></a> is not allowed to fail - by contract -
257
 
it can be guaranteed that this function only returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in case there
258
 
is no known parser for the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> signature of <em class="parameter"><code>data</code></em>.
259
 
</p>
260
 
<div class="variablelist"><table border="0">
261
 
<col align="left" valign="top">
262
 
<tbody>
263
 
<tr>
264
 
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
265
 
<td>The <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> data to parse</td>
266
 
</tr>
267
 
<tr>
268
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
269
 
<td>A newly constructed <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> build from <em class="parameter"><code>data</code></em>
270
 
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> in case no parser has been registered for the given
271
 
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> or variant signature. Free with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
272
 
</td>
273
 
</tr>
274
 
</tbody>
275
 
</table></div>
276
 
</div>
277
 
<hr>
278
 
<div class="refsect2">
279
 
<a name="dee-serializable-register-parser"></a><h3>dee_serializable_register_parser ()</h3>
280
 
<pre class="programlisting"><span class="returnvalue">void</span>                dee_serializable_register_parser    (<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
281
 
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> *vtype</code></em>,
282
 
                                                         <em class="parameter"><code><a class="link" href="DeeSerializable.html#DeeSerializableParseFunc" title="DeeSerializableParseFunc ()"><span class="type">DeeSerializableParseFunc</span></a> parse_func</code></em>);</pre>
283
 
<p>
284
 
Register a parser that can convert <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> data into an instance of
285
 
a given <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>. Note that you can register more than one parser for the
286
 
same <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> provided that you give them different variant type signatures.
287
 
</p>
288
 
<p>
289
 
If there is already a parser registered for the given <em class="parameter"><code>type</code></em> and <em class="parameter"><code>vtype</code></em>
290
 
it will be silently replaced.
291
 
</p>
292
 
<p>
293
 
The recommended behaviour is that <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> classes register their parsers in
294
 
their respective class init functions.
295
 
</p>
296
 
<div class="variablelist"><table border="0">
297
 
<col align="left" valign="top">
298
 
<tbody>
299
 
<tr>
300
 
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
301
 
<td>The <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the object class to register a parser for</td>
302
 
</tr>
303
 
<tr>
304
 
<td><p><span class="term"><em class="parameter"><code>vtype</code></em> :</span></p></td>
305
 
<td>Variants to be converted must have this signature</td>
306
 
</tr>
307
 
<tr>
308
 
<td><p><span class="term"><em class="parameter"><code>parse_func</code></em> :</span></p></td>
309
 
<td>A function to convert <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> data into an instance of the
310
 
given <em class="parameter"><code>type</code></em>.</td>
311
 
</tr>
312
 
</tbody>
313
 
</table></div>
314
 
</div>
315
 
<hr>
316
 
<div class="refsect2">
317
 
<a name="dee-serializable-serialize"></a><h3>dee_serializable_serialize ()</h3>
318
 
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *          dee_serializable_serialize          (<em class="parameter"><code><a class="link" href="DeeSerializable.html" title="DeeSerializable"><span class="type">DeeSerializable</span></a> *self</code></em>);</pre>
319
 
<p>
320
 
Build a clean serialized representation of <em class="parameter"><code>self</code></em>. The signature of the
321
 
returned variant is entirely determined by the underlying implementation.
322
 
You can recreate a serialized instance by calling <a class="link" href="DeeSerializable.html#dee-serializable-parse" title="dee_serializable_parse ()"><code class="function">dee_serializable_parse()</code></a>
323
 
provided that you know the correct <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> for the serialized instance.
324
 
</p>
325
 
<div class="variablelist"><table border="0">
326
 
<col align="left" valign="top">
327
 
<tbody>
328
 
<tr>
329
 
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
330
 
<td>The instance to serialize</td>
331
 
</tr>
332
 
<tr>
333
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
334
 
<td>A reference to a <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> with
335
 
the serialized data. The variants type signature is entirely
336
 
dependent of the underlying implementation. Free using
337
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-unref"><code class="function">g_variant_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
338
 
</td>
339
 
</tr>
340
 
</tbody>
341
 
</table></div>
342
 
</div>
343
 
</div>
344
 
</div>
345
 
<div class="footer">
346
 
<hr>
347
 
          Generated by GTK-Doc V1.18</div>
348
 
</body>
349
 
</html>
 
 
b'\\ No newline at end of file'