AsyncRandomAccessReadDevice.qbk 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. [/
  2. / Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  3. /
  4. / Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. /]
  7. [section:AsyncRandomAccessReadDevice Buffer-oriented asynchronous random-access
  8. read device requirements]
  9. In the table below, `a` denotes an asynchronous random access read device
  10. object, `o` denotes an offset of type `boost::uint64_t`, `mb` denotes an object
  11. satisfying [link boost_asio.reference.MutableBufferSequence mutable buffer sequence]
  12. requirements, and `h` denotes an object satisfying [link
  13. boost_asio.reference.ReadHandler read handler] requirements.
  14. [table Buffer-oriented asynchronous random-access read device requirements
  15. [[operation] [type] [semantics, pre/post-conditions]]
  16. [
  17. [`a.get_executor()`]
  18. [A type satisfying the [link boost_asio.reference.Executor1 Executor requirements].]
  19. [Returns the associated I/O executor.]
  20. ]
  21. [
  22. [`a.async_read_some_at(o, mb, h);`]
  23. [`void`]
  24. [
  25. Initiates an asynchronous operation to read one or more bytes of data
  26. from the device `a` at the offset `o`. The operation is performed via the
  27. `io_service` object `a.get_io_service()` and behaves according to [link
  28. boost_asio.reference.asynchronous_operations asynchronous operation]
  29. requirements.\n
  30. \n
  31. The mutable buffer sequence `mb` specifies memory where the data should
  32. be placed. The `async_read_some_at` operation shall always fill a buffer
  33. in the sequence completely before proceeding to the next.\n
  34. \n
  35. The implementation shall maintain one or more copies of `mb` until such
  36. time as the read operation no longer requires access to the memory
  37. specified by the buffers in the sequence. The program must ensure the
  38. memory is valid until:\n
  39. \n
  40. [mdash] the last copy of `mb` is destroyed, or\n
  41. \n
  42. [mdash] the handler for the asynchronous read operation is invoked,\n
  43. \n
  44. whichever comes first.\n
  45. \n
  46. If the total size of all buffers in the sequence `mb` is `0`, the
  47. asynchronous read operation shall complete immediately and pass `0` as
  48. the argument to the handler that specifies the number of bytes read.
  49. ]
  50. ]
  51. ]
  52. [endsect]