Imported Upstream version 1.51.0
[platform/upstream/boost.git] / doc / html / boost_asio / reference / SyncRandomAccessReadDevice.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Buffer-oriented synchronous random-access read device requirements</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.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="StreamSocketService.html" title="Stream socket service requirements">
10 <link rel="next" href="SyncRandomAccessWriteDevice.html" title="Buffer-oriented synchronous random-access write device 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="StreamSocketService.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="SyncRandomAccessWriteDevice.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.SyncRandomAccessReadDevice"></a><a class="link" href="SyncRandomAccessReadDevice.html" title="Buffer-oriented synchronous random-access read device requirements">Buffer-oriented
28       synchronous random-access read device requirements</a>
29 </h3></div></div></div>
30 <p>
31         In the table below, <code class="computeroutput"><span class="identifier">a</span></code> denotes
32         a synchronous random-access read device object, <code class="computeroutput"><span class="identifier">o</span></code>
33         denotes an offset of type <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint64_t</span></code>,
34         <code class="computeroutput"><span class="identifier">mb</span></code> denotes an object satisfying
35         <a class="link" href="MutableBufferSequence.html" title="Mutable buffer sequence requirements">mutable buffer
36         sequence</a> requirements, and <code class="computeroutput"><span class="identifier">ec</span></code>
37         denotes an object of type <code class="computeroutput"><span class="identifier">error_code</span></code>.
38       </p>
39 <div class="table">
40 <a name="boost_asio.reference.SyncRandomAccessReadDevice.t0"></a><p class="title"><b>Table&#160;34.&#160;Buffer-oriented synchronous random-access read device requirements</b></p>
41 <div class="table-contents"><table class="table" summary="Buffer-oriented synchronous random-access read device requirements">
42 <colgroup>
43 <col>
44 <col>
45 <col>
46 </colgroup>
47 <thead><tr>
48 <th>
49                 <p>
50                   operation
51                 </p>
52               </th>
53 <th>
54                 <p>
55                   type
56                 </p>
57               </th>
58 <th>
59                 <p>
60                   semantics, pre/post-conditions
61                 </p>
62               </th>
63 </tr></thead>
64 <tbody>
65 <tr>
66 <td>
67                 <p>
68                   <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">read_some_at</span><span class="special">(</span><span class="identifier">o</span><span class="special">,</span>
69                   <span class="identifier">mb</span><span class="special">);</span></code>
70                 </p>
71               </td>
72 <td>
73                 <p>
74                   <code class="computeroutput"><span class="identifier">size_t</span></code>
75                 </p>
76               </td>
77 <td>
78                 <p>
79                   Equivalent to:
80 </p>
81 <pre class="programlisting"><span class="identifier">error_code</span> <span class="identifier">ec</span><span class="special">;</span>
82 <span class="identifier">size_t</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">a</span><span class="special">.</span><span class="identifier">read_some_at</span><span class="special">(</span><span class="identifier">o</span><span class="special">,</span> <span class="identifier">mb</span><span class="special">,</span> <span class="identifier">ec</span><span class="special">);</span>
83 <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ec</span><span class="special">)</span> <span class="keyword">throw</span> <span class="identifier">system_error</span><span class="special">(</span><span class="identifier">ec</span><span class="special">);</span>
84 <span class="keyword">return</span> <span class="identifier">s</span><span class="special">;</span>
85 </pre>
86 <p>
87                 </p>
88               </td>
89 </tr>
90 <tr>
91 <td>
92                 <p>
93                   <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">read_some_at</span><span class="special">(</span><span class="identifier">o</span><span class="special">,</span>
94                   <span class="identifier">mb</span><span class="special">,</span>
95                   <span class="identifier">ec</span><span class="special">);</span></code>
96                 </p>
97               </td>
98 <td>
99                 <p>
100                   <code class="computeroutput"><span class="identifier">size_t</span></code>
101                 </p>
102               </td>
103 <td>
104                 <p>
105                   Reads one or more bytes of data from the device <code class="computeroutput"><span class="identifier">a</span></code>
106                   at offset <code class="computeroutput"><span class="identifier">o</span></code>.<br>
107                   <br> The mutable buffer sequence <code class="computeroutput"><span class="identifier">mb</span></code>
108                   specifies memory where the data should be placed. The <code class="computeroutput"><span class="identifier">read_some_at</span></code> operation shall
109                   always fill a buffer in the sequence completely before proceeding
110                   to the next.<br> <br> If successful, returns the number of
111                   bytes read and sets <code class="computeroutput"><span class="identifier">ec</span></code>
112                   such that <code class="computeroutput"><span class="special">!</span><span class="identifier">ec</span></code>
113                   is true. If an error occurred, returns <code class="computeroutput"><span class="number">0</span></code>
114                   and sets <code class="computeroutput"><span class="identifier">ec</span></code> such
115                   that <code class="computeroutput"><span class="special">!!</span><span class="identifier">ec</span></code>
116                   is true.<br> <br> If the total size of all buffers in the sequence
117                   <code class="computeroutput"><span class="identifier">mb</span></code> is <code class="computeroutput"><span class="number">0</span></code>, the function shall return <code class="computeroutput"><span class="number">0</span></code> immediately.
118                 </p>
119               </td>
120 </tr>
121 </tbody>
122 </table></div>
123 </div>
124 <br class="table-break">
125 </div>
126 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
127 <td align="left"></td>
128 <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2012 Christopher M. Kohlhoff<p>
129         Distributed under the Boost Software License, Version 1.0. (See accompanying
130         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>)
131       </p>
132 </div></td>
133 </tr></table>
134 <hr>
135 <div class="spirit-nav">
136 <a accesskey="p" href="StreamSocketService.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="SyncRandomAccessWriteDevice.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
137 </div>
138 </body>
139 </html>