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>DbMultipleDataBuilder</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="dbmultiplebuilder.html" title="DbMultipleBuilder" /> 12 <link rel="next" href="dbmultiplekeydatabuilder.html" title="DbMultipleKeyDataBuilder" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbMultipleDataBuilder</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbmultiplebuilder.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="dbmultiplekeydatabuilder.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbmultipledatabuilder"></a>DbMultipleDataBuilder</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40class DbMultipleDataBuilder 41{ 42public: 43 DbMultipleDataBuilder(Dbt &dbt); 44 45 bool append(void *dbuf, size_t dlen); 46 bool reserve(void *&ddest, size_t dlen); 47}; </pre> 48 <p> 49 This class builds a bulk buffer for use when the 50 <a class="link" href="dbput.html#put_DB_MULTIPLE">DB_MULTIPLE</a> 51 flag is specified to either the 52 <a class="xref" href="dbput.html" title="Db::put()">Db::put()</a> or 53 <a class="xref" href="dbdel.html" title="Db::del()">Db::del()</a> methods. The buffer in 54 the <a class="link" href="dbt.html" title="Chapter��4.�� The Dbt Handle">Dbt</a> passed to the constructor is 55 filled by calls to 56 <a class="xref" href="dbmultipledatabuilder.html#dbmultipledatabuilder.append" title="DbMultipleDataBuilder.append()">DbMultipleDataBuilder.append()</a> 57 or 58 <a class="xref" href="dbmultipledatabuilder.html#dbmultipledatabuilder.reserve" title="DbMultipleDataBuilder.reserve()">DbMultipleDataBuilder.reserve()</a>. 59 </p> 60 <p> 61 The constructor takes a <a class="xref" href="dbt.html" title="Chapter��4.�� The Dbt Handle"> 62 The Dbt Handle 63 </a> 64 that must be configured to contain a buffer managed by the application, 65 with the <code class="literal">ulen</code> field set to the size of the buffer. 66 </p> 67 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> 68 <h3 class="title">Note</h3> 69 <p> 70 All instances of the bulk retrieval classes may be used only once, 71 and to build the bulk buffer in the forward direction only. 72 </p> 73 </div> 74 <p> 75 Parameters are: 76 </p> 77 <div class="itemizedlist"> 78 <ul type="disc"> 79 <li> 80 <p> 81 <code class="literal">dbt</code> 82 </p> 83 <p> 84 The <span class="bold"><strong>dbt</strong></span> parameter is a <a class="xref" href="dbt.html" title="Chapter��4.�� The Dbt Handle"> 85 The Dbt Handle 86 </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. 87 </p> 88 </li> 89 </ul> 90 </div> 91 <div class="sect2" lang="en" xml:lang="en"> 92 <div class="titlepage"> 93 <div> 94 <div> 95 <h3 class="title"><a id="dbmultipledatabuilder.append"></a>DbMultipleDataBuilder.append()</h3> 96 </div> 97 </div> 98 </div> 99 <p> 100 The <code class="methodname">DbMultipleDataBuilder.append()</code> method 101 copies a data item to the end of the buffer. 102 </p> 103 <p> 104 The <code class="methodname">DbMultipleDataBuilder.append()</code> 105 method returns <code class="literal">false</code> if the data does not fit 106 in the buffer and <code class="literal">true</code> otherwise. 107 </p> 108 <p> 109 Parameters are: 110 </p> 111 <div class="itemizedlist"> 112 <ul type="disc"> 113 <li> 114 <p> 115 <code class="literal">dbuf</code> 116 </p> 117 <p> 118 A pointer to the data to be copied into the bulk buffer. 119 </p> 120 </li> 121 <li> 122 <p> 123 <code class="literal">dlen</code> 124 </p> 125 <p> 126 The number of bytes to be copied. 127 </p> 128 </li> 129 </ul> 130 </div> 131 </div> 132 <div class="sect2" lang="en" xml:lang="en"> 133 <div class="titlepage"> 134 <div> 135 <div> 136 <h3 class="title"><a id="dbmultipledatabuilder.reserve"></a>DbMultipleDataBuilder.reserve()</h3> 137 </div> 138 </div> 139 </div> 140 <p> 141 The <code class="methodname">DbMultipleDataBuilder.reserve()</code> 142 method reserves space for the next data item in the bulk buffer. 143 Unlike the <code class="methodname">append()</code>, no data is actually 144 copied into the bulk buffer by <code class="methodname">reserve()</code>: 145 copying the data is the responsibility of the application. 146 </p> 147 <p> 148 The <code class="methodname">DbMultipleDataBuilder.reserve()</code> 149 method returns <code class="literal">false</code> if the data does 150 not fit in the buffer and <code class="literal">true</code> otherwise. 151 </p> 152 <p> 153 Parameters are: 154 </p> 155 <div class="itemizedlist"> 156 <ul type="disc"> 157 <li> 158 <p> 159 <code class="literal">ddest</code> 160 </p> 161 <p> 162 Set to a pointer to the position in the bulk buffer reserved for the data item, if enough space is available. 163 </p> 164 </li> 165 <li> 166 <p> 167 <code class="literal">dlen</code> 168 </p> 169 <p> 170 The number of bytes to reserve. 171 </p> 172 </li> 173 </ul> 174 </div> 175 </div> 176 <div class="sect2" lang="en" xml:lang="en"> 177 <div class="titlepage"> 178 <div> 179 <div> 180 <h3 class="title"><a id="id1661769"></a>Class</h3> 181 </div> 182 </div> 183 </div> 184 <p> 185 <a class="link" href="dbt.html" title="Chapter��4.�� The Dbt Handle">Dbt</a> 186 </p> 187 </div> 188 <div class="sect2" lang="en" xml:lang="en"> 189 <div class="titlepage"> 190 <div> 191 <div> 192 <h3 class="title"><a id="id1661662"></a>See Also</h3> 193 </div> 194 </div> 195 </div> 196 <p> 197 <a class="xref" href="dbt.html#dbtlist" title="DBT and Bulk Operations">DBT and Bulk Operations</a> 198 </p> 199 </div> 200 </div> 201 <div class="navfooter"> 202 <hr /> 203 <table width="100%" summary="Navigation footer"> 204 <tr> 205 <td width="40%" align="left"><a accesskey="p" href="dbmultiplebuilder.html">Prev</a>��</td> 206 <td width="20%" align="center"> 207 <a accesskey="u" href="dbt.html">Up</a> 208 </td> 209 <td width="40%" align="right">��<a accesskey="n" href="dbmultiplekeydatabuilder.html">Next</a></td> 210 </tr> 211 <tr> 212 <td width="40%" align="left" valign="top">DbMultipleBuilder��</td> 213 <td width="20%" align="center"> 214 <a accesskey="h" href="index.html">Home</a> 215 </td> 216 <td width="40%" align="right" valign="top">��DbMultipleKeyDataBuilder</td> 217 </tr> 218 </table> 219 </div> 220 </body> 221</html> 222