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