Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / beast / doc / html / beast / ref / boost__beast__flat_buffer.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>flat_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__file_win32/file_win32_dtor_.html" title="file_win32::~file_win32">
10 <link rel="next" href="boost__beast__flat_static_buffer.html" title="flat_static_buffer">
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__file_win32/file_win32_dtor_.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__flat_static_buffer.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__flat_buffer"></a><a class="link" href="boost__beast__flat_buffer.html" title="flat_buffer">flat_buffer</a>
28 </h4></div></div></div>
29 <p>
30         <a class="indexterm" name="idm45873509342240"></a>
31 A flat buffer which uses the default allocator.
32       </p>
33 <h5>
34 <a name="beast.ref.boost__beast__flat_buffer.h0"></a>
35         <span class="phrase"><a name="beast.ref.boost__beast__flat_buffer.synopsis"></a></span><a class="link" href="boost__beast__flat_buffer.html#beast.ref.boost__beast__flat_buffer.synopsis">Synopsis</a>
36       </h5>
37 <p>
38         Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/core/flat_buffer.hpp" target="_top">boost/beast/core/flat_buffer.hpp</a>&gt;</code>
39       </p>
40 <pre class="programlisting"><span class="keyword">using</span> <span class="identifier">flat_buffer</span> <span class="special">=</span> <span class="identifier">basic_flat_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__flat_buffer.h1"></a>
44         <span class="phrase"><a name="beast.ref.boost__beast__flat_buffer.types"></a></span><a class="link" href="boost__beast__flat_buffer.html#beast.ref.boost__beast__flat_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_flat_buffer/allocator_type.html" title="basic_flat_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_flat_buffer/const_buffers_type.html" title="basic_flat_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_flat_buffer/mutable_buffers_type.html" title="basic_flat_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_flat_buffer/mutable_data_type.html" title="basic_flat_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__flat_buffer.h2"></a>
116         <span class="phrase"><a name="beast.ref.boost__beast__flat_buffer.member_functions"></a></span><a class="link" href="boost__beast__flat_buffer.html#beast.ref.boost__beast__flat_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_flat_buffer/basic_flat_buffer.html" title="basic_flat_buffer::basic_flat_buffer"><span class="bold"><strong>basic_flat_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_flat_buffer/capacity.html" title="basic_flat_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_flat_buffer/cdata.html" title="basic_flat_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_flat_buffer/clear.html" title="basic_flat_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_flat_buffer/commit.html" title="basic_flat_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_flat_buffer/consume.html" title="basic_flat_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_flat_buffer/data.html" title="basic_flat_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_flat_buffer/get_allocator.html" title="basic_flat_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_flat_buffer/max_size.html" title="basic_flat_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_flat_buffer/operator_eq_.html" title="basic_flat_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                 <p>
272                   Copy assignment.
273                 </p>
274               </td>
275 </tr>
276 <tr>
277 <td>
278                 <p>
279                   <a class="link" href="boost__beast__basic_flat_buffer/prepare.html" title="basic_flat_buffer::prepare"><span class="bold"><strong>prepare</strong></span></a>
280                 </p>
281               </td>
282 <td>
283                 <p>
284                   Returns a mutable buffer sequence representing writable bytes.
285                 </p>
286               </td>
287 </tr>
288 <tr>
289 <td>
290                 <p>
291                   <a class="link" href="boost__beast__basic_flat_buffer/reserve.html" title="basic_flat_buffer::reserve"><span class="bold"><strong>reserve</strong></span></a>
292                 </p>
293               </td>
294 <td>
295                 <p>
296                   Guarantee a minimum capacity.
297                 </p>
298               </td>
299 </tr>
300 <tr>
301 <td>
302                 <p>
303                   <a class="link" href="boost__beast__basic_flat_buffer/shrink_to_fit.html" title="basic_flat_buffer::shrink_to_fit"><span class="bold"><strong>shrink_to_fit</strong></span></a>
304                 </p>
305               </td>
306 <td>
307                 <p>
308                   Reallocate the buffer to fit the readable bytes exactly.
309                 </p>
310               </td>
311 </tr>
312 <tr>
313 <td>
314                 <p>
315                   <a class="link" href="boost__beast__basic_flat_buffer/size.html" title="basic_flat_buffer::size"><span class="bold"><strong>size</strong></span></a>
316                 </p>
317               </td>
318 <td>
319                 <p>
320                   Returns the number of readable bytes.
321                 </p>
322               </td>
323 </tr>
324 <tr>
325 <td>
326                 <p>
327                   <a class="link" href="boost__beast__basic_flat_buffer/basic_flat_buffer_dtor_.html" title="basic_flat_buffer::~basic_flat_buffer"><span class="bold"><strong>~basic_flat_buffer</strong></span></a>
328                 </p>
329               </td>
330 <td>
331                 <p>
332                   Destructor.
333                 </p>
334               </td>
335 </tr>
336 </tbody>
337 </table></div>
338 <h5>
339 <a name="beast.ref.boost__beast__flat_buffer.h3"></a>
340         <span class="phrase"><a name="beast.ref.boost__beast__flat_buffer.friends"></a></span><a class="link" href="boost__beast__flat_buffer.html#beast.ref.boost__beast__flat_buffer.friends">Friends</a>
341       </h5>
342 <div class="informaltable"><table class="table">
343 <colgroup>
344 <col>
345 <col>
346 </colgroup>
347 <thead><tr>
348 <th>
349                 <p>
350                   Name
351                 </p>
352               </th>
353 <th>
354                 <p>
355                   Description
356                 </p>
357               </th>
358 </tr></thead>
359 <tbody><tr>
360 <td>
361                 <p>
362                   <a class="link" href="boost__beast__basic_flat_buffer/swap.html" title="basic_flat_buffer::swap"><span class="bold"><strong>swap</strong></span></a>
363                 </p>
364               </td>
365 <td>
366                 <p>
367                   Exchange two dynamic buffers.
368                 </p>
369               </td>
370 </tr></tbody>
371 </table></div>
372 <p>
373         A dynamic buffer encapsulates memory storage that may be automatically resized
374         as required, where the memory is divided into two regions: readable bytes
375         followed by writable bytes. These memory regions are internal to the dynamic
376         buffer, but direct access to the elements is provided to permit them to be
377         efficiently used with I/O operations. Objects of this type meet the requirements
378         of <span class="emphasis"><em>DynamicBuffer</em></span> and have the following additional properties:
379       </p>
380 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
381 <li class="listitem">
382             A mutable buffer sequence representing the readable bytes is returned
383             by <a class="link" href="boost__beast__basic_flat_buffer/data.html" title="basic_flat_buffer::data"><code class="computeroutput"><span class="identifier">basic_flat_buffer</span><span class="special">::</span><span class="identifier">data</span></code></a> when <code class="computeroutput"><span class="keyword">this</span></code>
384             is non-const.
385           </li>
386 <li class="listitem">
387             A configurable maximum buffer size may be set upon construction. Attempts
388             to exceed the buffer size will throw <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>.
389           </li>
390 <li class="listitem">
391             Buffer sequences representing the readable and writable bytes, returned
392             by <a class="link" href="boost__beast__basic_flat_buffer/data.html" title="basic_flat_buffer::data"><code class="computeroutput"><span class="identifier">basic_flat_buffer</span><span class="special">::</span><span class="identifier">data</span></code></a> and <a class="link" href="boost__beast__basic_flat_buffer/prepare.html" title="basic_flat_buffer::prepare"><code class="computeroutput"><span class="identifier">basic_flat_buffer</span><span class="special">::</span><span class="identifier">prepare</span></code></a>, will have length one.
393           </li>
394 </ul></div>
395 <p>
396         Upon construction, a maximum size for the buffer may be specified. If this
397         limit is exceeded, the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>
398         exception will be thrown.
399       </p>
400 <h5>
401 <a name="beast.ref.boost__beast__flat_buffer.h4"></a>
402         <span class="phrase"><a name="beast.ref.boost__beast__flat_buffer.remarks"></a></span><a class="link" href="boost__beast__flat_buffer.html#beast.ref.boost__beast__flat_buffer.remarks">Remarks</a>
403       </h5>
404 <p>
405         This class is designed for use with algorithms that take dynamic buffers
406         as parameters, and are optimized for the case where the input sequence or
407         output sequence is stored in a single contiguous buffer.
408       </p>
409 <h5>
410 <a name="beast.ref.boost__beast__flat_buffer.h5"></a>
411         <span class="phrase"><a name="beast.ref.boost__beast__flat_buffer.description"></a></span><a class="link" href="boost__beast__flat_buffer.html#beast.ref.boost__beast__flat_buffer.description">Description</a>
412       </h5>
413 <p>
414         Convenience header <code class="literal">&lt;<a href="../../../../../../boost/beast/core.hpp" target="_top">boost/beast/core.hpp</a>&gt;</code>
415       </p>
416 </div>
417 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
418 <td align="left"></td>
419 <td align="right"><div class="copyright-footer">Copyright &#169; 2016-2019 Vinnie
420       Falco<p>
421         Distributed under the Boost Software License, Version 1.0. (See accompanying
422         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>)
423       </p>
424 </div></td>
425 </tr></table>
426 <hr>
427 <div class="spirit-nav">
428 <a accesskey="p" href="boost__beast__file_win32/file_win32_dtor_.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__flat_static_buffer.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
429 </div>
430 </body>
431 </html>