SyncRandomAccessWriteDevice.qbk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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:SyncRandomAccessWriteDevice Buffer-oriented synchronous random-access
  8. write device requirements]
  9. In the table below, `a` denotes a synchronous random-access write device
  10. object, `o` denotes an offset of type `boost::uint64_t`, `cb` denotes an object
  11. satisfying [link boost_asio.reference.ConstBufferSequence constant buffer sequence]
  12. requirements, and `ec` denotes an object of type `error_code`.
  13. [table Buffer-oriented synchronous random-access write device requirements
  14. [[operation] [type] [semantics, pre/post-conditions]]
  15. [
  16. [`a.write_some_at(o, cb);`]
  17. [`size_t`]
  18. [Equivalent to:
  19. ``
  20. error_code ec;
  21. size_t s = a.write_some(o, cb, ec);
  22. if (ec) throw system_error(ec);
  23. return s;
  24. ``]
  25. ]
  26. [
  27. [`a.write_some_at(o, cb, ec);`]
  28. [`size_t`]
  29. [
  30. Writes one or more bytes of data to the device `a` at offset `o`.\n
  31. \n
  32. The constant buffer sequence `cb` specifies memory where the data to be
  33. written is located. The `write_some_at` operation shall always write a
  34. buffer in the sequence completely before proceeding to the next.\n
  35. \n
  36. If successful, returns the number of bytes written and sets `ec` such
  37. that `!ec` is true. If an error occurred, returns `0` and sets `ec` such
  38. that `!!ec` is true.\n
  39. \n
  40. If the total size of all buffers in the sequence `cb` is `0`, the
  41. function shall return `0` immediately.
  42. ]
  43. ]
  44. ]
  45. [endsect]