Add type requirements for new features.
diff --git a/asio/src/doc/reference.xsl b/asio/src/doc/reference.xsl index 18fdcd3..4521d07 100644 --- a/asio/src/doc/reference.xsl +++ b/asio/src/doc/reference.xsl
@@ -60,6 +60,7 @@ [include requirements/IoControlCommand.qbk] [include requirements/IoObjectService.qbk] [include requirements/MutableBufferSequence.qbk] +[include requirements/ObjectHandleService.qbk] [include requirements/Protocol.qbk] [include requirements/RandomAccessHandleService.qbk] [include requirements/RawSocketService.qbk] @@ -85,7 +86,9 @@ [include requirements/SyncWriteStream.qbk] [include requirements/TimeTraits.qbk] [include requirements/TimerService.qbk] +[include requirements/WaitableTimerService.qbk] [include requirements/WaitHandler.qbk] +[include requirements/WaitTraits.qbk] [include requirements/WriteHandler.qbk] </xsl:text>
diff --git a/asio/src/doc/requirements/ObjectHandleService.qbk b/asio/src/doc/requirements/ObjectHandleService.qbk new file mode 100644 index 0000000..4fbe00d --- /dev/null +++ b/asio/src/doc/requirements/ObjectHandleService.qbk
@@ -0,0 +1,46 @@ +[/ + / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) + / + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /] + +[section:ObjectHandleService Object handle service requirements] + +An object handle service must meet the requirements for a [link +asio.reference.HandleService handle service], as well as the additional +requirements listed below. + +In the table below, `X` denotes an object handle service class, `a` denotes a +value of type `X`, `b` denotes a value of type `X::implementation_type`, `ec` +denotes a value of type `error_code`, and `wh` denotes a value meeting [link +asio.reference.WaitHandler `WaitHandler`] requirements. + +[table ObjectHandleService requirements + [[expression] [return type] [assertion/note\npre/post-condition]] + [ + [`a.wait(b, ec);`] + [`error_code`] + [ + pre: `a.is_open(b)`.\n + \n + Synchronously waits for the object represented by handle `b` to become + signalled. + ] + ] + [ + [`a.async_wait(b, wh);`] + [`void`] + [ + pre: `a.is_open(b)`.\n + \n + Initiates an asynchronous operation to wait for the object represented by + handle `b` to become signalled. The operation is performed via the + `io_service` object `a.get_io_service()` and behaves according to [link + asio.reference.asynchronous_operations asynchronous operation] + requirements. + ] + ] +] + +[endsect]
diff --git a/asio/src/doc/requirements/WaitTraits.qbk b/asio/src/doc/requirements/WaitTraits.qbk new file mode 100644 index 0000000..1514e3d --- /dev/null +++ b/asio/src/doc/requirements/WaitTraits.qbk
@@ -0,0 +1,26 @@ +[/ + / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) + / + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /] + +[section:WaitTraits Wait traits requirements] + +In the table below, `X` denotes a wait traits class for clock type `Clock`, +where `Clock` meets the C++11 type requirements for a clock, and `d` denotes +a value of type `Clock::duration`. + +[table WaitTraits requirements + [[expression] [return type] [assertion/note\npre/post-condition]] + [ + [`X::to_wait_duration(d);`] + [`Clock::duration`] + [ + Returns the maximum duration to be used for an individual, + implementation-defined wait operation. + ] + ] +] + +[endsect]
diff --git a/asio/src/doc/requirements/WaitableTimerService.qbk b/asio/src/doc/requirements/WaitableTimerService.qbk new file mode 100644 index 0000000..6026a60 --- /dev/null +++ b/asio/src/doc/requirements/WaitableTimerService.qbk
@@ -0,0 +1,104 @@ +[/ + / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) + / + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /] + +[section:WaitableTimerService Waitable timer service requirements] + +A waitable timer service must meet the requirements for an [link +asio.reference.IoObjectService I/O object service], as well as the +additional requirements listed below. + +In the table below, `X` denotes a waitable timer service class for clock type +`Clock`, where `Clock` meets the C++11 clock type requirements, `a` denotes a +value of type `X`, `b` denotes a value of type `X::implementation_type`, `t` +denotes a value of type `Clock::time_point`, `d` denotes a value of type +`Clock::duration`, `e` denotes a value of type `error_code`, and `h` denotes a +value meeting [link asio.reference.WaitHandler `WaitHandler`] requirements. + +[table WaitableTimerService requirements + [[expression] [return type] [assertion/note\npre/post-condition]] + [ + [`a.destroy(b);`] + [] + [ + From [link asio.reference.IoObjectService IoObjectService] + requirements. Implicitly cancels asynchronous wait operations, as if by + calling `a.cancel(b, e)`. + ] + ] + [ + [`` + a.cancel(b, e); + ``] + [`size_t`] + [ + Causes any outstanding asynchronous wait operations to complete as soon + as possible. Handlers for cancelled operations shall be passed the error + code `error::operation_aborted`. Sets `e` to indicate success or failure. + Returns the number of operations that were cancelled. + ] + ] + [ + [`a.expires_at(b);`] + [`Clock::time_point`] + [] + ] + [ + [`` + a.expires_at(b, t, e); + ``] + [`size_t`] + [ + Implicitly cancels asynchronous wait operations, as if by calling + `a.cancel(b, e)`. Returns the number of operations that were cancelled.\n + post: `a.expires_at(b) == t`. + ] + ] + [ + [`a.expires_from_now(b);`] + [`Clock::duration`] + [ + Returns a value equivalent to `a.expires_at(b) - Clock::now()`. + ] + ] + [ + [`` + a.expires_from_now(b, d, e); + ``] + [`size_t`] + [ + Equivalent to `a.expires_at(b, Clock::now() + d, e)`. + ] + ] + [ + [`` + a.wait(b, e); + ``] + [`error_code`] + [ + Sets `e` to indicate success or failure. Returns `e`.\n + post: `!!e || !(Clock::now() < a.expires_at(b))`. + ] + ] + [ + [`` + a.async_wait(b, h); + ``] + [] + [ + Initiates an asynchronous wait operation that is performed via the + `io_service` object `a.get_io_service()` and behaves according to [link + asio.reference.asynchronous_operations asynchronous operation] + requirements.\n + \n + The handler shall be posted for execution only if the condition + `!!ec || !(Clock::now() < a.expires_at(b))` + holds, where `ec` is the error code to be passed to the handler. + ] + ] +] + +[endsect]