| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>DbMultipleRecnoDataBuilder</title> |
| 7 | <link rel="stylesheet" href="apiReference.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> |
| 10 | <link rel="up" href="dbt.html" title="Chapter 4. The Dbt Handle" /> |
| 11 | <link rel="prev" href="dbmultiplekeydatabuilder.html" title="DbMultipleKeyDataBuilder" /> |
| 12 | <link rel="next" href="env.html" title="Chapter 5. The DbEnv Handle" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">DbMultipleRecnoDataBuilder</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbmultiplekeydatabuilder.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 4. |
| 26 | The Dbt Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="env.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="dbmultiplerecnodatabuilder"></a>DbMultipleRecnoDataBuilder</h2></div></div></div><pre class="programlisting">#include <db_cxx.h> |
| 34 | |
| 35 | class DbMultipleRecnoDataBuilder |
| 36 | { |
| 37 | public: |
| 38 | DbMultipleRecnoDataBuilder(Dbt &dbt); |
| 39 | |
| 40 | bool append(db_recno_t recno, void *dbuf, size_t dlen); |
| 41 | bool reserve(db_recno_t recno, void *&ddest, size_t dlen); |
| 42 | }; </pre><p> |
| 43 | This class builds a bulk buffer for use when the |
| 44 | <a class="link" href="dbput.html#put_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a> |
| 45 | flag is specified to either the |
| 46 | <a class="xref" href="dbput.html" title="Db::put()">Db::put()</a> or |
| 47 | <a class="xref" href="dbdel.html" title="Db::del()">Db::del()</a> methods with the recno |
| 48 | or queue access methods, or for the <code class="literal">key</code> when the |
| 49 | <a class="link" href="dbput.html#put_DB_MULTIPLE">DB_MULTIPLE</a> flag is used. The buffer in the |
| 50 | <a class="link" href="dbt.html" title="Chapter 4. The Dbt Handle">Dbt</a> passed to the constructor is |
| 51 | filled by calls to |
| 52 | <a class="xref" href="dbmultiplerecnodatabuilder.html#dbmultiplerecnodatabuilder.append" title="DbMultipleRecnoDataBuilder.append()">DbMultipleRecnoDataBuilder.append()</a> |
| 53 | or |
| 54 | <a class="xref" href="dbmultiplerecnodatabuilder.html#dbmultiplerecnodatabuilder.reserve" title="DbMultipleRecnoDataBuilder.reserve()">DbMultipleRecnoDataBuilder.reserve()</a>. |
| 55 | </p><p> |
| 56 | The constructor takes a <a class="xref" href="dbt.html" title="Chapter 4. The Dbt Handle"> |
| 57 | The Dbt Handle |
| 58 | </a> |
| 59 | that must be configured to contain a buffer managed by the application, |
| 60 | with the <code class="literal">ulen</code> field set to the size of the buffer. |
| 61 | </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> |
| 62 | All instances of the bulk retrieval classes may be used only once, |
| 63 | and to build the bulk buffer in the forward direction only. |
| 64 | </p></div><p> |
| 65 | Parameters are: |
| 66 | </p><div class="itemizedlist"><ul type="disc"><li><p> |
| 67 | <code class="literal">dbt</code> |
| 68 | </p><p> |
| 69 | The <span class="bold"><strong>dbt</strong></span> parameter is a <a class="xref" href="dbt.html" title="Chapter 4. The Dbt Handle"> |
| 70 | The Dbt Handle |
| 71 | </a> that must already be configured to contain a buffer managed by the application, with the <code class="literal">ulen</code> field set to the size of the buffer, which must be a multiple of 4. |
| 72 | </p></li></ul></div> |
| 73 | |
| 74 | bool append(db_recno_t recno, void *dbuf, size_t dlen); |
| 75 | <div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="dbmultiplerecnodatabuilder.append"></a>DbMultipleRecnoDataBuilder.append()</h3></div></div></div><p> |
| 76 | The <code class="methodname">DbMultipleRecnoDataBuilder.append()</code> |
| 77 | method copies a record number / data pair to the end of the buffer. |
| 78 | </p><p> |
| 79 | The <code class="methodname">DbMultipleRecnoDataBuilder.append()</code> |
| 80 | method returns <code class="literal">false</code> if the record |
| 81 | number / data pair does not fit in the buffer and |
| 82 | <code class="literal">true</code> otherwise. |
| 83 | </p><p> |
| 84 | Parameters are: |
| 85 | </p><div class="itemizedlist"><ul type="disc"><li><p> |
| 86 | <code class="literal">recno</code> |
| 87 | </p><p> |
| 88 | The record number to append. |
| 89 | </p></li><li><p> |
| 90 | <code class="literal">dbuf</code> |
| 91 | </p><p> |
| 92 | A pointer to the data item to be copied into the bulk |
| 93 | buffer. |
| 94 | </p></li><li><p> |
| 95 | <code class="literal">dlen</code> |
| 96 | </p><p> |
| 97 | The number of bytes of the data item to be copied. |
| 98 | </p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="dbmultiplerecnodatabuilder.reserve"></a>DbMultipleRecnoDataBuilder.reserve()</h3></div></div></div><p> |
| 99 | The <code class="methodname">DbMultipleRecnoDataBuilder.reserve()</code> |
| 100 | method reserves space for the next record number / data pair in |
| 101 | the bulk buffer. The record number is appended, but unlike the |
| 102 | <code class="methodname">append()</code>, the data is not copied into the |
| 103 | bulk buffer by <code class="methodname">reserve()</code>: copying the |
| 104 | data is the responsibility of the application. |
| 105 | </p><p> |
| 106 | The <code class="methodname">DbMultipleRecnoDataBuilder.reserve()</code> |
| 107 | method returns <code class="literal">false</code> if the record does |
| 108 | not fit in the buffer and <code class="literal">true</code> otherwise. |
| 109 | </p><p> |
| 110 | Parameters are: |
| 111 | </p><div class="itemizedlist"><ul type="disc"><li><p> |
| 112 | <code class="literal">recno</code> |
| 113 | </p><p> |
| 114 | The record number to append. |
| 115 | </p></li><li><p> |
| 116 | <code class="literal">ddest</code> |
| 117 | </p><p> |
| 118 | Set to a pointer to the position in the bulk buffer reserved for the data item, if enough space is available. |
| 119 | </p></li><li><p> |
| 120 | <code class="literal">dlen</code> |
| 121 | </p><p> |
| 122 | The number of bytes to reserve for the data item. |
| 123 | </p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="idp6554296"></a>Class</h3></div></div></div><p> |
| 124 | <a class="link" href="dbmultiplebuilder.html" title="DbMultipleBuilder">DbMultipleBuilder</a> |
| 125 | </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="idp6564664"></a>See Also</h3></div></div></div><p> |
| 126 | <a class="xref" href="dbt.html#dbtlist" title="DBT and Bulk Operations">DBT and Bulk Operations</a> |
| 127 | </p></div></div> |
| 128 | <div class="navfooter"> |
| 129 | <hr /> |
| 130 | <table width="100%" summary="Navigation footer"> |
| 131 | <tr> |
| 132 | <td width="40%" align="left"><a accesskey="p" href="dbmultiplekeydatabuilder.html">Prev</a> </td> |
| 133 | <td width="20%" align="center"> |
| 134 | <a accesskey="u" href="dbt.html">Up</a> |
| 135 | </td> |
| 136 | <td width="40%" align="right"> <a accesskey="n" href="env.html">Next</a></td> |
| 137 | </tr> |
| 138 | <tr> |
| 139 | <td width="40%" align="left" valign="top">DbMultipleKeyDataBuilder </td> |
| 140 | <td width="20%" align="center"> |
| 141 | <a accesskey="h" href="index.html">Home</a> |
| 142 | </td> |
| 143 | <td width="40%" align="right" valign="top"> Chapter 5. |
| 144 | The DbEnv Handle |
| 145 | </td> |
| 146 | </tr> |
| 147 | </table> |
| 148 | </div> |
| 149 | </body> |
| 150 | </html> |