Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 5b6c31d6428e1f6ea754ea6f7b1aed6e > files > 173

soprano-apidocs-2.6.0-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Soprano: Soprano::NodeIterator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Soprano&#160;<span id="projectnumber">2.6.0</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceSoprano.html">Soprano</a>      </li>
      <li class="navelem"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<h1>Soprano::NodeIterator Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Soprano::NodeIterator" --><!-- doxytag: inherits="Iterator&lt; Node &gt;" -->
<p>An iterator that provides a stream of Nodes.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="nodeiterator_8h_source.html">Soprano/NodeIterator</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png"/> Inheritance diagram for Soprano::NodeIterator:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classSoprano_1_1NodeIterator__inherit__graph.png" border="0" usemap="#Soprano_1_1NodeIterator_inherit__map" alt="Inheritance graph"/></div>
<map name="Soprano_1_1NodeIterator_inherit__map" id="Soprano_1_1NodeIterator_inherit__map">
<area shape="rect" id="node10" href="classSoprano_1_1Client_1_1DBusNodeIterator.html" title="Interface to a DBus server node iterator." alt="" coords="5,341,229,371"/><area shape="rect" id="node12" href="classSoprano_1_1Util_1_1SimpleNodeIterator.html" title="The most simple version of a NodeIterator simply iterates over a list of Nodes." alt="" coords="253,341,472,371"/><area shape="rect" id="node2" href="classSoprano_1_1Iterator.html" title="Soprano::Iterator\&lt; Node \&gt;" alt="" coords="153,181,327,211"/><area shape="rect" id="node4" href="classSoprano_1_1Error_1_1ErrorCache.html" title="Core class of Soprano&#39;s exception system." alt="" coords="165,5,344,35"/><area shape="rect" id="node6" href="classSoprano_1_1Iterator.html" title="The basic Soprano iterator class." alt="" coords="256,85,405,115"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classSoprano_1_1NodeIterator-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1NodeIterator.html#a83b12ad7cbe1e7e2d6f85c4fbb554d5f">NodeIterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1NodeIterator.html#a298ebc8d1da10c0dd3bbcde043aaba9d">NodeIterator</a> (<a class="el" href="classSoprano_1_1IteratorBackend.html">IteratorBackend</a>&lt; <a class="el" href="classSoprano_1_1Node.html">Node</a> &gt; *sti)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1NodeIterator.html#ab6242979622354759749cb53278be782">NodeIterator</a> (const <a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> &amp;sti)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1NodeIterator.html#a5263133e88ffcaacb6b7d9a07b265c49">~NodeIterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1NodeIterator.html#afe6a0379e6b49f7bd64c1da36bc263e9">operator=</a> (const <a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="qlist.html">QList</a>&lt; <a class="el" href="classSoprano_1_1Node.html">Node</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1NodeIterator.html#a6e818ac1defe963a3a73a4413273a369">allNodes</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An iterator that provides a stream of Nodes. </p>
<p>The most common use of NodeIterator is through <a class="el" href="classSoprano_1_1Model.html#ad530cc7d159fdb0d05f66902b9594020">Model::listContexts()</a>.</p>
<p>Many backends do lock the underlying <a class="el" href="classSoprano_1_1Model.html" title="A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.">Model</a> during iteration. Thus, it is always a good idea to cache the results if they are to be used to modify the model to prevent a deadlock:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classSoprano_1_1NodeIterator.html" title="An iterator that provides a stream of Nodes.">Soprano::NodeIterator</a> it = model-&gt;<a class="code" href="classSoprano_1_1Model.html#ad530cc7d159fdb0d05f66902b9594020">listContexts</a>();
 <a class="codeRef" href="qlist.html">QList&lt;Node&gt;</a> <a class="code" href="classSoprano_1_1NodeIterator.html#a6e818ac1defe963a3a73a4413273a369">allNodes</a> = it.<a class="code" href="classSoprano_1_1Iterator.html#ab8f53c8b02072c3e688ee62e5f318b46">allElements</a>();
 Q_FOREACH( <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Soprano::Node</a> n, allNodes ) {
    modifyTheModel( model, n );
 }
</pre></div><p>Iterators have to be closed. This can either be achieved by deleting the iterator, finishing it (<a class="el" href="classSoprano_1_1Iterator.html#a1ba632f6f015242ab9441da77d48415b">next()</a> does return <code>false</code>), or calling <a class="el" href="classSoprano_1_1Iterator.html#a623fb6440a6cfadbb560bd7738c01871">close()</a>. Before that other operations on the <a class="el" href="classSoprano_1_1Model.html" title="A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.">Model</a> may block.</p>
<p>Iterators are not thread-safe. Two threads using the same iterator may result in undefined behaviour and even crashes. An iterator needs to be closed by the same thread that opened it (except if the iterator contains special code to handle such a situation.)</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>Be aware that iterators in <a class="el" href="namespaceSoprano.html">Soprano</a> are shared objects which means that copies of one iterator object work on the same data.</dd></dl>
<p>For further details on Soprano iterators see <a class="el" href="classSoprano_1_1Iterator.html" title="The basic Soprano iterator class.">Iterator</a>.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Sebastian Trueg &lt;<a href="mailto:trueg@kde.org">trueg@kde.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="nodeiterator_8h_source.html#l00073">73</a> of file <a class="el" href="nodeiterator_8h_source.html">nodeiterator.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a83b12ad7cbe1e7e2d6f85c4fbb554d5f"></a><!-- doxytag: member="Soprano::NodeIterator::NodeIterator" ref="a83b12ad7cbe1e7e2d6f85c4fbb554d5f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Soprano::NodeIterator::NodeIterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates and empty, invalid iterator. </p>

</div>
</div>
<a class="anchor" id="a298ebc8d1da10c0dd3bbcde043aaba9d"></a><!-- doxytag: member="Soprano::NodeIterator::NodeIterator" ref="a298ebc8d1da10c0dd3bbcde043aaba9d" args="(IteratorBackend&lt; Node &gt; *sti)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Soprano::NodeIterator::NodeIterator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classSoprano_1_1IteratorBackend.html">IteratorBackend</a>&lt; <a class="el" href="classSoprano_1_1Node.html">Node</a> &gt; *&#160;</td>
          <td class="paramname"><em>sti</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Create a new <a class="el" href="classSoprano_1_1NodeIterator.html" title="An iterator that provides a stream of Nodes.">NodeIterator</a> instance that uses sti as backend. <a class="el" href="classSoprano_1_1NodeIterator.html" title="An iterator that provides a stream of Nodes.">NodeIterator</a> will take ownership of the backend. </p>

</div>
</div>
<a class="anchor" id="ab6242979622354759749cb53278be782"></a><!-- doxytag: member="Soprano::NodeIterator::NodeIterator" ref="ab6242979622354759749cb53278be782" args="(const NodeIterator &amp;sti)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Soprano::NodeIterator::NodeIterator </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> &amp;&#160;</td>
          <td class="paramname"><em>sti</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a5263133e88ffcaacb6b7d9a07b265c49"></a><!-- doxytag: member="Soprano::NodeIterator::~NodeIterator" ref="a5263133e88ffcaacb6b7d9a07b265c49" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual Soprano::NodeIterator::~NodeIterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="afe6a0379e6b49f7bd64c1da36bc263e9"></a><!-- doxytag: member="Soprano::NodeIterator::operator=" ref="afe6a0379e6b49f7bd64c1da36bc263e9" args="(const NodeIterator &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a>&amp; Soprano::NodeIterator::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classSoprano_1_1NodeIterator.html">NodeIterator</a> &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a6e818ac1defe963a3a73a4413273a369"></a><!-- doxytag: member="Soprano::NodeIterator::allNodes" ref="a6e818ac1defe963a3a73a4413273a369" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" href="qlist.html">QList</a>&lt;<a class="el" href="classSoprano_1_1Node.html">Node</a>&gt; Soprano::NodeIterator::allNodes </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Convenience method which extracts all nodes (this does not include the nodes that have already been read from the iterator) from the iterator and returns them in a list.</p>
<p>Be aware that after calling this method the iterator will be invalid.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A list of all nodes that rest in the iterator. </dd></dl>

<p>Definition at line <a class="el" href="nodeiterator_8h_source.html#l00102">102</a> of file <a class="el" href="nodeiterator_8h_source.html">nodeiterator.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/builddir/build/BUILD/soprano-2.6.0/soprano/<a class="el" href="nodeiterator_8h_source.html">nodeiterator.h</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Mar 11 2011 for Soprano by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>