CompletionCondition.qbk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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:CompletionCondition Completion condition requirements]
  8. A ['completion condition] is a function object that is used with the algorithms
  9. [link boost_asio.reference.read `read`], [link boost_asio.reference.async_read
  10. `async_read`], [link boost_asio.reference.write `write`], and [link
  11. boost_asio.reference.async_write `async_write`] to determine when the algorithm has
  12. completed transferring data.
  13. A type `X` meets the `CompletionCondition` requirements if it satisfies the
  14. requirements of `Destructible` (C++Std [destructible]) and
  15. `MoveConstructible` (C++Std [moveconstructible]), as well as the additional
  16. requirements listed below.
  17. In the table below, `x` denotes a value of type `X`, `ec` denotes a (possibly
  18. const) value of type `error_code`, and `n` denotes a (possibly const) value of
  19. type `size_t`.
  20. [table CompletionCondition requirements
  21. [[expression] [return type] [assertion/note\npre/post-condition]]
  22. [
  23. [`x(ec, n)`]
  24. [`size_t`]
  25. [
  26. Let `n` be the total number of bytes transferred by the read or write
  27. algorithm so far.\n
  28. \n
  29. Returns the maximum number of bytes to be transferred on the next
  30. `read_some`, `async_read_some`, `write_some`, or `async_write_some`
  31. operation performed by the algorithm. Returns `0` to indicate that the
  32. algorithm is complete.
  33. ]
  34. ]
  35. ]
  36. [endsect]