AsyncRandomAccessReadDevice.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Buffer-oriented asynchronous random-access read device requirements</title>
  5. <link rel="stylesheet" href="../../boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
  7. <link rel="home" href="../../index.html" title="Asio">
  8. <link rel="up" href="../reference.html" title="Reference">
  9. <link rel="prev" href="AcceptHandler.html" title="Accept handler requirements">
  10. <link rel="next" href="AsyncRandomAccessWriteDevice.html" title="Buffer-oriented asynchronous 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><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../asio.png"></td></tr></table>
  14. <hr>
  15. <div class="spirit-nav">
  16. <a accesskey="p" href="AcceptHandler.html"><img src="../../prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../home.png" alt="Home"></a><a accesskey="n" href="AsyncRandomAccessWriteDevice.html"><img src="../../next.png" alt="Next"></a>
  17. </div>
  18. <div class="section">
  19. <div class="titlepage"><div><div><h3 class="title">
  20. <a name="asio.reference.AsyncRandomAccessReadDevice"></a><a class="link" href="AsyncRandomAccessReadDevice.html" title="Buffer-oriented asynchronous random-access read device requirements">Buffer-oriented
  21. asynchronous random-access read device requirements</a>
  22. </h3></div></div></div>
  23. <p>
  24. In the table below, <code class="computeroutput"><span class="identifier">a</span></code> denotes
  25. an asynchronous random access read device object, <code class="computeroutput"><span class="identifier">o</span></code>
  26. denotes an offset of type <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint64_t</span></code>,
  27. <code class="computeroutput"><span class="identifier">mb</span></code> denotes an object satisfying
  28. <a class="link" href="MutableBufferSequence.html" title="Mutable buffer sequence requirements">mutable buffer sequence</a>
  29. requirements, and <code class="computeroutput"><span class="identifier">h</span></code> denotes
  30. an object satisfying <a class="link" href="ReadHandler.html" title="Read handler requirements">read handler</a>
  31. requirements.
  32. </p>
  33. <div class="table">
  34. <a name="asio.reference.AsyncRandomAccessReadDevice.t0"></a><p class="title"><b>Table&#160;1.&#160;Buffer-oriented asynchronous random-access read device requirements</b></p>
  35. <div class="table-contents"><table class="table" summary="Buffer-oriented asynchronous random-access read device requirements">
  36. <colgroup>
  37. <col>
  38. <col>
  39. <col>
  40. </colgroup>
  41. <thead><tr>
  42. <th>
  43. <p>
  44. operation
  45. </p>
  46. </th>
  47. <th>
  48. <p>
  49. type
  50. </p>
  51. </th>
  52. <th>
  53. <p>
  54. semantics, pre/post-conditions
  55. </p>
  56. </th>
  57. </tr></thead>
  58. <tbody>
  59. <tr>
  60. <td>
  61. <p>
  62. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">get_io_service</span><span class="special">();</span></code>
  63. </p>
  64. </td>
  65. <td>
  66. <p>
  67. <code class="computeroutput"><span class="identifier">io_service</span><span class="special">&amp;</span></code>
  68. </p>
  69. </td>
  70. <td>
  71. <p>
  72. Returns the <code class="computeroutput"><span class="identifier">io_service</span></code>
  73. object through which the <code class="computeroutput"><span class="identifier">async_read_some_at</span></code>
  74. handler <code class="computeroutput"><span class="identifier">h</span></code> will
  75. be invoked.
  76. </p>
  77. </td>
  78. </tr>
  79. <tr>
  80. <td>
  81. <p>
  82. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">async_read_some_at</span><span class="special">(</span><span class="identifier">o</span><span class="special">,</span>
  83. <span class="identifier">mb</span><span class="special">,</span>
  84. <span class="identifier">h</span><span class="special">);</span></code>
  85. </p>
  86. </td>
  87. <td>
  88. <p>
  89. <code class="computeroutput"><span class="keyword">void</span></code>
  90. </p>
  91. </td>
  92. <td>
  93. <p>
  94. Initiates an asynchronous operation to read one or more bytes of
  95. data from the device <code class="computeroutput"><span class="identifier">a</span></code>
  96. at the offset <code class="computeroutput"><span class="identifier">o</span></code>.
  97. The operation is performed via the <code class="computeroutput"><span class="identifier">io_service</span></code>
  98. object <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">get_io_service</span><span class="special">()</span></code>
  99. and behaves according to <a class="link" href="asynchronous_operations.html" title="Requirements on asynchronous operations">asynchronous
  100. operation</a> requirements.<br> <br> The mutable buffer
  101. sequence <code class="computeroutput"><span class="identifier">mb</span></code> specifies
  102. memory where the data should be placed. The <code class="computeroutput"><span class="identifier">async_read_some_at</span></code>
  103. operation shall always fill a buffer in the sequence completely
  104. before proceeding to the next.<br> <br> The implementation
  105. shall maintain one or more copies of <code class="computeroutput"><span class="identifier">mb</span></code>
  106. until such time as the read operation no longer requires access
  107. to the memory specified by the buffers in the sequence. The program
  108. must ensure the memory is valid until:<br> <br> &#8212; the last copy
  109. of <code class="computeroutput"><span class="identifier">mb</span></code> is destroyed,
  110. or<br> <br> &#8212; the handler for the asynchronous read operation
  111. is invoked,<br> <br> whichever comes first.<br> <br> If
  112. the total size of all buffers in the sequence <code class="computeroutput"><span class="identifier">mb</span></code>
  113. is <code class="computeroutput"><span class="number">0</span></code>, the asynchronous
  114. read operation shall complete immediately and pass <code class="computeroutput"><span class="number">0</span></code> as the argument to the handler
  115. that specifies the number of bytes read.
  116. </p>
  117. </td>
  118. </tr>
  119. </tbody>
  120. </table></div>
  121. </div>
  122. <br class="table-break">
  123. </div>
  124. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  125. <td align="left"></td>
  126. <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2014 Christopher M. Kohlhoff<p>
  127. Distributed under the Boost Software License, Version 1.0. (See accompanying
  128. 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>)
  129. </p>
  130. </div></td>
  131. </tr></table>
  132. <hr>
  133. <div class="spirit-nav">
  134. <a accesskey="p" href="AcceptHandler.html"><img src="../../prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../home.png" alt="Home"></a><a accesskey="n" href="AsyncRandomAccessWriteDevice.html"><img src="../../next.png" alt="Next"></a>
  135. </div>
  136. </body>
  137. </html>