1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>EBackendFactory</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7
<link rel="home" href="index.html" title="Evolution-Data-Server Reference Manual">
8
<link rel="up" href="ch06.html" title="Abstract Classes for Backends">
9
<link rel="prev" href="eds-EBackend.html" title="EBackend">
10
<link rel="next" href="eds-EDataFactory.html" title="EDataFactory">
11
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
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">
17
<td><a accesskey="p" href="eds-EBackend.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="ch06.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">Evolution-Data-Server Reference Manual</th>
21
<td><a accesskey="n" href="eds-EDataFactory.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#eds-EBackendFactory.synopsis" class="shortcut">Top</a>
26
<a href="#eds-EBackendFactory.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="eds-EBackendFactory"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="eds-EBackendFactory.top_of_page"></a>EBackendFactory</span></h2>
34
<p>EBackendFactory — An abstract base class for backend factories</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
39
<a name="eds-EBackendFactory.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">
41
#include <libebackend/libebackend.h>
43
struct <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory">EBackendFactory</a>;
44
struct <a class="link" href="eds-EBackendFactory.html#EBackendFactoryClass" title="struct EBackendFactoryClass">EBackendFactoryClass</a>;
45
const <span class="returnvalue">gchar</span> * <a class="link" href="eds-EBackendFactory.html#e-backend-factory-get-hash-key" title="e_backend_factory_get_hash_key ()">e_backend_factory_get_hash_key</a> (<em class="parameter"><code><a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> *factory</code></em>);
46
<a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="returnvalue">EBackend</span></a> * <a class="link" href="eds-EBackendFactory.html#e-backend-factory-new-backend" title="e_backend_factory_new_backend ()">e_backend_factory_new_backend</a> (<em class="parameter"><code><a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> *factory</code></em>,
47
<em class="parameter"><code><a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a> *source</code></em>);
50
<div class="refsect1">
51
<a name="eds-EBackendFactory.description"></a><h2>Description</h2>
53
An <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a>'s job is to create an <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a> instance for a
54
given <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>. <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> and <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a> should be subclassed
55
together, so that each type of <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> creates a unique type
56
of <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a>.
59
Each <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> subclass must define a hash key to uniquely
60
identify itself among other <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> subclasses. <a class="link" href="eds-EDataFactory.html#EDataFactory" title="struct EDataFactory"><span class="type">EDataFactory</span></a>
61
then services incoming connection requests by deriving a hash key from
62
the requested <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>, using the dervied hash key to find an appropriate
63
<a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a>, and creating an <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a> instance from that factory
64
to pair with the requested <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>.
67
<div class="refsect1">
68
<a name="eds-EBackendFactory.details"></a><h2>Details</h2>
69
<div class="refsect2">
70
<a name="EBackendFactory"></a><h3>struct EBackendFactory</h3>
71
<pre class="programlisting">struct EBackendFactory {
75
Contains only private data that should be read and manipulated using the
78
<p class="since">Since 3.4</p>
81
<div class="refsect2">
82
<a name="EBackendFactoryClass"></a><h3>struct EBackendFactoryClass</h3>
83
<pre class="programlisting">struct EBackendFactoryClass {
85
const gchar * (*get_hash_key) (EBackendFactory *factory);
86
EBackend * (*new_backend) (EBackendFactory *factory,
91
Base class structure for the <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> class
93
<div class="variablelist"><table border="0">
94
<col align="left" valign="top">
97
<td><p><span class="term"><em class="structfield"><code><a name="EBackendFactoryClass.get-hash-key"></a>get_hash_key</code></em> ()</span></p></td>
98
<td>Get the hash key for this factory</td>
101
<td><p><span class="term"><em class="structfield"><code><a name="EBackendFactoryClass.new-backend"></a>new_backend</code></em> ()</span></p></td>
102
<td>Create a new <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a> of the appropriate type for the passed <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>
107
<p class="since">Since 3.4</p>
110
<div class="refsect2">
111
<a name="e-backend-factory-get-hash-key"></a><h3>e_backend_factory_get_hash_key ()</h3>
112
<pre class="programlisting">const <span class="returnvalue">gchar</span> * e_backend_factory_get_hash_key (<em class="parameter"><code><a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> *factory</code></em>);</pre>
114
Returns a hash key which uniquely identifies <em class="parameter"><code>factory</code></em>.
117
Since only one instance of each <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> subclass is ever created,
118
the hash key need only be unique among subclasses, not among instances of
121
<div class="variablelist"><table border="0">
122
<col align="left" valign="top">
125
<td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td>
126
<td>an <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a>
130
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
131
<td>a hash key which uniquely identifies <em class="parameter"><code>factory</code></em>
136
<p class="since">Since 3.4</p>
139
<div class="refsect2">
140
<a name="e-backend-factory-new-backend"></a><h3>e_backend_factory_new_backend ()</h3>
141
<pre class="programlisting"><a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="returnvalue">EBackend</span></a> * e_backend_factory_new_backend (<em class="parameter"><code><a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a> *factory</code></em>,
142
<em class="parameter"><code><a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a> *source</code></em>);</pre>
144
Returns a new <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a> instance for <em class="parameter"><code>source</code></em>.
146
<div class="variablelist"><table border="0">
147
<col align="left" valign="top">
150
<td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td>
151
<td>an <a class="link" href="eds-EBackendFactory.html#EBackendFactory" title="struct EBackendFactory"><span class="type">EBackendFactory</span></a>
155
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
156
<td>an <a class="link" href="eds-ESource.html#ESource" title="struct ESource"><span class="type">ESource</span></a>
160
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
161
<td>a new <a class="link" href="eds-EBackend.html#EBackend" title="struct EBackend"><span class="type">EBackend</span></a> instance for <em class="parameter"><code>source</code></em>
166
<p class="since">Since 3.4</p>
172
Generated by GTK-Doc V1.19</div>
b'\\ No newline at end of file'