Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 1220

wt-doc-3.2.3-1.fc18.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>Wt: Wt::Dbo::collection&lt; C &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <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="modules.html"><span>Modules</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>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </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="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="namespaceWt.html">Wt</a>      </li>
      <li class="navelem"><a class="el" href="namespaceWt_1_1Dbo.html">Dbo</a>      </li>
      <li class="navelem"><a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wt::Dbo::collection&lt; C &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__dbo.html">Database Objects (Wt::Dbo)</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Wt::Dbo::collection" -->
<p>An STL container for iterating query results.  
 <a href="classWt_1_1Dbo_1_1collection.html#details">More...</a></p>

<p><code>#include &lt;Wt/Dbo/collection&gt;</code></p>

<p><a href="classWt_1_1Dbo_1_1collection-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection_1_1const__iterator.html">const_iterator</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Const Iterator.  <a href="classWt_1_1Dbo_1_1collection_1_1const__iterator.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection_1_1iterator.html">iterator</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator.  <a href="classWt_1_1Dbo_1_1collection_1_1iterator.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a49af50adc6d43f473f2bb45e57a77e0d"></a><!-- doxytag: member="Wt::Dbo::collection::value_type" ref="a49af50adc6d43f473f2bb45e57a77e0d" args="" -->
typedef C&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a49af50adc6d43f473f2bb45e57a77e0d">value_type</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value type. <br/></td></tr>
<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="classWt_1_1Dbo_1_1collection.html#affe4c75e050ce2a5980a10498bc5fccb">collection</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#affe4c75e050ce2a5980a10498bc5fccb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd01cbfac7573fafa8cc69bf58cd8cd4"></a><!-- doxytag: member="Wt::Dbo::collection::~collection" ref="abd01cbfac7573fafa8cc69bf58cd8cd4" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#abd01cbfac7573fafa8cc69bf58cd8cd4">~collection</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Dbo_1_1collection_1_1iterator.html">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a34580ef0194da3b8366182fbbc3b4c49">begin</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an iterator to the begin of the collection.  <a href="#a34580ef0194da3b8366182fbbc3b4c49"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Dbo_1_1collection_1_1iterator.html">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a4a6f1178ce470936900f269a9ccf97de">end</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an iterator to the end of the collection.  <a href="#a4a6f1178ce470936900f269a9ccf97de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Dbo_1_1collection_1_1const__iterator.html">const_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#afa7065c73dfcc8df48a89b0f7d98395e">begin</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a const iterator to the begin of the collection.  <a href="#afa7065c73dfcc8df48a89b0f7d98395e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Dbo_1_1collection_1_1const__iterator.html">const_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a4fff6804cb98618a4709e4e7e84a13d6">end</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a const iterator to the end of the collection.  <a href="#a4fff6804cb98618a4709e4e7e84a13d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">C&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a54a00d06b49587edebccd27ffb7c6b37">front</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a reference to the first object.  <a href="#a54a00d06b49587edebccd27ffb7c6b37"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a82fd36791d677487a1c2986de0b72150">size</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size.  <a href="#a82fd36791d677487a1c2986de0b72150"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a7b497add0d6ac2b1e098820f9ee64c93">insert</a> (C c)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts an object.  <a href="#a7b497add0d6ac2b1e098820f9ee64c93"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a35d046e991b3fec59af85d501fd49e51">erase</a> (C c)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an object.  <a href="#a35d046e991b3fec59af85d501fd49e51"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#af153d38d1b3ce7c0dcb6ad68d52e8e9b">clear</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the collection.  <a href="#af153d38d1b3ce7c0dcb6ad68d52e8e9b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#af7e338710e144b7e8d6a8d33e9fdca1e">count</a> (C c) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the whether the collection contains an object.  <a href="#af7e338710e144b7e8d6a8d33e9fdca1e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aedac567b3edd05532d53de7c0b1d7366"></a><!-- doxytag: member="Wt::Dbo::collection::session" ref="aedac567b3edd05532d53de7c0b1d7366" args="() const " -->
<a class="el" href="classWt_1_1Dbo_1_1Session.html">Session</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#aedac567b3edd05532d53de7c0b1d7366">session</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the session to which this collection is bound. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Dbo_1_1Query.html">Query</a>&lt; C, <a class="el" href="structWt_1_1Dbo_1_1DynamicBinding.html">DynamicBinding</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html#a6b8aa118fad63539958ea8532ae37d68">find</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the query that backs the collection.  <a href="#a6b8aa118fad63539958ea8532ae37d68"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;class C&gt;<br/>
class Wt::Dbo::collection&lt; C &gt;</h3>

<p>An STL container for iterating query results. </p>
<p>This is an STL-compatible container that is backed by an SQL query for fetching data.</p>
<p>A collection has two uses in <a class="el" href="namespaceWt_1_1Dbo.html" title="Namespace for the Database Objects (Wt::Dbo).">Wt::Dbo</a>:</p>
<ul>
<li>to iterate the results of a <a class="el" href="classWt_1_1Dbo_1_1Query.html" title="A database query.">Query</a>;</li>
<li>to map the many-side of a Many-to-One or Many-to-Many relation.</li>
</ul>
<p>Its iterators implement the InputIterator requirements, meaning you have to traverse the results from <a class="el" href="classWt_1_1Dbo_1_1collection.html#a34580ef0194da3b8366182fbbc3b4c49" title="Returns an iterator to the begin of the collection.">begin()</a> to <a class="el" href="classWt_1_1Dbo_1_1collection.html#a4a6f1178ce470936900f269a9ccf97de" title="Returns an iterator to the end of the collection.">end()</a> solely by alternating between reading an element and incrementing the iterator. When the collection represents the results of a <a class="el" href="classWt_1_1Dbo_1_1Query.html" title="A database query.">Query</a>, you can only iterate the results just once: i.e. you can have only one <a class="el" href="classWt_1_1Dbo_1_1collection.html#a34580ef0194da3b8366182fbbc3b4c49" title="Returns an iterator to the begin of the collection.">begin()</a> call.</p>
<p>The container is read only when it reflects results of a query. Otherwise, when involved in a Many-to-One or Many-to-Many relation, you may also <a class="el" href="classWt_1_1Dbo_1_1collection.html#a7b497add0d6ac2b1e098820f9ee64c93" title="Inserts an object.">insert()</a> and <a class="el" href="classWt_1_1Dbo_1_1collection.html#a35d046e991b3fec59af85d501fd49e51" title="Removes an object.">erase()</a> objects in it.</p>
<p>You will typically iterate the container results for local processing, or copy the results into a standard STL container for extended processing. Not only the weak guarantees of the iterators make this recommended, but also in the current implementation of the library, all sql statements are non-reentrant prepared statements (this limitation is likely to be removed in the future): only one collection, which is backed by the same SQL statement may be used at once per session. Thus, the following will fail:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> iterateChildren(<a class="code" href="classWt_1_1Dbo_1_1ptr.html" title="A smart pointer for a database object.">Wt::Dbo::ptr&lt;Comment&gt;</a> comment)
 {
     <span class="keyword">typedef</span> <a class="code" href="classWt_1_1Dbo_1_1collection.html" title="An STL container for iterating query results.">Wt::Dbo::collection&lt;Wt::Dbo::ptr&lt;Comment&gt;</a> &gt; Comments;
     Comments children = comment-&gt;children;

     <span class="keywordflow">for</span> (Comments::const_iterator i = children.begin(); i != children.end(); ++i) {
        std::cerr &lt;&lt; <span class="stringliteral">&quot;Comment: &quot;</span> &lt;&lt; i-&gt;text &lt;&lt; std::endl;
        iterateChildren(*i); <span class="comment">// Illegal since will result in nested use of the same query.</span>
     }
 }
</pre></div><p>If you cannot gaurantee that during its iteration the same query will be reused, you should copy the results in a standard container. Note that this is no big overhead since dbo pointers are lightweight.</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> iterateChildren(<a class="code" href="classWt_1_1Dbo_1_1ptr.html" title="A smart pointer for a database object.">Wt::Dbo::ptr&lt;Comment&gt;</a> comment)
 {
     <span class="keyword">typedef</span> std::vector&lt;Wt::Dbo::ptr&lt;Comment&gt; &gt; Comments;

     Comments children(comment-&gt;children.begin(), comment-&gt;children.end()); <span class="comment">// copy into an STL container, freeing the underlying query for reuse </span>

     <span class="keywordflow">for</span> (Comments::const_iterator i = children.begin(); i != children.end(); ++i) {
        std::cerr &lt;&lt; <span class="stringliteral">&quot;Comment: &quot;</span> &lt;&lt; i-&gt;text &lt;&lt; std::endl;
        iterateChildren(*i); <span class="comment">// Okay now.</span>
     }
 }
</pre></div><p>Before iterating a collection, the session is flushed. In this way, the collection will reflect any pending dirty changes. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="affe4c75e050ce2a5980a10498bc5fccb"></a><!-- doxytag: member="Wt::Dbo::collection::collection" ref="affe4c75e050ce2a5980a10498bc5fccb" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::<a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constructor. </p>
<p>Constructs an empty collection that is not bound to a database session or query. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a34580ef0194da3b8366182fbbc3b4c49"></a><!-- doxytag: member="Wt::Dbo::collection::begin" ref="a34580ef0194da3b8366182fbbc3b4c49" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a>&lt; C &gt;::<a class="el" href="classWt_1_1Dbo_1_1collection_1_1iterator.html">iterator</a> <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::begin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns an iterator to the begin of the collection. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a4a6f1178ce470936900f269a9ccf97de" title="Returns an iterator to the end of the collection.">end()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="afa7065c73dfcc8df48a89b0f7d98395e"></a><!-- doxytag: member="Wt::Dbo::collection::begin" ref="afa7065c73dfcc8df48a89b0f7d98395e" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a>&lt; C &gt;::<a class="el" href="classWt_1_1Dbo_1_1collection_1_1const__iterator.html">const_iterator</a> <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::begin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a const iterator to the begin of the collection. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a4a6f1178ce470936900f269a9ccf97de" title="Returns an iterator to the end of the collection.">end()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af153d38d1b3ce7c0dcb6ad68d52e8e9b"></a><!-- doxytag: member="Wt::Dbo::collection::clear" ref="af153d38d1b3ce7c0dcb6ad68d52e8e9b" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Clears the collection. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>This is only implemented for collections that are involved in a ManyToOne or ManyToMany relation, and not for collections that are used to iterated the result of a query.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a35d046e991b3fec59af85d501fd49e51" title="Removes an object.">erase()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af7e338710e144b7e8d6a8d33e9fdca1e"></a><!-- doxytag: member="Wt::Dbo::collection::count" ref="af7e338710e144b7e8d6a8d33e9fdca1e" args="(C c) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::count </td>
          <td>(</td>
          <td class="paramtype">C&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the whether the collection contains an object. </p>
<p>This creates a suitable query that checks whether the collection contains ptr&lt;X&gt; objects (without getting the entire collection from the database). The returned value is the number of times the collection contains the object (0 or 1).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a6b8aa118fad63539958ea8532ae37d68" title="Returns the query that backs the collection.">find()</a></dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>This is (currently) only implemented for collections that are involved in a ManyToOne or ManyToMany relation, and not for collections that are used to iterate the result of a query. </dd></dl>

</div>
</div>
<a class="anchor" id="a4a6f1178ce470936900f269a9ccf97de"></a><!-- doxytag: member="Wt::Dbo::collection::end" ref="a4a6f1178ce470936900f269a9ccf97de" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a>&lt; C &gt;::<a class="el" href="classWt_1_1Dbo_1_1collection_1_1iterator.html">iterator</a> <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::end </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns an iterator to the end of the collection. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a34580ef0194da3b8366182fbbc3b4c49" title="Returns an iterator to the begin of the collection.">begin()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a4fff6804cb98618a4709e4e7e84a13d6"></a><!-- doxytag: member="Wt::Dbo::collection::end" ref="a4fff6804cb98618a4709e4e7e84a13d6" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a>&lt; C &gt;::<a class="el" href="classWt_1_1Dbo_1_1collection_1_1const__iterator.html">const_iterator</a> <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::end </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a const iterator to the end of the collection. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a34580ef0194da3b8366182fbbc3b4c49" title="Returns an iterator to the begin of the collection.">begin()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a35d046e991b3fec59af85d501fd49e51"></a><!-- doxytag: member="Wt::Dbo::collection::erase" ref="a35d046e991b3fec59af85d501fd49e51" args="(C c)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::erase </td>
          <td>(</td>
          <td class="paramtype">C&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes an object. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>This is only implemented for collections that are involved in a ManyToOne or ManyToMany relation, and not for collections that are used to iterated the result of a query.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a7b497add0d6ac2b1e098820f9ee64c93" title="Inserts an object.">insert()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a6b8aa118fad63539958ea8532ae37d68"></a><!-- doxytag: member="Wt::Dbo::collection::find" ref="a6b8aa118fad63539958ea8532ae37d68" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1Query.html">Query</a>&lt; C, <a class="el" href="structWt_1_1Dbo_1_1DynamicBinding.html">DynamicBinding</a> &gt; <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::find </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the query that backs the collection. </p>
<p>Returns the query that backs the collection. This can be used to search for a subset or to browse the results in a particular order.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#af7e338710e144b7e8d6a8d33e9fdca1e" title="Returns the whether the collection contains an object.">count()</a></dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>This is (currently) only implemented for collections that are involved in a ManyToOne or ManyToMany relation, and not for collections that are used to iterate the result of a query. </dd></dl>

</div>
</div>
<a class="anchor" id="a54a00d06b49587edebccd27ffb7c6b37"></a><!-- doxytag: member="Wt::Dbo::collection::front" ref="a54a00d06b49587edebccd27ffb7c6b37" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">C <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::front </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a reference to the first object. </p>
<p>This is equivalent to: </p>
<div class="fragment"><pre class="fragment"> *(<a class="code" href="classWt_1_1Dbo_1_1collection.html#affe4c75e050ce2a5980a10498bc5fccb" title="Default constructor.">collection</a>.begin())
</pre></div> 
</div>
</div>
<a class="anchor" id="a7b497add0d6ac2b1e098820f9ee64c93"></a><!-- doxytag: member="Wt::Dbo::collection::insert" ref="a7b497add0d6ac2b1e098820f9ee64c93" args="(C c)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::insert </td>
          <td>(</td>
          <td class="paramtype">C&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Inserts an object. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>This is only implemented for collections that are involved in a ManyToOne or ManyToMany relation, and not for collections that are used to iterated the result of a query.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1collection.html#a35d046e991b3fec59af85d501fd49e51" title="Removes an object.">erase()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a82fd36791d677487a1c2986de0b72150"></a><!-- doxytag: member="Wt::Dbo::collection::size" ref="a82fd36791d677487a1c2986de0b72150" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class C &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Dbo_1_1collection.html">collection</a>&lt; C &gt;::size_type <a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection</a>&lt; C &gt;::size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the size. </p>
<p>This will execute an SQL <code>count(*)</code> statement to fetch the size of the collection without fetching all results.</p>
<p>If the collection represents the result of a <a class="el" href="classWt_1_1Dbo_1_1Query.html" title="A database query.">Query</a>, the underlying query is run only once, and its result is cached so that <a class="el" href="classWt_1_1Dbo_1_1collection.html#a82fd36791d677487a1c2986de0b72150" title="Returns the size.">size()</a> always returns the same value. </p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>