• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Buffer-oriented synchronous random-access write device requirements</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="../../boost_asio.html" title="Boost.Asio">
8<link rel="up" href="../reference.html" title="Reference">
9<link rel="prev" href="SyncRandomAccessReadDevice.html" title="Buffer-oriented synchronous random-access read device requirements">
10<link rel="next" href="SyncReadStream.html" title="Buffer-oriented synchronous read stream requirements">
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="SyncRandomAccessReadDevice.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="SyncReadStream.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="boost_asio.reference.SyncRandomAccessWriteDevice"></a><a class="link" href="SyncRandomAccessWriteDevice.html" title="Buffer-oriented synchronous random-access write device requirements">Buffer-oriented
28      synchronous random-access write device requirements</a>
29</h3></div></div></div>
30<p>
31        In the table below, <code class="computeroutput">a</code> denotes a synchronous random-access write
32        device object, <code class="computeroutput">o</code> denotes an offset of type <code class="computeroutput">boost::uint64_t</code>,
33        <code class="computeroutput">cb</code> denotes an object satisfying <a class="link" href="ConstBufferSequence.html" title="Constant buffer sequence requirements">constant
34        buffer sequence</a> requirements, and <code class="computeroutput">ec</code> denotes an object
35        of type <code class="computeroutput">error_code</code>.
36      </p>
37<div class="table">
38<a name="boost_asio.reference.SyncRandomAccessWriteDevice.t0"></a><p class="title"><b>Table 29. Buffer-oriented synchronous random-access write device requirements</b></p>
39<div class="table-contents"><table class="table" summary="Buffer-oriented synchronous random-access write device requirements">
40<colgroup>
41<col>
42<col>
43<col>
44</colgroup>
45<thead><tr>
46<th>
47                <p>
48                  operation
49                </p>
50              </th>
51<th>
52                <p>
53                  type
54                </p>
55              </th>
56<th>
57                <p>
58                  semantics, pre/post-conditions
59                </p>
60              </th>
61</tr></thead>
62<tbody>
63<tr>
64<td>
65                <p>
66                  <code class="computeroutput">a.write_some_at(o, cb);</code>
67                </p>
68              </td>
69<td>
70                <p>
71                  <code class="computeroutput">size_t</code>
72                </p>
73              </td>
74<td>
75                <p>
76                  Equivalent to:
77</p>
78<pre class="programlisting">error_code ec;
79size_t s = a.write_some(o, cb, ec);
80if (ec) throw system_error(ec);
81return s;
82</pre>
83<p>
84                </p>
85              </td>
86</tr>
87<tr>
88<td>
89                <p>
90                  <code class="computeroutput">a.write_some_at(o, cb, ec);</code>
91                </p>
92              </td>
93<td>
94                <p>
95                  <code class="computeroutput">size_t</code>
96                </p>
97              </td>
98<td>
99                <p>
100                  Writes one or more bytes of data to the device <code class="computeroutput">a</code> at
101                  offset <code class="computeroutput">o</code>.<br> <br> The constant buffer sequence
102                  <code class="computeroutput">cb</code> specifies memory where the data to be written is
103                  located. The <code class="computeroutput">write_some_at</code> operation shall always
104                  write a buffer in the sequence completely before proceeding to
105                  the next.<br> <br> If successful, returns the number of bytes
106                  written and sets <code class="computeroutput">ec</code> such that <code class="computeroutput">!ec</code> is
107                  true. If an error occurred, returns <code class="computeroutput">0</code> and sets <code class="computeroutput">ec</code>
108                  such that <code class="computeroutput">!!ec</code> is true.<br> <br> If the total
109                  size of all buffers in the sequence <code class="computeroutput">cb</code> is <code class="computeroutput">0</code>,
110                  the function shall return <code class="computeroutput">0</code> immediately.
111                </p>
112              </td>
113</tr>
114</tbody>
115</table></div>
116</div>
117<br class="table-break">
118</div>
119<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
120<td align="left"></td>
121<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M.
122      Kohlhoff<p>
123        Distributed under the Boost Software License, Version 1.0. (See accompanying
124        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>)
125      </p>
126</div></td>
127</tr></table>
128<hr>
129<div class="spirit-nav">
130<a accesskey="p" href="SyncRandomAccessReadDevice.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="SyncReadStream.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
131</div>
132</body>
133</html>
134