/usr/share/gtk-doc/html/dee-1.0/DeeSharedModel.html is in libdee-doc 1.0.10-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Dee Reference Manual: DeeSharedModel</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Dee Reference Manual">
<link rel="up" href="ch02.html" title="Models">
<link rel="prev" href="DeeSerializableModel.html" title="DeeSerializableModel">
<link rel="next" href="DeeTransaction.html" title="DeeTransaction">
<meta name="generator" content="GTK-Doc V1.20 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#DeeSharedModel.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#DeeSharedModel.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces"> <span class="dim">|</span>
<a href="#DeeSharedModel.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties"> <span class="dim">|</span>
<a href="#DeeSharedModel.properties" class="shortcut">Properties</a></span><span id="nav_signals"> <span class="dim">|</span>
<a href="#DeeSharedModel.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="DeeSerializableModel.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="DeeTransaction.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="DeeSharedModel"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="DeeSharedModel.top_of_page"></a>DeeSharedModel</span></h2>
<p>DeeSharedModel — A <span class="type">DeeModel</span> that can synchronize with other
<a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> objects across D-Bus.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="DeeSharedModel.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-flush-revision-queue" title="dee_shared_model_flush_revision_queue ()">dee_shared_model_flush_revision_queue</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="DeePeer.html" title="DeePeer"><span class="returnvalue">DeePeer</span></a> *
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-get-peer" title="dee_shared_model_get_peer ()">dee_shared_model_get_peer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-get-swarm-name" title="dee_shared_model_get_swarm_name ()">dee_shared_model_get_swarm_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-is-leader" title="dee_shared_model_is_leader ()">dee_shared_model_is_leader</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-is-synchronized" title="dee_shared_model_is_synchronized ()">dee_shared_model_is_synchronized</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">DeeModel</span> *
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-new" title="dee_shared_model_new ()">dee_shared_model_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">DeeModel</span> *
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-new-for-peer" title="dee_shared_model_new_for_peer ()">dee_shared_model_new_for_peer</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">DeeModel</span> *
</td>
<td class="function_name">
<a class="link" href="DeeSharedModel.html#dee-shared-model-new-with-back-end" title="dee_shared_model_new_with_back_end ()">dee_shared_model_new_with_back_end</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.properties"></a><h2>Properties</h2>
<div class="informaltable"><table border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type"><a class="link" href="DeeSharedModel.html#DeeSharedModelAccessMode" title="enum DeeSharedModelAccessMode"><span class="type">DeeSharedModelAccessMode</span></a></td>
<td class="property_name"><a class="link" href="DeeSharedModel.html#DeeSharedModel--access-mode" title="The “access-mode” property">access-mode</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> *</td>
<td class="property_name"><a class="link" href="DeeSharedModel.html#DeeSharedModel--peer" title="The “peer” property">peer</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type"><span class="type">gboolean</span></td>
<td class="property_name"><a class="link" href="DeeSharedModel.html#DeeSharedModel--synchronized" title="The “synchronized” property">synchronized</a></td>
<td class="property_flags">Read</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.signals"></a><h2>Signals</h2>
<div class="informaltable"><table border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="DeeSharedModel.html#DeeSharedModel-begin-transaction" title="The “begin-transaction” signal">begin-transaction</a></td>
<td class="signal_flags">Run Last</td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="DeeSharedModel.html#DeeSharedModel-end-transaction" title="The “end-transaction” signal">end-transaction</a></td>
<td class="signal_flags">Run Last</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="DeeSharedModel.html#DEE-SHARED-MODEL-DBUS-IFACE:CAPS" title="DEE_SHARED_MODEL_DBUS_IFACE">DEE_SHARED_MODEL_DBUS_IFACE</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="DeeSharedModel.html#DeeSharedModel-struct" title="struct DeeSharedModel">DeeSharedModel</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="DeeSharedModel.html#DeeSharedModelAccessMode" title="enum DeeSharedModelAccessMode">DeeSharedModelAccessMode</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="DeeSharedModel.html#DeeSharedModelClass" title="struct DeeSharedModelClass">DeeSharedModelClass</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="DeeSharedModel.html#DeeSharedModelError" title="enum DeeSharedModelError">DeeSharedModelError</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> GEnum
<span class="lineart">╰──</span> DeeSharedModelAccessMode
GObject
<span class="lineart">╰──</span> <a class="link" href="DeeSerializableModel.html" title="DeeSerializableModel">DeeSerializableModel</a>
<span class="lineart">╰──</span> <a class="link" href="DeeProxyModel.html" title="DeeProxyModel">DeeProxyModel</a>
<span class="lineart">╰──</span> DeeSharedModel
</pre>
</div>
<div class="refsect1">
<a name="DeeSharedModel.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
DeeSharedModel implements
DeeModel and DeeSerializable.</p>
</div>
<div class="refsect1">
<a name="DeeSharedModel.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <dee.h>
</pre>
</div>
<div class="refsect1">
<a name="DeeSharedModel.description"></a><h2>Description</h2>
<p><a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> is created with a name (usually namespaced and unique to
your program(s)) which is used to locate other <a href="DeeSharedModel.html"><span class="type">DeeSharedModels</span></a> created
with the same name through D-Bus, and will keep synchronized with them.</p>
<p>This allows to you build MVC programs with a sane model API, but have the
controller (or multiple views) in a separate process.</p>
<p>Before you modify the contents of the shared model it is important that
you wait for the model to synchronize with its peers. The normal way to do
this is to wait for the "notify::synchronized" signal.</p>
</div>
<div class="refsect1">
<a name="DeeSharedModel.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="dee-shared-model-flush-revision-queue"></a><h3>dee_shared_model_flush_revision_queue ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
dee_shared_model_flush_revision_queue (<em class="parameter"><code><a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *self</code></em>);</pre>
<p>Expert: All changes to <em class="parameter"><code>self</code></em>
that has not yet been propagated to the peer
models are send. This will block the mainloop until all the underlying
transport streams has been flushed.</p>
<p>Normally <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> collects changes to <em class="parameter"><code>self</code></em>
into batches and sends
them automatically to all peers. You can use this call to provide fine
grained control of exactly when changes to <em class="parameter"><code>self</code></em>
are synchronized to its
peers. This may for example be useful to improve the interactivity of your
application if you have a model-process which intermix small and light
changes with big and expensive changes. Using this call you can make sure
the model-process dispatches small changes more aggresively to the
view-process, while holding on to the expensive changes a bit longer.</p>
<p><span class="emphasis"><em>Important</em></span>: This method <span class="emphasis"><em>may</em></span> flush
your internal queue of DBus messages forcing them to be send before this call
returns.</p>
<div class="refsect3">
<a name="id-1.3.8.11.2.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The shared model to flush the revision queue on</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.2.8"></a><h4>Returns</h4>
<p> The number of revisions flushed.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-get-peer"></a><h3>dee_shared_model_get_peer ()</h3>
<pre class="programlisting"><a class="link" href="DeePeer.html" title="DeePeer"><span class="returnvalue">DeePeer</span></a> *
dee_shared_model_get_peer (<em class="parameter"><code><a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *self</code></em>);</pre>
<p>Convenience function for accessing the <a class="link" href="DeeSharedModel.html#DeeSharedModel--peer" title="The “peer” property"><span class="type">“peer”</span></a> property</p>
<div class="refsect3">
<a name="id-1.3.8.11.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The model to get the <a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> for</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.3.6"></a><h4>Returns</h4>
<p> The <a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> used to interact with the peer models. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-get-swarm-name"></a><h3>dee_shared_model_get_swarm_name ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
dee_shared_model_get_swarm_name (<em class="parameter"><code><a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *self</code></em>);</pre>
<p>Convenience function for accessing the <a class="link" href="DeePeer.html#DeePeer--swarm-name" title="The “swarm-name” property"><span class="type">“swarm-name”</span></a> property of the
<a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> defined in the <a class="link" href="DeeSharedModel.html#DeeSharedModel--peer" title="The “peer” property"><span class="type">“peer”</span></a> property.</p>
<div class="refsect3">
<a name="id-1.3.8.11.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The model to get the name for</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.4.6"></a><h4>Returns</h4>
<p> The name of the swarm this model synchrnonizes with</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-is-leader"></a><h3>dee_shared_model_is_leader ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
dee_shared_model_is_leader (<em class="parameter"><code><a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *self</code></em>);</pre>
<p>Check if the model is the swarm leader. This is a convenience function for
accessing the <a class="link" href="DeeSharedModel.html#DeeSharedModel--peer" title="The “peer” property"><span class="type">“peer”</span></a> property and checking if it's the swarm
leader.</p>
<div class="refsect3">
<a name="id-1.3.8.11.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The model to inspect</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.5.6"></a><h4>Returns</h4>
<p> The value of <a class="link" href="DeePeer.html#dee-peer-is-swarm-leader" title="dee_peer_is_swarm_leader ()"><code class="function">dee_peer_is_swarm_leader()</code></a> for the <a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> used by
this shared model</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-is-synchronized"></a><h3>dee_shared_model_is_synchronized ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
dee_shared_model_is_synchronized (<em class="parameter"><code><a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *self</code></em>);</pre>
<p>Check if the model is synchronized with its peers. Before modifying a
shared model in any way (except <a class="link" href="dee-1.0-DeeModel.html#dee-model-set-schema" title="dee_model_set_schema ()"><code class="function">dee_model_set_schema()</code></a>) you should wait for
it to become synchronized. This is normally done by waiting for the
"notify::synchronized" signal.</p>
<p>This method is purely a convenience function for accessing the
<a class="link" href="DeeSharedModel.html#DeeSharedModel--synchronized" title="The “synchronized” property"><span class="type">“synchronized”</span></a> property.</p>
<div class="refsect3">
<a name="id-1.3.8.11.6.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The model to inspect</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.6.7"></a><h4>Returns</h4>
<p> The value of the :synchronized property</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-new"></a><h3>dee_shared_model_new ()</h3>
<pre class="programlisting"><span class="returnvalue">DeeModel</span> *
dee_shared_model_new (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
<p>Create a new empty shared model without any column schema associated.
The column schema will be set in one of two ways: firstly you may set it
manually with <a class="link" href="dee-1.0-DeeModel.html#dee-model-set-schema" title="dee_model_set_schema ()"><code class="function">dee_model_set_schema()</code></a> or secondly it will be set once
the first rows are exchanged with a peer model.</p>
<p>A <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> with a schema manually set has to be created before
creating more <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> with the same <em class="parameter"><code>name</code></em>
.</p>
<p>A shared model created with this constructor will store row data in a
suitably picked memory backed model.</p>
<div class="refsect3">
<a name="id-1.3.8.11.7.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>A well known name to publish this model under. Models sharing this name
will synchronize with each other</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.7.8"></a><h4>Returns</h4>
<p> a new <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> DeeSharedModel]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-new-for-peer"></a><h3>dee_shared_model_new_for_peer ()</h3>
<pre class="programlisting"><span class="returnvalue">DeeModel</span> *
dee_shared_model_new_for_peer (<em class="parameter"><code><a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> *peer</code></em>);</pre>
<p>Create a new empty shared model without any column schema associated.
The column schema will be set in one of two ways: firstly you may set it
manually with <a class="link" href="dee-1.0-DeeModel.html#dee-model-set-schema" title="dee_model_set_schema ()"><code class="function">dee_model_set_schema()</code></a> or secondly it will be set once
the first rows are exchanged with a peer model.</p>
<p>A <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> with a schema manually set has to be created before
creating more <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> with the same <em class="parameter"><code>name</code></em>
.</p>
<p>A shared model created with this constructor will store row data in a
suitably picked memory backed model.</p>
<div class="refsect3">
<a name="id-1.3.8.11.8.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>peer</p></td>
<td class="parameter_description"><p> A <a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> instance. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.8.8"></a><h4>Returns</h4>
<p> a new <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> DeeSharedModel]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="dee-shared-model-new-with-back-end"></a><h3>dee_shared_model_new_with_back_end ()</h3>
<pre class="programlisting"><span class="returnvalue">DeeModel</span> *
dee_shared_model_new_with_back_end (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
<em class="parameter"><code><span class="type">DeeModel</span> *back_end</code></em>);</pre>
<p>Create a new shared model storing all data in <em class="parameter"><code>back_end</code></em>
.</p>
<p>The model will start synchronizing with peer models as soon as possible and
the <a class="link" href="DeeSharedModel.html#DeeSharedModel--synchronized" title="The “synchronized” property"><span class="type">“synchronized”</span></a> property will be set once finished.</p>
<div class="refsect3">
<a name="id-1.3.8.11.9.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p> A well known name to publish this model under.
Models sharing this name will synchronize with each other. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>back_end</p></td>
<td class="parameter_description"><p> The <span class="type">DeeModel</span> that will actually store
the model data. Ownership of the ref to <em class="parameter"><code>back_end</code></em>
is transfered to
the shared model. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.8.11.9.7"></a><h4>Returns</h4>
<p> a new <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> DeeSharedModel]</span></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="DEE-SHARED-MODEL-DBUS-IFACE:CAPS"></a><h3>DEE_SHARED_MODEL_DBUS_IFACE</h3>
<pre class="programlisting">#define DEE_SHARED_MODEL_DBUS_IFACE "com.canonical.Dee.Model"
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModel-struct"></a><h3>struct DeeSharedModel</h3>
<pre class="programlisting">struct DeeSharedModel;</pre>
<p>All fields in the DeeSharedModel structure are private and should never be
accessed directly</p>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModelAccessMode"></a><h3>enum DeeSharedModelAccessMode</h3>
<p>Enumeration defining behavior of the model with regards to writes from
other peers in the swarm.</p>
<div class="refsect3">
<a name="id-1.3.8.12.4.4"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="DEE-SHARED-MODEL-ACCESS-MODE-WORLD-WRITABLE:CAPS"></a>DEE_SHARED_MODEL_ACCESS_MODE_WORLD_WRITABLE</p></td>
<td class="enum_member_description"> </td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="DEE-SHARED-MODEL-ACCESS-MODE-LEADER-WRITABLE:CAPS"></a>DEE_SHARED_MODEL_ACCESS_MODE_LEADER_WRITABLE</p></td>
<td class="enum_member_description"> </td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModelClass"></a><h3>struct DeeSharedModelClass</h3>
<pre class="programlisting">struct DeeSharedModelClass {
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModelError"></a><h3>enum DeeSharedModelError</h3>
<p>
</p>
<div class="refsect3">
<a name="id-1.3.8.12.6.4"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody><tr>
<td class="enum_member_name"><p><a name="DEE-SHARED-MODEL-ERROR-LEADER-INVALIDATED:CAPS"></a>DEE_SHARED_MODEL_ERROR_LEADER_INVALIDATED</p></td>
<td class="enum_member_description"> </td>
<td class="enum_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="DeeSharedModel--access-mode"></a><h3>The <code class="literal">“access-mode”</code> property</h3>
<pre class="programlisting"> “access-mode” <a class="link" href="DeeSharedModel.html#DeeSharedModelAccessMode" title="enum DeeSharedModelAccessMode"><span class="type">DeeSharedModelAccessMode</span></a></pre>
<p>Enumeration defining behavior of this model when trying to write to it.</p>
<p>Setting this to <a class="link" href="DeeSharedModel.html#DEE-SHARED-MODEL-ACCESS-MODE-LEADER-WRITABLE:CAPS"><span class="type">DEE_SHARED_MODEL_ACCESS_MODE_LEADER_WRITABLE</span></a> is useful
when one process is considered an "owner" of a model and all the other
peers are supposed to only synchronize it for reading.</p>
<p>See also DeePeer:swarm-owner property to ensure ownership of a swarm.</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: DEE_SHARED_MODEL_ACCESS_MODE_WORLD_WRITABLE</p>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModel--peer"></a><h3>The <code class="literal">“peer”</code> property</h3>
<pre class="programlisting"> “peer” <a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> *</pre>
<p>The <a class="link" href="DeePeer.html" title="DeePeer"><span class="type">DeePeer</span></a> that this model uses to connect to the swarm</p>
<p>Flags: Read / Write / Construct Only</p>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModel--synchronized"></a><h3>The <code class="literal">“synchronized”</code> property</h3>
<pre class="programlisting"> “synchronized” <span class="type">gboolean</span></pre>
<p>Boolean property defining whether or not the model has synchronized with
its peers (if any) yet.</p>
<p>You should not modify a <a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> that is not synchronized. Before
modifying the model in any way (except calling <a class="link" href="dee-1.0-DeeModel.html#dee-model-set-schema" title="dee_model_set_schema ()"><code class="function">dee_model_set_schema()</code></a>)
you should wait for it to become synchronized.</p>
<p>Flags: Read</p>
<p>Default value: FALSE</p>
</div>
</div>
<div class="refsect1">
<a name="DeeSharedModel.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="DeeSharedModel-begin-transaction"></a><h3>The <code class="literal">“begin-transaction”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *model,
<span class="type">guint64</span> begin_seqnum,
<span class="type">guint64</span> end_seqnum,
<span class="type">gpointer</span> user_data)</pre>
<p>Emitted right before a remote transaction will be committed to the model.</p>
<div class="refsect3">
<a name="id-1.3.8.14.2.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>The shared model the signal is emitted on</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>begin_seqnum</p></td>
<td class="parameter_description"><p>The seqnum the model has now</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end_seqnum</p></td>
<td class="parameter_description"><p>The seqnum the model will have after the transaction is applied</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run Last</p>
</div>
<hr>
<div class="refsect2">
<a name="DeeSharedModel-end-transaction"></a><h3>The <code class="literal">“end-transaction”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="DeeSharedModel.html" title="DeeSharedModel"><span class="type">DeeSharedModel</span></a> *model,
<span class="type">guint64</span> begin_seqnum,
<span class="type">guint64</span> end_seqnum,
<span class="type">gpointer</span> user_data)</pre>
<p>Emitted right after a remote transaction has been committed to the model.</p>
<div class="refsect3">
<a name="id-1.3.8.14.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>The shared model the signal is emitted on</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>begin_seqnum</p></td>
<td class="parameter_description"><p>The seqnum the model had before the transaction was applied</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end_seqnum</p></td>
<td class="parameter_description"><p>The seqnum the model has now</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run Last</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>
|