]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | / Copyright (c) 2003-2016 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 | ||
8 | [section:HandleService Handle service requirements] | |
9 | ||
10 | A handle service must meet the requirements for an [link | |
11 | boost_asio.reference.IoObjectService I/O object service] with support for movability, | |
12 | as well as the additional requirements listed below. | |
13 | ||
14 | In the table below, `X` denotes a handle service class, `a` and `ao` denote | |
15 | values of type `X`, `b` and `c` denote values of type `X::implementation_type`, | |
16 | `n` denotes a value of type `X::native_handle_type`, `ec` denotes a value of | |
17 | type `error_code`, and `u` and `v` denote identifiers. | |
18 | ||
19 | [table HandleService requirements | |
20 | [[expression] [return type] [assertion/note\npre/post-condition]] | |
21 | [ | |
22 | [`X::native_handle_type`] | |
23 | [] | |
24 | [ | |
25 | The implementation-defined native representation of a handle. Must | |
26 | satisfy the requirements of `CopyConstructible` types (C++ Std, 20.1.3), | |
27 | and the requirements of `Assignable` types (C++ Std, 23.1). | |
28 | ] | |
29 | ] | |
30 | [ | |
31 | [`a.construct(b);`] | |
32 | [] | |
33 | [ | |
34 | From [link boost_asio.reference.IoObjectService IoObjectService] | |
35 | requirements.\n | |
36 | post: `!a.is_open(b)`. | |
37 | ] | |
38 | ] | |
39 | [ | |
40 | [`a.destroy(b);`] | |
41 | [] | |
42 | [ | |
43 | From [link boost_asio.reference.IoObjectService IoObjectService] | |
44 | requirements. Implicitly cancels asynchronous operations, as if by calling | |
45 | `a.close(b, ec)`. | |
46 | ] | |
47 | ] | |
48 | [ | |
49 | [`` | |
50 | a.move_construct(b, c); | |
51 | ``] | |
52 | [] | |
53 | [ | |
54 | From [link boost_asio.reference.IoObjectService IoObjectService] requirements. | |
55 | The underlying native representation is moved from `c` to `b`. | |
56 | ] | |
57 | ] | |
58 | [ | |
59 | [`` | |
60 | a.move_assign(b, ao, c); | |
61 | ``] | |
62 | [] | |
63 | [ | |
64 | From [link boost_asio.reference.IoObjectService IoObjectService] requirements. | |
65 | Implicitly cancels asynchronous operations associated with `b`, as if by | |
66 | calling `a.close(b, ec)`. Then the underlying native representation is | |
67 | moved from `c` to `b`. | |
68 | ] | |
69 | ] | |
70 | [ | |
71 | [`` | |
72 | a.assign(b, n, ec); | |
73 | ``] | |
74 | [`error_code`] | |
75 | [ | |
76 | pre: `!a.is_open(b)`.\n | |
77 | post: `!!ec || a.is_open(b)`. | |
78 | ] | |
79 | ] | |
80 | [ | |
81 | [`` | |
82 | a.is_open(b); | |
83 | ``] | |
84 | [`bool`] | |
85 | [ | |
86 | ] | |
87 | ] | |
88 | [ | |
89 | [`` | |
90 | const X& u = a; | |
91 | const X::implementation_type& v = b; | |
92 | u.is_open(v); | |
93 | ``] | |
94 | [`bool`] | |
95 | [ | |
96 | ] | |
97 | ] | |
98 | [ | |
99 | [`` | |
100 | a.close(b, ec); | |
101 | ``] | |
102 | [`error_code`] | |
103 | [ | |
104 | If `a.is_open()` is true, causes any outstanding asynchronous operations | |
105 | to complete as soon as possible. Handlers for cancelled operations shall | |
106 | be passed the error code `error::operation_aborted`.\n | |
107 | post: `!a.is_open(b)`. | |
108 | ] | |
109 | ] | |
110 | [ | |
111 | [`` | |
112 | a.native_handle(b); | |
113 | ``] | |
114 | [`X::native_handle_type`] | |
115 | [ | |
116 | ] | |
117 | ] | |
118 | [ | |
119 | [`` | |
120 | a.cancel(b, ec); | |
121 | ``] | |
122 | [`error_code`] | |
123 | [ | |
124 | pre: `a.is_open(b)`.\n | |
125 | Causes any outstanding asynchronous operations to complete as soon as | |
126 | possible. Handlers for cancelled operations shall be passed the error | |
127 | code `error::operation_aborted`. | |
128 | ] | |
129 | ] | |
130 | ] | |
131 | ||
132 | [endsect] |