]>
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:AsyncRandomAccessReadDevice Buffer-oriented asynchronous random-access | |
9 | read device requirements] | |
10 | ||
11 | In the table below, `a` denotes an asynchronous random access read device | |
12 | object, `o` denotes an offset of type `boost::uint64_t`, `mb` denotes an object | |
13 | satisfying [link boost_asio.reference.MutableBufferSequence mutable buffer sequence] | |
14 | requirements, and `h` denotes an object satisfying [link | |
15 | boost_asio.reference.ReadHandler read handler] requirements. | |
16 | ||
17 | [table Buffer-oriented asynchronous random-access read 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_read_some_at` | |
23 | handler `h` will be invoked.] | |
24 | ] | |
25 | [ | |
26 | [`a.async_read_some_at(o, mb, h);`] | |
27 | [`void`] | |
28 | [ | |
29 | Initiates an asynchronous operation to read one or more bytes of data | |
30 | from the device `a` at the 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 mutable buffer sequence `mb` specifies memory where the data should | |
36 | be placed. The `async_read_some_at` operation shall always fill a buffer | |
37 | in the sequence completely before proceeding to the next.\n | |
38 | \n | |
39 | The implementation shall maintain one or more copies of `mb` until such | |
40 | time as the read operation no longer requires access to the memory | |
41 | specified by the buffers in the sequence. The program must ensure the | |
42 | memory is valid until:\n | |
43 | \n | |
44 | [mdash] the last copy of `mb` is destroyed, or\n | |
45 | \n | |
46 | [mdash] the handler for the asynchronous read operation is invoked,\n | |
47 | \n | |
48 | whichever comes first.\n | |
49 | \n | |
50 | If the total size of all buffers in the sequence `mb` is `0`, the | |
51 | asynchronous read operation shall complete immediately and pass `0` as | |
52 | the argument to the handler that specifies the number of bytes read. | |
53 | ] | |
54 | ] | |
55 | ] | |
56 | ||
57 | [endsect] |