SyncWriteStream.qbk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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:SyncWriteStream Buffer-oriented synchronous write stream requirements]
  8. A type `X` meets the `SyncWriteStream` requirements if it satisfies the
  9. requirements listed below.
  10. In the table below, `a` denotes a value of type `X`, `cb` denotes a (possibly
  11. const) value satisfying the [link boost_asio.reference.ConstBufferSequence
  12. `ConstBufferSequence`] requirements, and `ec` denotes an object of type
  13. `error_code`.
  14. [table SyncWriteStream requirements
  15. [[operation] [type] [semantics, pre/post-conditions]]
  16. [
  17. [`a.write_some(cb)`\n
  18. `a.write_some(cb,ec)`]
  19. [`size_t`]
  20. [
  21. Meets the requirements for a [link boost_asio.reference.read_write_operations
  22. write operation].\n
  23. \n
  24. If `buffer_size(cb) > 0`, writes one or more bytes of data to the stream
  25. `a` from the buffer sequence `cb`. If successful, sets `ec` such that
  26. `!ec` is `true`, and returns the number of bytes written. If an error
  27. occurred, sets `ec` such that `!!ec` is `true`, and returns 0.\n
  28. \n
  29. If `buffer_size(cb) == 0`, the operation shall not block. Sets `ec` such
  30. that `!ec` is `true`, and returns 0.
  31. ]
  32. ]
  33. ]
  34. [endsect]