AsyncRandomAccessWriteDevice.qbk 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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:AsyncRandomAccessWriteDevice Buffer-oriented asynchronous
  8. random-access write device requirements]
  9. In the table below, `a` denotes an asynchronous write stream object, `o`
  10. denotes an offset of type `boost::uint64_t`, `cb` denotes an object satisfying
  11. [link boost_asio.reference.ConstBufferSequence constant buffer sequence]
  12. requirements, and `h` denotes an object satisfying [link
  13. boost_asio.reference.WriteHandler write handler] requirements.
  14. [table Buffer-oriented asynchronous random-access write 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_write_some_at(o, cb, h);`]
  23. [`void`]
  24. [
  25. Initiates an asynchronous operation to write one or more bytes of data to
  26. the device `a` at 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 constant buffer sequence `cb` specifies memory where the data to be
  32. written is located. The `async_write_some_at` operation shall always
  33. write a buffer in the sequence completely before proceeding to the
  34. next.\n
  35. \n
  36. The implementation shall maintain one or more copies of `cb` until such
  37. time as the write operation no longer requires access to the memory
  38. specified by the buffers in the sequence. The program must ensure the
  39. memory is valid until:\n
  40. \n
  41. [mdash] the last copy of `cb` is destroyed, or\n
  42. \n
  43. [mdash] the handler for the asynchronous write operation is invoked,\n
  44. \n
  45. whichever comes first.\n
  46. \n
  47. If the total size of all buffers in the sequence `cb` is `0`, the
  48. asynchronous write operation shall complete immediately and pass `0` as
  49. the argument to the handler that specifies the number of bytes written.
  50. ]
  51. ]
  52. ]
  53. [endsect]