Endpoint.qbk 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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:Endpoint Endpoint requirements]
  8. A type `X` meets the `Endpoint` requirements if it satisfies the requirements
  9. of `Destructible` (C++Std [destructible]), `DefaultConstructible` (C++Std
  10. [defaultconstructible]), `CopyConstructible` (C++Std [copyconstructible]),
  11. and `CopyAssignable` (C++Std [copyassignable]), as well as the additional
  12. requirements listed below.
  13. The default constructor and move operations of the type `X` shall not exit via
  14. an exception.
  15. In the table below, `a` denotes a (possibly const) value of type `X`, and `u`
  16. denotes an identifier.
  17. [table Endpoint requirements
  18. [[expression] [type] [assertion/note\npre/post-conditions]]
  19. [
  20. [`X::protocol_type`]
  21. [type meeting [link boost_asio.reference.Protocol `Protocol`] requirements]
  22. []
  23. ]
  24. [
  25. [`a.protocol()`]
  26. [`protocol_type`]
  27. []
  28. ]
  29. ]
  30. In the table below, `a` denotes a (possibly const) value of type `X`, `b`
  31. denotes a value of type `X`, and `s` denotes a (possibly const) value of a type
  32. that is convertible to `size_t` and denotes a size in bytes.
  33. [table Endpoint requirements for extensible implementations
  34. [[expression] [type] [assertion/note\npre/post-conditions]]
  35. [
  36. [`a.data()`]
  37. [`const void*`]
  38. [
  39. Returns a pointer suitable for passing as the /address/ argument to
  40. functions such as __POSIX__ __connect__, or as the /dest_addr/ argument
  41. to functions such as __POSIX__ __sendto__. The implementation shall
  42. perform a `static_cast` on the pointer to convert it to `const
  43. sockaddr*`.
  44. ]
  45. ]
  46. [
  47. [`b.data()`]
  48. [`void*`]
  49. [
  50. Returns a pointer suitable for passing as the /address/ argument to
  51. functions such as __POSIX__ __accept__, __getpeername__, __getsockname__
  52. and __recvfrom__. The implementation shall perform a `static_cast` on the
  53. pointer to convert it to `sockaddr*`.
  54. ]
  55. ]
  56. [
  57. [`a.size()`]
  58. [`size_t`]
  59. [
  60. Returns a value suitable for passing as the /address_len/ argument
  61. to functions such as __POSIX__ __connect__, or as the /dest_len/ argument
  62. to functions such as __POSIX__ __sendto__, after appropriate integer
  63. conversion has been performed.
  64. ]
  65. ]
  66. [
  67. [`b.resize(s)`]
  68. []
  69. [
  70. pre: `s >= 0`\n
  71. post: `a.size() == s`\n
  72. Passed the value contained in the /address_len/ argument to functions
  73. such as __POSIX__ __accept__, __getpeername__, __getsockname__ and
  74. __recvfrom__, after successful completion of the function. Permitted to
  75. throw an exception if the protocol associated with the endpoint object
  76. `a` does not support the specified size.
  77. ]
  78. ]
  79. [
  80. [`a.capacity()`]
  81. [`size_t`]
  82. [
  83. Returns a value suitable for passing as the /address_len/ argument to
  84. functions such as __POSIX__ __accept__, __getpeername__, __getsockname__
  85. and __recvfrom__, after appropriate integer conversion has been performed.
  86. ]
  87. ]
  88. ]
  89. [endsect]