Debian Codegraph @

docs/api_reference/CXX/dbmultiplekeydatabuilder.html

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