]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/doc/requirements/WaitableTimerService.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / asio / doc / requirements / WaitableTimerService.qbk
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:WaitableTimerService Waitable timer service requirements]
9
10 A waitable timer service must meet the requirements for an [link
11 boost_asio.reference.IoObjectService I/O object service], as well as the
12 additional requirements listed below.
13
14 In the table below, `X` denotes a waitable timer service class for clock type
15 `Clock`, where `Clock` meets the C++11 clock type requirements, `a` denotes a
16 value of type `X`, `b` denotes a value of type `X::implementation_type`, `t`
17 denotes a value of type `Clock::time_point`, `d` denotes a value of type
18 `Clock::duration`, `e` denotes a value of type `error_code`, and `h` denotes a
19 value meeting [link boost_asio.reference.WaitHandler `WaitHandler`] requirements.
20
21 [table WaitableTimerService requirements
22 [[expression] [return type] [assertion/note\npre/post-condition]]
23 [
24 [`a.destroy(b);`]
25 []
26 [
27 From [link boost_asio.reference.IoObjectService IoObjectService]
28 requirements. Implicitly cancels asynchronous wait operations, as if by
29 calling `a.cancel(b, e)`.
30 ]
31 ]
32 [
33 [``
34 a.cancel(b, e);
35 ``]
36 [`size_t`]
37 [
38 Causes any outstanding asynchronous wait operations to complete as soon
39 as possible. Handlers for cancelled operations shall be passed the error
40 code `error::operation_aborted`. Sets `e` to indicate success or failure.
41 Returns the number of operations that were cancelled.
42 ]
43 ]
44 [
45 [`a.expires_at(b);`]
46 [`Clock::time_point`]
47 []
48 ]
49 [
50 [``
51 a.expires_at(b, t, e);
52 ``]
53 [`size_t`]
54 [
55 Implicitly cancels asynchronous wait operations, as if by calling
56 `a.cancel(b, e)`. Returns the number of operations that were cancelled.\n
57 post: `a.expires_at(b) == t`.
58 ]
59 ]
60 [
61 [`a.expires_from_now(b);`]
62 [`Clock::duration`]
63 [
64 Returns a value equivalent to `a.expires_at(b) - Clock::now()`.
65 ]
66 ]
67 [
68 [``
69 a.expires_from_now(b, d, e);
70 ``]
71 [`size_t`]
72 [
73 Equivalent to `a.expires_at(b, Clock::now() + d, e)`.
74 ]
75 ]
76 [
77 [``
78 a.wait(b, e);
79 ``]
80 [`error_code`]
81 [
82 Sets `e` to indicate success or failure. Returns `e`.\n
83 post: `!!e || !(Clock::now() < a.expires_at(b))`.
84 ]
85 ]
86 [
87 [``
88 a.async_wait(b, h);
89 ``]
90 []
91 [
92 Initiates an asynchronous wait operation that is performed via the
93 `io_service` object `a.get_io_service()` and behaves according to [link
94 boost_asio.reference.asynchronous_operations asynchronous operation]
95 requirements.\n
96 \n
97 The handler shall be posted for execution only if the condition
98 `!!ec || !(Clock::now() < a.expires_at(b))`
99 holds, where `ec` is the error code to be passed to the handler.
100 ]
101 ]
102 ]
103
104 [endsect]