Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / beast / doc / html / beast / ref / boost__beast__multi_buffer.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>multi_buffer</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Beast">
8 <link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
9 <link rel="prev" href="boost__beast__make_printable.html" title="make_printable">
10 <link rel="next" href="boost__beast__operator_not__eq_.html" title="operator!=">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="boost__beast__make_printable.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__operator_not__eq_.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="beast.ref.boost__beast__multi_buffer"></a><a class="link" href="boost__beast__multi_buffer.html" title="multi_buffer">multi_buffer</a>
28 </h4></div></div></div>
29 <p>
30         <a class="indexterm" name="idm45873487254352"></a>
31 A typical multi buffer.
32       </p>
33 <h5>
34 <a name="beast.ref.boost__beast__multi_buffer.h0"></a>
35         <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.synopsis"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.synopsis">Synopsis</a>
36       </h5>
37 <p>
38         Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/core/multi_buffer.hpp" target="_top">boost/beast/core/multi_buffer.hpp</a>&gt;</code>
39       </p>
40 <pre class="programlisting"><span class="keyword">using</span> <span class="identifier">multi_buffer</span> <span class="special">=</span> <span class="identifier">basic_multi_buffer</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span> <span class="keyword">char</span> <span class="special">&gt;</span> <span class="special">&gt;;</span>
41 </pre>
42 <h5>
43 <a name="beast.ref.boost__beast__multi_buffer.h1"></a>
44         <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.types"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.types">Types</a>
45       </h5>
46 <div class="informaltable"><table class="table">
47 <colgroup>
48 <col>
49 <col>
50 </colgroup>
51 <thead><tr>
52 <th>
53                 <p>
54                   Name
55                 </p>
56               </th>
57 <th>
58                 <p>
59                   Description
60                 </p>
61               </th>
62 </tr></thead>
63 <tbody>
64 <tr>
65 <td>
66                 <p>
67                   <a class="link" href="boost__beast__basic_multi_buffer/allocator_type.html" title="basic_multi_buffer::allocator_type"><span class="bold"><strong>allocator_type</strong></span></a>
68                 </p>
69               </td>
70 <td>
71                 <p>
72                   The type of allocator used.
73                 </p>
74               </td>
75 </tr>
76 <tr>
77 <td>
78                 <p>
79                   <a class="link" href="boost__beast__basic_multi_buffer/const_buffers_type.html" title="basic_multi_buffer::const_buffers_type"><span class="bold"><strong>const_buffers_type</strong></span></a>
80                 </p>
81               </td>
82 <td>
83                 <p>
84                   The ConstBufferSequence used to represent the readable bytes.
85                 </p>
86               </td>
87 </tr>
88 <tr>
89 <td>
90                 <p>
91                   <a class="link" href="boost__beast__basic_multi_buffer/mutable_buffers_type.html" title="basic_multi_buffer::mutable_buffers_type"><span class="bold"><strong>mutable_buffers_type</strong></span></a>
92                 </p>
93               </td>
94 <td>
95                 <p>
96                   The MutableBufferSequence used to represent the writable bytes.
97                 </p>
98               </td>
99 </tr>
100 <tr>
101 <td>
102                 <p>
103                   <a class="link" href="boost__beast__basic_multi_buffer/mutable_data_type.html" title="basic_multi_buffer::mutable_data_type"><span class="bold"><strong>mutable_data_type</strong></span></a>
104                 </p>
105               </td>
106 <td>
107                 <p>
108                   The MutableBufferSequence used to represent the readable bytes.
109                 </p>
110               </td>
111 </tr>
112 </tbody>
113 </table></div>
114 <h5>
115 <a name="beast.ref.boost__beast__multi_buffer.h2"></a>
116         <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.member_functions"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.member_functions">Member Functions</a>
117       </h5>
118 <div class="informaltable"><table class="table">
119 <colgroup>
120 <col>
121 <col>
122 </colgroup>
123 <thead><tr>
124 <th>
125                 <p>
126                   Name
127                 </p>
128               </th>
129 <th>
130                 <p>
131                   Description
132                 </p>
133               </th>
134 </tr></thead>
135 <tbody>
136 <tr>
137 <td>
138                 <p>
139                   <a class="link" href="boost__beast__basic_multi_buffer/basic_multi_buffer.html" title="basic_multi_buffer::basic_multi_buffer"><span class="bold"><strong>basic_multi_buffer</strong></span></a>
140                 </p>
141               </td>
142 <td>
143                 <p>
144                   Constructor.
145                 </p>
146                 <p>
147                   Move Constructor.
148                 </p>
149                 <p>
150                   Copy Constructor.
151                 </p>
152               </td>
153 </tr>
154 <tr>
155 <td>
156                 <p>
157                   <a class="link" href="boost__beast__basic_multi_buffer/capacity.html" title="basic_multi_buffer::capacity"><span class="bold"><strong>capacity</strong></span></a>
158                 </p>
159               </td>
160 <td>
161                 <p>
162                   Return the maximum number of bytes, both readable and writable,
163                   that can be held without requiring an allocation.
164                 </p>
165               </td>
166 </tr>
167 <tr>
168 <td>
169                 <p>
170                   <a class="link" href="boost__beast__basic_multi_buffer/cdata.html" title="basic_multi_buffer::cdata"><span class="bold"><strong>cdata</strong></span></a>
171                 </p>
172               </td>
173 <td>
174                 <p>
175                   Returns a constant buffer sequence representing the readable bytes.
176                 </p>
177               </td>
178 </tr>
179 <tr>
180 <td>
181                 <p>
182                   <a class="link" href="boost__beast__basic_multi_buffer/clear.html" title="basic_multi_buffer::clear"><span class="bold"><strong>clear</strong></span></a>
183                 </p>
184               </td>
185 <td>
186                 <p>
187                   Set the size of the readable and writable bytes to zero.
188                 </p>
189               </td>
190 </tr>
191 <tr>
192 <td>
193                 <p>
194                   <a class="link" href="boost__beast__basic_multi_buffer/commit.html" title="basic_multi_buffer::commit"><span class="bold"><strong>commit</strong></span></a>
195                 </p>
196               </td>
197 <td>
198                 <p>
199                   Append writable bytes to the readable bytes.
200                 </p>
201               </td>
202 </tr>
203 <tr>
204 <td>
205                 <p>
206                   <a class="link" href="boost__beast__basic_multi_buffer/consume.html" title="basic_multi_buffer::consume"><span class="bold"><strong>consume</strong></span></a>
207                 </p>
208               </td>
209 <td>
210                 <p>
211                   Remove bytes from beginning of the readable bytes.
212                 </p>
213               </td>
214 </tr>
215 <tr>
216 <td>
217                 <p>
218                   <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><span class="bold"><strong>data</strong></span></a>
219                 </p>
220               </td>
221 <td>
222                 <p>
223                   Returns a constant buffer sequence representing the readable bytes.
224                 </p>
225                 <p>
226                   Returns a mutable buffer sequence representing the readable bytes.
227                 </p>
228               </td>
229 </tr>
230 <tr>
231 <td>
232                 <p>
233                   <a class="link" href="boost__beast__basic_multi_buffer/get_allocator.html" title="basic_multi_buffer::get_allocator"><span class="bold"><strong>get_allocator</strong></span></a>
234                 </p>
235               </td>
236 <td>
237                 <p>
238                   Returns a copy of the allocator used.
239                 </p>
240               </td>
241 </tr>
242 <tr>
243 <td>
244                 <p>
245                   <a class="link" href="boost__beast__basic_multi_buffer/max_size.html" title="basic_multi_buffer::max_size"><span class="bold"><strong>max_size</strong></span></a>
246                 </p>
247               </td>
248 <td>
249                 <p>
250                   Set the maximum allowed capacity.
251                 </p>
252                 <p>
253                   Return the maximum number of bytes, both readable and writable,
254                   that can ever be held.
255                 </p>
256               </td>
257 </tr>
258 <tr>
259 <td>
260                 <p>
261                   <a class="link" href="boost__beast__basic_multi_buffer/operator_eq_.html" title="basic_multi_buffer::operator="><span class="bold"><strong>operator=</strong></span></a>
262                 </p>
263               </td>
264 <td>
265                 <p>
266                   Move Assignment.
267                 </p>
268                 <p>
269                   Copy Assignment.
270                 </p>
271               </td>
272 </tr>
273 <tr>
274 <td>
275                 <p>
276                   <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><span class="bold"><strong>prepare</strong></span></a>
277                 </p>
278               </td>
279 <td>
280                 <p>
281                   Returns a mutable buffer sequence representing writable bytes.
282                 </p>
283               </td>
284 </tr>
285 <tr>
286 <td>
287                 <p>
288                   <a class="link" href="boost__beast__basic_multi_buffer/reserve.html" title="basic_multi_buffer::reserve"><span class="bold"><strong>reserve</strong></span></a>
289                 </p>
290               </td>
291 <td>
292                 <p>
293                   Guarantee a minimum capacity.
294                 </p>
295               </td>
296 </tr>
297 <tr>
298 <td>
299                 <p>
300                   <a class="link" href="boost__beast__basic_multi_buffer/shrink_to_fit.html" title="basic_multi_buffer::shrink_to_fit"><span class="bold"><strong>shrink_to_fit</strong></span></a>
301                 </p>
302               </td>
303 <td>
304                 <p>
305                   Reallocate the buffer to fit the readable bytes exactly.
306                 </p>
307               </td>
308 </tr>
309 <tr>
310 <td>
311                 <p>
312                   <a class="link" href="boost__beast__basic_multi_buffer/size.html" title="basic_multi_buffer::size"><span class="bold"><strong>size</strong></span></a>
313                 </p>
314               </td>
315 <td>
316                 <p>
317                   Returns the number of readable bytes.
318                 </p>
319               </td>
320 </tr>
321 <tr>
322 <td>
323                 <p>
324                   <a class="link" href="boost__beast__basic_multi_buffer/basic_multi_buffer_dtor_.html" title="basic_multi_buffer::~basic_multi_buffer"><span class="bold"><strong>~basic_multi_buffer</strong></span></a>
325                 </p>
326               </td>
327 <td>
328                 <p>
329                   Destructor.
330                 </p>
331               </td>
332 </tr>
333 </tbody>
334 </table></div>
335 <h5>
336 <a name="beast.ref.boost__beast__multi_buffer.h3"></a>
337         <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.friends"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.friends">Friends</a>
338       </h5>
339 <div class="informaltable"><table class="table">
340 <colgroup>
341 <col>
342 <col>
343 </colgroup>
344 <thead><tr>
345 <th>
346                 <p>
347                   Name
348                 </p>
349               </th>
350 <th>
351                 <p>
352                   Description
353                 </p>
354               </th>
355 </tr></thead>
356 <tbody><tr>
357 <td>
358                 <p>
359                   <a class="link" href="boost__beast__basic_multi_buffer/swap.html" title="basic_multi_buffer::swap"><span class="bold"><strong>swap</strong></span></a>
360                 </p>
361               </td>
362 <td>
363                 <p>
364                   Exchange two dynamic buffers.
365                 </p>
366               </td>
367 </tr></tbody>
368 </table></div>
369 <p>
370         A dynamic buffer encapsulates memory storage that may be automatically resized
371         as required, where the memory is divided into two regions: readable bytes
372         followed by writable bytes. These memory regions are internal to the dynamic
373         buffer, but direct access to the elements is provided to permit them to be
374         efficiently used with I/O operations. The implementation uses a sequence
375         of one or more byte arrays of varying sizes to represent the readable and
376         writable bytes. Additional byte array objects are appended to the sequence
377         to accommodate changes in the desired size. The behavior and implementation
378         of this container is most similar to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span></code>.
379         Objects of this type meet the requirements of <span class="emphasis"><em>DynamicBuffer</em></span>
380         and have the following additional properties:
381       </p>
382 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
383 <li class="listitem">
384             A mutable buffer sequence representing the readable bytes is returned
385             by <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">data</span></code></a> when <code class="computeroutput"><span class="keyword">this</span></code>
386             is non-const.
387           </li>
388 <li class="listitem">
389             Buffer sequences representing the readable and writable bytes, returned
390             by <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">data</span></code></a> and <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">prepare</span></code></a>, may have length greater
391             than one.
392           </li>
393 <li class="listitem">
394             A configurable maximum size may be set upon construction and adjusted
395             afterwards. Calls to <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">prepare</span></code></a> that would exceed this
396             size will throw <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>.
397           </li>
398 <li class="listitem">
399             Sequences previously obtained using <a class="link" href="boost__beast__basic_multi_buffer/data.html" title="basic_multi_buffer::data"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">data</span></code></a> remain valid after calls
400             to <a class="link" href="boost__beast__basic_multi_buffer/prepare.html" title="basic_multi_buffer::prepare"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">prepare</span></code></a> or <a class="link" href="boost__beast__basic_multi_buffer/commit.html" title="basic_multi_buffer::commit"><code class="computeroutput"><span class="identifier">basic_multi_buffer</span><span class="special">::</span><span class="identifier">commit</span></code></a>.
401           </li>
402 </ul></div>
403 <h5>
404 <a name="beast.ref.boost__beast__multi_buffer.h4"></a>
405         <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.template_parameters"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.template_parameters">Template
406         Parameters</a>
407       </h5>
408 <div class="informaltable"><table class="table">
409 <colgroup>
410 <col>
411 <col>
412 </colgroup>
413 <thead><tr>
414 <th>
415                 <p>
416                   Type
417                 </p>
418               </th>
419 <th>
420                 <p>
421                   Description
422                 </p>
423               </th>
424 </tr></thead>
425 <tbody><tr>
426 <td>
427                 <p>
428                   <code class="computeroutput"><span class="identifier">Allocator</span></code>
429                 </p>
430               </td>
431 <td>
432                 <p>
433                   The allocator to use for managing memory.
434                 </p>
435               </td>
436 </tr></tbody>
437 </table></div>
438 <h5>
439 <a name="beast.ref.boost__beast__multi_buffer.h5"></a>
440         <span class="phrase"><a name="beast.ref.boost__beast__multi_buffer.description"></a></span><a class="link" href="boost__beast__multi_buffer.html#beast.ref.boost__beast__multi_buffer.description">Description</a>
441       </h5>
442 <p>
443         Convenience header <code class="literal">&lt;<a href="../../../../../../boost/beast/core.hpp" target="_top">boost/beast/core.hpp</a>&gt;</code>
444       </p>
445 </div>
446 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
447 <td align="left"></td>
448 <td align="right"><div class="copyright-footer">Copyright &#169; 2016-2019 Vinnie
449       Falco<p>
450         Distributed under the Boost Software License, Version 1.0. (See accompanying
451         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
452       </p>
453 </div></td>
454 </tr></table>
455 <hr>
456 <div class="spirit-nav">
457 <a accesskey="p" href="boost__beast__make_printable.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__operator_not__eq_.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
458 </div>
459 </body>
460 </html>