⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delete_iterator.htm

📁 The goal of this library is to make ODBC recordsets look just like an STL container. As a user, you
💻 HTM
📖 第 1 页 / 共 2 页
字号:
	<< " rows deleted!" << endl;

	<span class="codeComment">// now can perform other deletes using the same deleter object
	// make sure to put in your new values for the parameters
	// for the delete

	// now set the parameters indicating which rows we want to delete</span>

	TIMESTAMP_STRUCT today = {1999, 9, 29, 0, 0, 0, 0};
	*exampleDeleter = Example(3, &quot;operator-&gt;()works&quot;, 0.0, 0, today);

	<span class="codeComment">// execute the delete</span>
	exampleDeleter++;

	cout &lt;&lt; exampleDeleter.GetLastCount()
	     &lt;&lt; &quot; rows deleted!&quot; &lt;&lt; endl;
}
</code></pre>
 </p>

<h3>Template parameters</h3>

<table border="2">
    <tr>
        <th>Parameter </th>
        <th>Description </th>
        <th>Default </th>
    </tr>
    <tr>
        <td valign="top"><tt>DataObj</tt> </td>
        <td valign="top">The type of object that will be updated
        in the <font size="2" face="Courier New">DBView</font>.
        This object will be bound through use of the <a
        href="BCA.htm"><font size="1" face="Courier New">BCA</font></a><font
        size="2"> </font>to the appropriate columns in the
        database. The set of value types of an <tt>DBView::update_iterator</tt>
        consists of a single type, <font size="2"
        face="Courier New">DataObj</font>. </td>
        <td valign="top">&nbsp; </td>
    </tr>
    <tr>
        <td valign="top"><tt>ParamObj</tt> </td>
        <td valign="top">The type of object that will be used to
        specify the postfix parameters to the <font size="2"
        face="Courier New">DBView</font>.</td>
        <td valign="top"><font size="2" face="Courier New">DefaultParamObj&lt;DataObj&gt;</font>&nbsp;
        </td>
    </tr>
</table>

<h3>Model of</h3>

<p><a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
Iterator</a>. </p>

<h3>Type requirements</h3>

<p><font size="2" face="Courier New">DataObj </font>and <font
size="2" face="Courier New">ParamObj</font> must each fulfill the
following requirements:. </p>

<ul>
    <li>Be of a type that is not primitive or of type <font
        size="2" face="Courier New">string</font><font size="2">.</font></li>
    <li><font size="3">Have a publicly accessible copy
        constructor (the default is OK).</font></li>
    <li><font size="3">Have a publicly accessible assignment
        operator (the default is OK).</font></li>
</ul>

<h3>Public base classes</h3>

<p><font size="2" face="Courier New">DB_iterator&lt;DataObj,
ParamObj&gt;, iterator&lt;output_iterator_tag, DataObj&gt;</font></p>

<h3>Members</h3>

<table border="2">
    <tr>
        <th>Member </th>
        <th>Where defined </th>
        <th>Description </th>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator()</tt> </td>
        <td valign="top"><tt>delete_iterator</tt> </td>
        <td valign="top"><font size="3">Default constructor.</font></td>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator(DBView&lt;DataObj,
        ParamObj&gt; &amp;view)</tt> </td>
        <td valign="top"><tt>delete_iterator</tt> </td>
        <td valign="top"><font size="3">See below.</font></td>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator(const DBView::delete_iterator&amp;)</tt>
        </td>
        <td valign="top"><a
        href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
        Iterator</a> </td>
        <td valign="top">The copy constructor </td>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator&amp;
        operator=(const DBView delete_iterator&amp;)</tt> </td>
        <td valign="top"><a
        href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
        Iterator</a> </td>
        <td valign="top">The assignment operator </td>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator&amp;
        operator*(), DBView::delete_iterator&amp; operator=(const
        DataObj &amp;data)</tt></td>
        <td valign="top"><a
        href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
        Iterator</a> </td>
        <td valign="top">Proxy operators necessary to emulate <font
        size="2" face="Courier New">*it = data.</font> Return <font
        size="2" face="Courier New">*this</font><font size="3">.</font></td>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator&amp;
        operator++()</tt> </td>
        <td valign="top"><a
        href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
        Iterator</a> </td>
        <td valign="top">Preincrement. Deletes all <font size="2"
        face="Courier New">DataObj's </font>matching the
        parameters specified by the <font size="2"
        face="Courier New">DataObj </font><font size="3">referenced
        by the </font>iterator (and meeting the postfix clause)<font
        size="2" face="Courier New">. </font><font size="3">See
        Note </font><a href="#1"><font size="3">[1]</font></a><font
        size="3">.</font></td>
    </tr>
    <tr>
        <td valign="top"><tt>const DBView::delete_iterator
        operator++(int)</tt> </td>
        <td valign="top"><a
        href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
        Iterator</a> </td>
        <td valign="top">Preincrement. Deletes all <font size="2"
        face="Courier New">DataObj's </font>matching the
        parameters specified by the <font size="2"
        face="Courier New">DataObj </font><font size="3">referenced
        by the </font>iterator (and meeting the postfix clause)<font
        size="2" face="Courier New">. </font><font size="3">See
        Note </font><a href="#1"><font size="3">[1]</font></a><font
        size="3">.</font></td>
    </tr>
    <tr>
        <td valign="top"><tt>void swap(DBView::delete_iterator
        &amp;other)</tt></td>
        <td valign="top"><font size="2" face="Courier New">DBView::delete_iterator</font>
        </td>
        <td valign="top">See below.</td>
    </tr>
</table>

<h3>New members</h3>

<p>These members are not defined in the <a
href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
Iterator</a> requirements or in <font size="2" face="Courier New">DB_iterator&lt;DataObj,
ParamObj&gt;</font>, but are specific to <tt>DBView::delete_iterator</tt>.
</p>

<table border="2">
    <tr>
        <th>Function </th>
        <th>Description </th>
    </tr>
    <tr>
        <td valign="top"><tt>DBView::delete_iterator(DBView&lt;DataObj,
        ParamObj&gt; &amp;view)</tt> </td>
        <td valign="top">Creates an <font size="2"
        face="Courier New">delete_iterator </font>which refers to <font size="2"
        face="Courier New">view.</td>
    </tr>
    <tr>
        <td valign="top"><tt>void swap(DBView::delete_iterator
        &amp;other)</tt></td>
        <td valign="top">Swap <font size="2" face="Courier New">*this</font>
        with <font size="2">other</font>.</td>
    </tr>
</table>

<h3>Notes</h3>

<p><a name="1"></a>[1] <font size="2" face="Courier New">operator++()</font>
is the operation that actually applies the delete <font size="3">to
the database via the </font><font size="2" face="Courier New">DBView</font><font
size="3">. Each </font><font size="2" face="Courier New">DBView::delete_iterator</font><font
size="1" face="Courier New"> </font><font size="3">internally
owns a </font><font size="2" face="Courier New">DBStmt</font><font
size="3"> object which is allocated and prepared when the
underlying ODBC statement handle is first needed and not before.
The handle is not opened until absolutely needed in order to make
copying and assigning these iterators an inexpensive operation.
The </font><font size="2" face="Courier New">DBStmt</font><font
size="3"> is executed once on each call to </font><font size="2"
face="Courier New">operator++()</font><font size="3">, whether
the prefix or postfix version.</font></p>

<h3>See also</h3>

<p><a href="db_iterator.htm"><font size="2" face="Courier New">DB_iterator</font></a>,
<a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output
Iterator</a>, <a
href="http://www.sgi.com/tech/stl/InputIterator.html">Input
Iterator</a>.<br>
<br>
</p>


<hr>

<p><a href="index.htm"><img src="dtl_home.gif" alt="[DTL Home]"
width="54" height="54"></a> <br>
</p>

<p>Copyright 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -