Imported Upstream version 1.64.0
[platform/upstream/boost.git] / libs / asio / doc / requirements / AsyncRandomAccessWriteDevice.qbk
1 [/
2  / Copyright (c) 2003-2017 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:AsyncRandomAccessWriteDevice Buffer-oriented asynchronous
9 random-access write device requirements]
10
11 In the table below, `a` denotes an asynchronous write stream object, `o`
12 denotes an offset of type `boost::uint64_t`, `cb` denotes an object satisfying
13 [link boost_asio.reference.ConstBufferSequence constant buffer sequence]
14 requirements, and `h` denotes an object satisfying [link
15 boost_asio.reference.WriteHandler write handler] requirements.
16
17 [table Buffer-oriented asynchronous random-access write device requirements
18   [[operation] [type] [semantics, pre/post-conditions]]
19   [
20     [`a.get_io_service();`]
21     [`io_service&`]
22     [Returns the `io_service` object through which the `async_write_some_at`
23     handler `h` will be invoked.]
24   ]
25   [
26     [`a.async_write_some_at(o, cb, h);`]
27     [`void`]
28     [
29       Initiates an asynchronous operation to write one or more bytes of data to
30       the device `a` at offset `o`. The operation is performed via the
31       `io_service` object `a.get_io_service()` and behaves according to [link
32       boost_asio.reference.asynchronous_operations asynchronous operation]
33       requirements.\n
34       \n
35       The constant buffer sequence `cb` specifies memory where the data to be
36       written is located. The `async_write_some_at` operation shall always
37       write a buffer in the sequence completely before proceeding to the
38       next.\n
39       \n
40       The implementation shall maintain one or more copies of `cb` until such
41       time as the write operation no longer requires access to the memory
42       specified by the buffers in the sequence. The program must ensure the
43       memory is valid until:\n
44       \n
45       [mdash] the last copy of `cb` is destroyed, or\n
46       \n
47       [mdash] the handler for the asynchronous write operation is invoked,\n
48       \n
49       whichever comes first.\n
50       \n
51       If the total size of all buffers in the sequence `cb` is `0`, the
52       asynchronous write operation shall complete immediately and pass `0` as
53       the argument to the handler that specifies the number of bytes written.
54     ]
55   ]
56 ]
57
58 [endsect]