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