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 class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbMultipleRecnoDataBuilder</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbmultiplekeydatabuilder.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 4. 23 The Dbt Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="env.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <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> 31 32class DbMultipleRecnoDataBuilder 33{ 34public: 35 DbMultipleRecnoDataBuilder(Dbt &dbt); 36 37 bool append(db_recno_t recno, void *dbuf, size_t dlen); 38 bool reserve(db_recno_t recno, void *&ddest, size_t dlen); 39}; </pre><p> 40 This class builds a bulk buffer for use when the 41 <a class="link" href="dbput.html#put_DB_MULTIPLE_KEY">DB_MULTIPLE_KEY</a> 42 flag is specified to either the 43 <a class="xref" href="dbput.html" title="Db::put()">Db::put()</a> or 44 <a class="xref" href="dbdel.html" title="Db::del()">Db::del()</a> methods with the recno 45 or queue access methods, or for the <code class="literal">key</code> when the 46 <a class="link" href="dbput.html#put_DB_MULTIPLE">DB_MULTIPLE</a> flag is used. The buffer in the 47 <a class="link" href="dbt.html" title="Chapter 4. The Dbt Handle">Dbt</a> passed to the constructor is 48 filled by calls to 49 <a class="xref" href="dbmultiplerecnodatabuilder.html#dbmultiplerecnodatabuilder.append" title="DbMultipleRecnoDataBuilder.append()">DbMultipleRecnoDataBuilder.append()</a> 50 or 51 <a class="xref" href="dbmultiplerecnodatabuilder.html#dbmultiplerecnodatabuilder.reserve" title="DbMultipleRecnoDataBuilder.reserve()">DbMultipleRecnoDataBuilder.reserve()</a>. 52 </p><p> 53 The constructor takes a <a class="xref" href="dbt.html" title="Chapter 4. The Dbt Handle"> 54 The Dbt Handle 55 </a> 56 that must be configured to contain a buffer managed by the application, 57 with the <code class="literal">ulen</code> field set to the size of the buffer. 58 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> 59 All instances of the bulk retrieval classes may be used only once, 60 and to build the bulk buffer in the forward direction only. 61 </p></div><p> 62 Parameters are: 63 </p><div class="itemizedlist"><ul type="disc"><li><p> 64 <code class="literal">dbt</code> 65 </p><p> 66 The <span class="bold"><strong>dbt</strong></span> parameter is a <a class="xref" href="dbt.html" title="Chapter 4. The Dbt Handle"> 67 The Dbt Handle 68 </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. 69 </p></li></ul></div> 70 71 bool append(db_recno_t recno, void *dbuf, size_t dlen); 72 <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> 73 The <code class="methodname">DbMultipleRecnoDataBuilder.append()</code> 74 method copies a record number / data pair to the end of the buffer. 75 </p><p> 76 The <code class="methodname">DbMultipleRecnoDataBuilder.append()</code> 77 method returns <code class="literal">false</code> if the record 78 number / data pair does not fit in the buffer and 79 <code class="literal">true</code> otherwise. 80 </p><p> 81 Parameters are: 82 </p><div class="itemizedlist"><ul type="disc"><li><p> 83 <code class="literal">recno</code> 84 </p><p> 85 The record number to append. 86 </p></li><li><p> 87 <code class="literal">dbuf</code> 88 </p><p> 89 A pointer to the data item to be copied into the bulk 90 buffer. 91 </p></li><li><p> 92 <code class="literal">dlen</code> 93 </p><p> 94 The number of bytes of the data item to be copied. 95 </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> 96 The <code class="methodname">DbMultipleRecnoDataBuilder.reserve()</code> 97 method reserves space for the next record number / data pair in 98 the bulk buffer. The record number is appended, but unlike the 99 <code class="methodname">append()</code>, the data is not copied into the 100 bulk buffer by <code class="methodname">reserve()</code>: copying the 101 data is the responsibility of the application. 102 </p><p> 103 The <code class="methodname">DbMultipleRecnoDataBuilder.reserve()</code> 104 method returns <code class="literal">false</code> if the record does 105 not fit in the buffer and <code class="literal">true</code> otherwise. 106 </p><p> 107 Parameters are: 108 </p><div class="itemizedlist"><ul type="disc"><li><p> 109 <code class="literal">recno</code> 110 </p><p> 111 The record number to append. 112 </p></li><li><p> 113 <code class="literal">ddest</code> 114 </p><p> 115 Set to a pointer to the position in the bulk buffer reserved for the data item, if enough space is available. 116 </p></li><li><p> 117 <code class="literal">dlen</code> 118 </p><p> 119 The number of bytes to reserve for the data item. 120 </p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id1662501"></a>Class</h3></div></div></div><p> 121 <a class="link" href="dbmultiplebuilder.html" title="DbMultipleBuilder">DbMultipleBuilder</a> 122 </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id1662517"></a>See Also</h3></div></div></div><p> 123 <a class="xref" href="dbt.html#dbtlist" title="DBT and Bulk Operations">DBT and Bulk Operations</a> 124 </p></div></div> 125 <div class="navfooter"> 126 <hr /> 127 <table width="100%" summary="Navigation footer"> 128 <tr> 129 <td width="40%" align="left"><a accesskey="p" href="dbmultiplekeydatabuilder.html">Prev</a> </td> 130 <td width="20%" align="center"> 131 <a accesskey="u" href="dbt.html">Up</a> 132 </td> 133 <td width="40%" align="right"> <a accesskey="n" href="env.html">Next</a></td> 134 </tr> 135 <tr> 136 <td width="40%" align="left" valign="top">DbMultipleKeyDataBuilder </td> 137 <td width="20%" align="center"> 138 <a accesskey="h" href="index.html">Home</a> 139 </td> 140 <td width="40%" align="right" valign="top"> Chapter 5. 141 The DbEnv Handle 142 </td> 143 </tr> 144 </table> 145 </div> 146 </body> 147</html> 148