Endpoint.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Endpoint requirements</title>
  5. <link rel="stylesheet" href="../../boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
  7. <link rel="home" href="../../index.html" title="Asio">
  8. <link rel="up" href="../reference.html" title="Reference">
  9. <link rel="prev" href="DescriptorService.html" title="Descriptor service requirements">
  10. <link rel="next" href="GettableSerialPortOption.html" title="Gettable serial port option requirements">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../asio.png"></td></tr></table>
  14. <hr>
  15. <div class="spirit-nav">
  16. <a accesskey="p" href="DescriptorService.html"><img src="../../prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../home.png" alt="Home"></a><a accesskey="n" href="GettableSerialPortOption.html"><img src="../../next.png" alt="Next"></a>
  17. </div>
  18. <div class="section">
  19. <div class="titlepage"><div><div><h3 class="title">
  20. <a name="asio.reference.Endpoint"></a><a class="link" href="Endpoint.html" title="Endpoint requirements">Endpoint requirements</a>
  21. </h3></div></div></div>
  22. <p>
  23. An endpoint must meet the requirements of <code class="computeroutput"><span class="identifier">CopyConstructible</span></code>
  24. types (C++ Std, 20.1.3), and the requirements of <code class="computeroutput"><span class="identifier">Assignable</span></code>
  25. types (C++ Std, 23.1).
  26. </p>
  27. <p>
  28. In the table below, <code class="computeroutput"><span class="identifier">X</span></code> denotes
  29. an endpoint class, <code class="computeroutput"><span class="identifier">a</span></code> denotes
  30. a value of type <code class="computeroutput"><span class="identifier">X</span></code>, <code class="computeroutput"><span class="identifier">s</span></code> denotes a size in bytes, and <code class="computeroutput"><span class="identifier">u</span></code> denotes an identifier.
  31. </p>
  32. <div class="table">
  33. <a name="asio.reference.Endpoint.t0"></a><p class="title"><b>Table&#160;10.&#160;Endpoint requirements</b></p>
  34. <div class="table-contents"><table class="table" summary="Endpoint requirements">
  35. <colgroup>
  36. <col>
  37. <col>
  38. <col>
  39. </colgroup>
  40. <thead><tr>
  41. <th>
  42. <p>
  43. expression
  44. </p>
  45. </th>
  46. <th>
  47. <p>
  48. type
  49. </p>
  50. </th>
  51. <th>
  52. <p>
  53. assertion/note<br> pre/post-conditions
  54. </p>
  55. </th>
  56. </tr></thead>
  57. <tbody>
  58. <tr>
  59. <td>
  60. <p>
  61. <code class="computeroutput"><span class="identifier">X</span><span class="special">::</span><span class="identifier">protocol_type</span></code>
  62. </p>
  63. </td>
  64. <td>
  65. <p>
  66. type meeting <a class="link" href="Protocol.html" title="Protocol requirements">protocol</a>
  67. requirements
  68. </p>
  69. </td>
  70. <td>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td>
  75. <p>
  76. <code class="computeroutput"><span class="identifier">X</span> <span class="identifier">u</span><span class="special">;</span></code>
  77. </p>
  78. </td>
  79. <td>
  80. </td>
  81. <td>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td>
  86. <p>
  87. <code class="computeroutput"><span class="identifier">X</span><span class="special">();</span></code>
  88. </p>
  89. </td>
  90. <td>
  91. </td>
  92. <td>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td>
  97. <p>
  98. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">protocol</span><span class="special">();</span></code>
  99. </p>
  100. </td>
  101. <td>
  102. <p>
  103. <code class="computeroutput"><span class="identifier">protocol_type</span></code>
  104. </p>
  105. </td>
  106. <td>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td>
  111. <p>
  112. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">data</span><span class="special">();</span></code>
  113. </p>
  114. </td>
  115. <td>
  116. <p>
  117. a pointer
  118. </p>
  119. </td>
  120. <td>
  121. <p>
  122. Returns a pointer suitable for passing as the <span class="emphasis"><em>address</em></span>
  123. argument to <span class="emphasis"><em>POSIX</em></span> functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/accept.html" target="_top"><code class="computeroutput"><span class="identifier">accept</span><span class="special">()</span></code></a>,
  124. <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getpeername.html" target="_top"><code class="computeroutput"><span class="identifier">getpeername</span><span class="special">()</span></code></a>,
  125. <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getsockname.html" target="_top"><code class="computeroutput"><span class="identifier">getsockname</span><span class="special">()</span></code></a>
  126. and <a href="http://www.opengroup.org/onlinepubs/000095399/functions/recvfrom.html" target="_top"><code class="computeroutput"><span class="identifier">recvfrom</span><span class="special">()</span></code></a>.
  127. The implementation shall perform a <code class="computeroutput"><span class="keyword">reinterpret_cast</span></code>
  128. on the pointer to convert it to <code class="computeroutput"><span class="identifier">sockaddr</span><span class="special">*</span></code>.
  129. </p>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td>
  134. <p>
  135. <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">X</span><span class="special">&amp;</span> <span class="identifier">u</span>
  136. <span class="special">=</span> <span class="identifier">a</span><span class="special">;</span> <span class="identifier">u</span><span class="special">.</span><span class="identifier">data</span><span class="special">();</span></code>
  137. </p>
  138. </td>
  139. <td>
  140. <p>
  141. a pointer
  142. </p>
  143. </td>
  144. <td>
  145. <p>
  146. Returns a pointer suitable for passing as the <span class="emphasis"><em>address</em></span>
  147. argument to <span class="emphasis"><em>POSIX</em></span> functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/connect.html" target="_top"><code class="computeroutput"><span class="identifier">connect</span><span class="special">()</span></code></a>,
  148. or as the <span class="emphasis"><em>dest_addr</em></span> argument to <span class="emphasis"><em>POSIX</em></span>
  149. functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/sendto.html" target="_top"><code class="computeroutput"><span class="identifier">sendto</span><span class="special">()</span></code></a>.
  150. The implementation shall perform a <code class="computeroutput"><span class="keyword">reinterpret_cast</span></code>
  151. on the pointer to convert it to <code class="computeroutput"><span class="keyword">const</span>
  152. <span class="identifier">sockaddr</span><span class="special">*</span></code>.
  153. </p>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td>
  158. <p>
  159. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span></code>
  160. </p>
  161. </td>
  162. <td>
  163. <p>
  164. <code class="computeroutput"><span class="identifier">size_t</span></code>
  165. </p>
  166. </td>
  167. <td>
  168. <p>
  169. Returns a value suitable for passing as the <span class="emphasis"><em>address_len</em></span>
  170. argument to <span class="emphasis"><em>POSIX</em></span> functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/connect.html" target="_top"><code class="computeroutput"><span class="identifier">connect</span><span class="special">()</span></code></a>,
  171. or as the <span class="emphasis"><em>dest_len</em></span> argument to <span class="emphasis"><em>POSIX</em></span>
  172. functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/sendto.html" target="_top"><code class="computeroutput"><span class="identifier">sendto</span><span class="special">()</span></code></a>,
  173. after appropriate integer conversion has been performed.
  174. </p>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td>
  179. <p>
  180. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="identifier">s</span><span class="special">);</span></code>
  181. </p>
  182. </td>
  183. <td>
  184. </td>
  185. <td>
  186. <p>
  187. post: <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span>
  188. <span class="special">==</span> <span class="identifier">s</span></code><br>
  189. Passed the value contained in the <span class="emphasis"><em>address_len</em></span>
  190. argument to <span class="emphasis"><em>POSIX</em></span> functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/accept.html" target="_top"><code class="computeroutput"><span class="identifier">accept</span><span class="special">()</span></code></a>,
  191. <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getpeername.html" target="_top"><code class="computeroutput"><span class="identifier">getpeername</span><span class="special">()</span></code></a>,
  192. <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getsockname.html" target="_top"><code class="computeroutput"><span class="identifier">getsockname</span><span class="special">()</span></code></a>
  193. and <a href="http://www.opengroup.org/onlinepubs/000095399/functions/recvfrom.html" target="_top"><code class="computeroutput"><span class="identifier">recvfrom</span><span class="special">()</span></code></a>,
  194. after successful completion of the function. Permitted to throw
  195. an exception if the protocol associated with the endpoint object
  196. <code class="computeroutput"><span class="identifier">a</span></code> does not support
  197. the specified size.
  198. </p>
  199. </td>
  200. </tr>
  201. <tr>
  202. <td>
  203. <p>
  204. <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">();</span></code>
  205. </p>
  206. </td>
  207. <td>
  208. <p>
  209. <code class="computeroutput"><span class="identifier">size_t</span></code>
  210. </p>
  211. </td>
  212. <td>
  213. <p>
  214. Returns a value suitable for passing as the <span class="emphasis"><em>address_len</em></span>
  215. argument to <span class="emphasis"><em>POSIX</em></span> functions such as <a href="http://www.opengroup.org/onlinepubs/000095399/functions/accept.html" target="_top"><code class="computeroutput"><span class="identifier">accept</span><span class="special">()</span></code></a>,
  216. <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getpeername.html" target="_top"><code class="computeroutput"><span class="identifier">getpeername</span><span class="special">()</span></code></a>,
  217. <a href="http://www.opengroup.org/onlinepubs/000095399/functions/getsockname.html" target="_top"><code class="computeroutput"><span class="identifier">getsockname</span><span class="special">()</span></code></a>
  218. and <a href="http://www.opengroup.org/onlinepubs/000095399/functions/recvfrom.html" target="_top"><code class="computeroutput"><span class="identifier">recvfrom</span><span class="special">()</span></code></a>,
  219. after appropriate integer conversion has been performed.
  220. </p>
  221. </td>
  222. </tr>
  223. </tbody>
  224. </table></div>
  225. </div>
  226. <br class="table-break">
  227. </div>
  228. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  229. <td align="left"></td>
  230. <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2014 Christopher M. Kohlhoff<p>
  231. Distributed under the Boost Software License, Version 1.0. (See accompanying
  232. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  233. </p>
  234. </div></td>
  235. </tr></table>
  236. <hr>
  237. <div class="spirit-nav">
  238. <a accesskey="p" href="DescriptorService.html"><img src="../../prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../home.png" alt="Home"></a><a accesskey="n" href="GettableSerialPortOption.html"><img src="../../next.png" alt="Next"></a>
  239. </div>
  240. </body>
  241. </html>