~ubuntu-branches/ubuntu/quantal/qtmobility/quantal

« back to all changes in this revision

Viewing changes to doc/html/publ-subs.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-16 16:18:07 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20101116161807-k2dzt2nyse975r3l
Tags: 1.1.0-0ubuntu1
* New upstream release
* Syncronise with Debian, no remaining changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    </div>
48
48
    <div id="shortCut">
49
49
      <ul>
50
 
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Mobility 1.1 BETA</a></span></li>
 
50
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Mobility 1.1</a></span></li>
51
51
        <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com">ALL VERSIONS        </a></li>
52
52
      </ul>
53
53
     </div>
165
165
<p>The QtMobility APIs are placed into the <i>QtMobility</i> namespace. This is done to facilitate the future migration of Mobility APIs into Qt. See the <a href="quickstart.html">Quickstart guide</a> for an example on how the namespace impacts on application development.</p>
166
166
<a name="overview"></a>
167
167
<h2>Overview</h2>
168
 
<p>The Qt Value Space unifies various sources of hierarchical data into a single consistent model. Conceptually the Value Space is a hierarchical tree of which each node or leaf can optionally contain a QVariant value. A serialized version of a simple example Value Space might look like this.</p>
 
168
<p>The Qt Value Space unifies various sources of hierarchical data into a single consistent model. Conceptually the Value Space is a hierarchical tree of which each node or leaf can optionally contain a <a href="http://qt.nokia.com/doc/4.6/qvariant.html">QVariant</a> value. A serialized version of a simple example Value Space might look like this.</p>
169
169
<pre class="highlightedCode brush: cpp"> /Device/Buttons = 3
170
170
 /Device/Buttons/1/Name = Menu
171
171
 /Device/Buttons/1/Usable = true
197
197
<h3>Shared Memory Layer</h3>
198
198
<p>The Shared Memory layer stores all values in a 10MB block of shared memory which is reserved when the Value Space server initializes. As the layer creates this region at startup, it is assumed that the operating system lazily commits memory. If this assumption is invalid, the Shared Memory layer will unnecessarily consume 10MB of memory.</p>
199
199
<p>Value Space clients read from the Shared Memory layer's shared memory region directly. A kernel lock is acquired for each read to prevent corruption. While the layer supports concurrent readers, it is possible that a faulty or malicious application could acquire and refuse to release this lock causing any layer updates to be delayed indefinitely.</p>
200
 
<p>Only the Value Space server ever writes to the shared memory region. When clients attempt to add items to the layer, their changes are transmitted via a QLocalSocket (e.g&#x2e; <tt>/tmp/qt/valuespace_shmlayer</tt> domain socket on Unix systems) to the server where the update is performed. Updates are batched in-process and sent when the process re-enters the Qt event loop. Transmission and synchronization of changes can be forced manually by the <a href="qvaluespacepublisher.html#sync">QValueSpacePublisher::sync</a>() function, although as this requires a round trip between the client and server, doing so frequently may significantly degrade performance.</p>
 
200
<p>Only the Value Space server ever writes to the shared memory region. When clients attempt to add items to the layer, their changes are transmitted via a <a href="http://qt.nokia.com/doc/4.6/qlocalsocket.html">QLocalSocket</a> (e.g&#x2e; <tt>/tmp/qt/valuespace_shmlayer</tt> domain socket on Unix systems) to the server where the update is performed. Updates are batched in-process and sent when the process re-enters the Qt event loop. Transmission and synchronization of changes can be forced manually by the <a href="qvaluespacepublisher.html#sync">QValueSpacePublisher::sync</a>() function, although as this requires a round trip between the client and server, doing so frequently may significantly degrade performance.</p>
201
201
<p>Change notifications are transmitted to clients in the form of &quot;something has changed&quot; messages. Nodes within the shared memory region are versioned, which allows clients to quickly determine exactly what has changed without the need for a bulkier change notification protocol.</p>
202
202
<a name="symbian-settings-layer"></a>
203
203
<h3>Symbian Settings Layer</h3>
231
231
 }</pre>
232
232
<a name="limitations"></a>
233
233
<h4><b>Limitations</b></h4>
234
 
<p>The underlying Symbian APIs limit the data types that can be stored natively in available backing stores. In practice this is not a problem since the unsupported data types are automatically serialized in QByteArray and stored as 8-bit byte form by SymbianSettingslayer. The serialization/deserialization is transparent operation to the API user but may cause interoperatibility issues with native Symbian codes that access the same data directly. The maximum size of the bytearray is 65535 for RPropery backing store.</p>
 
234
<p>The underlying Symbian APIs limit the data types that can be stored natively in available backing stores. In practice this is not a problem since the unsupported data types are automatically serialized in <a href="http://qt.nokia.com/doc/4.6/qbytearray.html">QByteArray</a> and stored as 8-bit byte form by SymbianSettingslayer. The serialization/deserialization is transparent operation to the API user but may cause interoperatibility issues with native Symbian codes that access the same data directly. The maximum size of the bytearray is 65535 for RPropery backing store.</p>
235
235
<a name="gconf-layer"></a>
236
236
<h3>GConf Layer</h3>
237
237
<p>Publish and Subscribe API can be used to access the GConf configuration system.</p>
238
238
<a name="limitations"></a>
239
239
<h4><b>Limitations</b></h4>
240
 
<p>GConf can natively store only a limited set of QVariant data types. These types are Bool, Int, Double, String, StringList and List. When publishing other data types the values are automatically serialized and stored to GConf as BASE64 encoded strings. When reading these values they are automatically converted back to the original data types. The serialization/deserialization is transparent operation to the API user but may cause interoperatibility issues with native applications that access the same data directly.</p>
 
240
<p>GConf can natively store only a limited set of <a href="http://qt.nokia.com/doc/4.6/qvariant.html">QVariant</a> data types. These types are Bool, Int, Double, String, StringList and List. When publishing other data types the values are automatically serialized and stored to GConf as BASE64 encoded strings. When reading these values they are automatically converted back to the original data types. The serialization/deserialization is transparent operation to the API user but may cause interoperatibility issues with native applications that access the same data directly.</p>
241
241
<a name="examples"></a>
242
242
<h2>Examples</h2>
243
243
<a name="publish-and-subscribe"></a>