~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to include/libtorrent/asio/read_at.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-08-10 12:59:37 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810125937-jbcmmf17y8yo9hgz
Tags: 0.15.0-0ubuntu1
* New upstream version.
* debian/patches/100_fix_html_docs.patch: refreshed.
* debian/control: bump up standards-version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// read_at.hpp
3
 
// ~~~~~~~~~~~
4
 
//
5
 
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6
 
//
7
 
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
 
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
 
//
10
 
 
11
 
#ifndef ASIO_READ_AT_HPP
12
 
#define ASIO_READ_AT_HPP
13
 
 
14
 
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15
 
# pragma once
16
 
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
 
 
18
 
#include "asio/detail/push_options.hpp"
19
 
 
20
 
#include "asio/detail/push_options.hpp"
21
 
#include <cstddef>
22
 
#include <boost/config.hpp>
23
 
#include <boost/cstdint.hpp>
24
 
#include "asio/detail/pop_options.hpp"
25
 
 
26
 
#include "asio/basic_streambuf.hpp"
27
 
#include "asio/error.hpp"
28
 
 
29
 
namespace asio {
30
 
 
31
 
/**
32
 
 * @defgroup read_at asio::read_at
33
 
 *
34
 
 * @brief Attempt to read a certain amount of data at the specified offset
35
 
 * before returning.
36
 
 */
37
 
/*@{*/
38
 
 
39
 
/// Attempt to read a certain amount of data at the specified offset before
40
 
/// returning.
41
 
/**
42
 
 * This function is used to read a certain number of bytes of data from a
43
 
 * random access device at the specified offset. The call will block until one
44
 
 * of the following conditions is true:
45
 
 *
46
 
 * @li The supplied buffers are full. That is, the bytes transferred is equal to
47
 
 * the sum of the buffer sizes.
48
 
 *
49
 
 * @li An error occurred.
50
 
 *
51
 
 * This operation is implemented in terms of one or more calls to the device's
52
 
 * read_some_at function.
53
 
 *
54
 
 * @param d The device from which the data is to be read. The type must support
55
 
 * the SyncRandomAccessReadDevice concept.
56
 
 *
57
 
 * @param offset The offset at which the data will be read.
58
 
 *
59
 
 * @param buffers One or more buffers into which the data will be read. The sum
60
 
 * of the buffer sizes indicates the maximum number of bytes to read from the
61
 
 * device.
62
 
 *
63
 
 * @returns The number of bytes transferred.
64
 
 *
65
 
 * @throws asio::system_error Thrown on failure.
66
 
 *
67
 
 * @par Example
68
 
 * To read into a single data buffer use the @ref buffer function as follows:
69
 
 * @code asio::read_at(d, 42, asio::buffer(data, size)); @endcode
70
 
 * See the @ref buffer documentation for information on reading into multiple
71
 
 * buffers in one go, and how to use it with arrays, boost::array or
72
 
 * std::vector.
73
 
 *
74
 
 * @note This overload is equivalent to calling:
75
 
 * @code asio::read_at(
76
 
 *     d, 42, buffers,
77
 
 *     asio::transfer_all()); @endcode
78
 
 */
79
 
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
80
 
std::size_t read_at(SyncRandomAccessReadDevice& d,
81
 
    boost::uint64_t offset, const MutableBufferSequence& buffers);
82
 
 
83
 
/// Attempt to read a certain amount of data at the specified offset before
84
 
/// returning.
85
 
/**
86
 
 * This function is used to read a certain number of bytes of data from a
87
 
 * random access device at the specified offset. The call will block until one
88
 
 * of the following conditions is true:
89
 
 *
90
 
 * @li The supplied buffers are full. That is, the bytes transferred is equal to
91
 
 * the sum of the buffer sizes.
92
 
 *
93
 
 * @li The completion_condition function object returns true.
94
 
 *
95
 
 * This operation is implemented in terms of one or more calls to the device's
96
 
 * read_some_at function.
97
 
 *
98
 
 * @param d The device from which the data is to be read. The type must support
99
 
 * the SyncRandomAccessReadDevice concept.
100
 
 *
101
 
 * @param offset The offset at which the data will be read.
102
 
 *
103
 
 * @param buffers One or more buffers into which the data will be read. The sum
104
 
 * of the buffer sizes indicates the maximum number of bytes to read from the
105
 
 * device.
106
 
 *
107
 
 * @param completion_condition The function object to be called to determine
108
 
 * whether the read operation is complete. The signature of the function object
109
 
 * must be:
110
 
 * @code bool completion_condition(
111
 
 *   // Result of latest read_some_at operation.
112
 
 *   const asio::error_code& error,
113
 
 *
114
 
 *   // Number of bytes transferred so far.
115
 
 *   std::size_t bytes_transferred
116
 
 * ); @endcode
117
 
 * A return value of true indicates that the read operation is complete. False
118
 
 * indicates that further calls to the device's read_some_at function are
119
 
 * required.
120
 
 *
121
 
 * @returns The number of bytes transferred.
122
 
 *
123
 
 * @throws asio::system_error Thrown on failure.
124
 
 *
125
 
 * @par Example
126
 
 * To read into a single data buffer use the @ref buffer function as follows:
127
 
 * @code asio::read_at(d, 42, asio::buffer(data, size),
128
 
 *     asio::transfer_at_least(32)); @endcode
129
 
 * See the @ref buffer documentation for information on reading into multiple
130
 
 * buffers in one go, and how to use it with arrays, boost::array or
131
 
 * std::vector.
132
 
 */
133
 
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
134
 
    typename CompletionCondition>
135
 
std::size_t read_at(SyncRandomAccessReadDevice& d,
136
 
    boost::uint64_t offset, const MutableBufferSequence& buffers,
137
 
    CompletionCondition completion_condition);
138
 
 
139
 
/// Attempt to read a certain amount of data at the specified offset before
140
 
/// returning.
141
 
/**
142
 
 * This function is used to read a certain number of bytes of data from a
143
 
 * random access device at the specified offset. The call will block until one
144
 
 * of the following conditions is true:
145
 
 *
146
 
 * @li The supplied buffers are full. That is, the bytes transferred is equal to
147
 
 * the sum of the buffer sizes.
148
 
 *
149
 
 * @li The completion_condition function object returns true.
150
 
 *
151
 
 * This operation is implemented in terms of one or more calls to the device's
152
 
 * read_some_at function.
153
 
 *
154
 
 * @param d The device from which the data is to be read. The type must support
155
 
 * the SyncRandomAccessReadDevice concept.
156
 
 *
157
 
 * @param offset The offset at which the data will be read.
158
 
 *
159
 
 * @param buffers One or more buffers into which the data will be read. The sum
160
 
 * of the buffer sizes indicates the maximum number of bytes to read from the
161
 
 * device.
162
 
 *
163
 
 * @param completion_condition The function object to be called to determine
164
 
 * whether the read operation is complete. The signature of the function object
165
 
 * must be:
166
 
 * @code bool completion_condition(
167
 
 *   const asio::error_code& error, // Result of latest read_some_at
168
 
 *                                           // operation.
169
 
 *
170
 
 *   std::size_t bytes_transferred           // Number of bytes transferred
171
 
 *                                           // so far.
172
 
 * ); @endcode
173
 
 * A return value of true indicates that the read operation is complete. False
174
 
 * indicates that further calls to the device's read_some_at function are
175
 
 * required.
176
 
 *
177
 
 * @param ec Set to indicate what error occurred, if any.
178
 
 *
179
 
 * @returns The number of bytes read. If an error occurs, returns the total
180
 
 * number of bytes successfully transferred prior to the error.
181
 
 */
182
 
template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
183
 
    typename CompletionCondition>
184
 
std::size_t read_at(SyncRandomAccessReadDevice& d,
185
 
    boost::uint64_t offset, const MutableBufferSequence& buffers,
186
 
    CompletionCondition completion_condition, asio::error_code& ec);
187
 
 
188
 
/// Attempt to read a certain amount of data at the specified offset before
189
 
/// returning.
190
 
/**
191
 
 * This function is used to read a certain number of bytes of data from a
192
 
 * random access device at the specified offset. The call will block until one
193
 
 * of the following conditions is true:
194
 
 *
195
 
 * @li An error occurred.
196
 
 *
197
 
 * This operation is implemented in terms of one or more calls to the device's
198
 
 * read_some_at function.
199
 
 *
200
 
 * @param d The device from which the data is to be read. The type must support
201
 
 * the SyncRandomAccessReadDevice concept.
202
 
 *
203
 
 * @param offset The offset at which the data will be read.
204
 
 *
205
 
 * @param b The basic_streambuf object into which the data will be read.
206
 
 *
207
 
 * @returns The number of bytes transferred.
208
 
 *
209
 
 * @throws asio::system_error Thrown on failure.
210
 
 *
211
 
 * @note This overload is equivalent to calling:
212
 
 * @code asio::read_at(
213
 
 *     d, 42, b,
214
 
 *     asio::transfer_all()); @endcode
215
 
 */
216
 
template <typename SyncRandomAccessReadDevice, typename Allocator>
217
 
std::size_t read_at(SyncRandomAccessReadDevice& d,
218
 
    boost::uint64_t offset, basic_streambuf<Allocator>& b);
219
 
 
220
 
/// Attempt to read a certain amount of data at the specified offset before
221
 
/// returning.
222
 
/**
223
 
 * This function is used to read a certain number of bytes of data from a
224
 
 * random access device at the specified offset. The call will block until one
225
 
 * of the following conditions is true:
226
 
 *
227
 
 * @li The completion_condition function object returns true.
228
 
 *
229
 
 * This operation is implemented in terms of one or more calls to the device's
230
 
 * read_some_at function.
231
 
 *
232
 
 * @param d The device from which the data is to be read. The type must support
233
 
 * the SyncRandomAccessReadDevice concept.
234
 
 *
235
 
 * @param offset The offset at which the data will be read.
236
 
 *
237
 
 * @param b The basic_streambuf object into which the data will be read.
238
 
 *
239
 
 * @param completion_condition The function object to be called to determine
240
 
 * whether the read operation is complete. The signature of the function object
241
 
 * must be:
242
 
 * @code bool completion_condition(
243
 
 *   // Result of latest read_some_at operation.
244
 
 *   const asio::error_code& error,
245
 
 *
246
 
 *   // Number of bytes transferred so far.
247
 
 *   std::size_t bytes_transferred
248
 
 * ); @endcode
249
 
 * A return value of true indicates that the read operation is complete. False
250
 
 * indicates that further calls to the device's read_some_at function are
251
 
 * required.
252
 
 *
253
 
 * @returns The number of bytes transferred.
254
 
 *
255
 
 * @throws asio::system_error Thrown on failure.
256
 
 */
257
 
template <typename SyncRandomAccessReadDevice, typename Allocator,
258
 
    typename CompletionCondition>
259
 
std::size_t read_at(SyncRandomAccessReadDevice& d,
260
 
    boost::uint64_t offset, basic_streambuf<Allocator>& b,
261
 
    CompletionCondition completion_condition);
262
 
 
263
 
/// Attempt to read a certain amount of data at the specified offset before
264
 
/// returning.
265
 
/**
266
 
 * This function is used to read a certain number of bytes of data from a
267
 
 * random access device at the specified offset. The call will block until one
268
 
 * of the following conditions is true:
269
 
 *
270
 
 * @li The completion_condition function object returns true.
271
 
 *
272
 
 * This operation is implemented in terms of one or more calls to the device's
273
 
 * read_some_at function.
274
 
 *
275
 
 * @param d The device from which the data is to be read. The type must support
276
 
 * the SyncRandomAccessReadDevice concept.
277
 
 *
278
 
 * @param offset The offset at which the data will be read.
279
 
 *
280
 
 * @param b The basic_streambuf object into which the data will be read.
281
 
 *
282
 
 * @param completion_condition The function object to be called to determine
283
 
 * whether the read operation is complete. The signature of the function object
284
 
 * must be:
285
 
 * @code bool completion_condition(
286
 
 *   // Result of latest read_some_at operation.
287
 
 *   const asio::error_code& error,
288
 
 *
289
 
 *   // Number of bytes transferred so far.
290
 
 *   std::size_t bytes_transferred
291
 
 * ); @endcode
292
 
 * A return value of true indicates that the read operation is complete. False
293
 
 * indicates that further calls to the device's read_some_at function are
294
 
 * required.
295
 
 *
296
 
 * @param ec Set to indicate what error occurred, if any.
297
 
 *
298
 
 * @returns The number of bytes read. If an error occurs, returns the total
299
 
 * number of bytes successfully transferred prior to the error.
300
 
 */
301
 
template <typename SyncRandomAccessReadDevice, typename Allocator,
302
 
    typename CompletionCondition>
303
 
std::size_t read_at(SyncRandomAccessReadDevice& d,
304
 
    boost::uint64_t offset, basic_streambuf<Allocator>& b,
305
 
    CompletionCondition completion_condition, asio::error_code& ec);
306
 
 
307
 
/*@}*/
308
 
/**
309
 
 * @defgroup async_read_at asio::async_read_at
310
 
 *
311
 
 * @brief Start an asynchronous operation to read a certain amount of data at
312
 
 * the specified offset.
313
 
 */
314
 
/*@{*/
315
 
 
316
 
/// Start an asynchronous operation to read a certain amount of data at the
317
 
/// specified offset.
318
 
/**
319
 
 * This function is used to asynchronously read a certain number of bytes of
320
 
 * data from a random access device at the specified offset. The function call
321
 
 * always returns immediately. The asynchronous operation will continue until
322
 
 * one of the following conditions is true:
323
 
 *
324
 
 * @li The supplied buffers are full. That is, the bytes transferred is equal to
325
 
 * the sum of the buffer sizes.
326
 
 *
327
 
 * @li An error occurred.
328
 
 *
329
 
 * This operation is implemented in terms of one or more calls to the device's
330
 
 * async_read_some_at function.
331
 
 *
332
 
 * @param d The device from which the data is to be read. The type must support
333
 
 * the AsyncRandomAccessReadDevice concept.
334
 
 *
335
 
 * @param offset The offset at which the data will be read.
336
 
 *
337
 
 * @param buffers One or more buffers into which the data will be read. The sum
338
 
 * of the buffer sizes indicates the maximum number of bytes to read from the
339
 
 * device. Although the buffers object may be copied as necessary, ownership of
340
 
 * the underlying memory blocks is retained by the caller, which must guarantee
341
 
 * that they remain valid until the handler is called.
342
 
 *
343
 
 * @param handler The handler to be called when the read operation completes.
344
 
 * Copies will be made of the handler as required. The function signature of the
345
 
 * handler must be:
346
 
 * @code void handler(
347
 
 *   // Result of operation.
348
 
 *   const asio::error_code& error,
349
 
 *
350
 
 *   // Number of bytes copied into the buffers. If an error
351
 
 *   // occurred, this will be the number of bytes successfully
352
 
 *   // transferred prior to the error.
353
 
 *   std::size_t bytes_transferred
354
 
 * ); @endcode
355
 
 * Regardless of whether the asynchronous operation completes immediately or
356
 
 * not, the handler will not be invoked from within this function. Invocation of
357
 
 * the handler will be performed in a manner equivalent to using
358
 
 * asio::io_service::post().
359
 
 *
360
 
 * @par Example
361
 
 * To read into a single data buffer use the @ref buffer function as follows:
362
 
 * @code
363
 
 * asio::async_read_at(d, 42, asio::buffer(data, size), handler);
364
 
 * @endcode
365
 
 * See the @ref buffer documentation for information on reading into multiple
366
 
 * buffers in one go, and how to use it with arrays, boost::array or
367
 
 * std::vector.
368
 
 *
369
 
 * @note This overload is equivalent to calling:
370
 
 * @code asio::async_read_at(
371
 
 *     d, 42, buffers,
372
 
 *     asio::transfer_all(),
373
 
 *     handler); @endcode
374
 
 */
375
 
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
376
 
    typename ReadHandler>
377
 
void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset,
378
 
    const MutableBufferSequence& buffers, ReadHandler handler);
379
 
 
380
 
/// Start an asynchronous operation to read a certain amount of data at the
381
 
/// specified offset.
382
 
/**
383
 
 * This function is used to asynchronously read a certain number of bytes of
384
 
 * data from a random access device at the specified offset. The function call
385
 
 * always returns immediately. The asynchronous operation will continue until
386
 
 * one of the following conditions is true:
387
 
 *
388
 
 * @li The supplied buffers are full. That is, the bytes transferred is equal to
389
 
 * the sum of the buffer sizes.
390
 
 *
391
 
 * @li The completion_condition function object returns true.
392
 
 *
393
 
 * @param d The device from which the data is to be read. The type must support
394
 
 * the AsyncRandomAccessReadDevice concept.
395
 
 *
396
 
 * @param offset The offset at which the data will be read.
397
 
 *
398
 
 * @param buffers One or more buffers into which the data will be read. The sum
399
 
 * of the buffer sizes indicates the maximum number of bytes to read from the
400
 
 * device. Although the buffers object may be copied as necessary, ownership of
401
 
 * the underlying memory blocks is retained by the caller, which must guarantee
402
 
 * that they remain valid until the handler is called.
403
 
 *
404
 
 * @param completion_condition The function object to be called to determine
405
 
 * whether the read operation is complete. The signature of the function object
406
 
 * must be:
407
 
 * @code bool completion_condition(
408
 
 *   // Result of latest read_some_at operation.
409
 
 *   const asio::error_code& error,
410
 
 *
411
 
 *   // Number of bytes transferred so far.
412
 
 *   std::size_t bytes_transferred
413
 
 * ); @endcode
414
 
 * A return value of true indicates that the read operation is complete. False
415
 
 * indicates that further calls to the device's async_read_some_at function are
416
 
 * required.
417
 
 *
418
 
 * @param handler The handler to be called when the read operation completes.
419
 
 * Copies will be made of the handler as required. The function signature of the
420
 
 * handler must be:
421
 
 * @code void handler(
422
 
 *   // Result of operation.
423
 
 *   const asio::error_code& error,
424
 
 *
425
 
 *   // Number of bytes copied into the buffers. If an error
426
 
 *   // occurred, this will be the number of bytes successfully
427
 
 *   // transferred prior to the error.
428
 
 *   std::size_t bytes_transferred
429
 
 * ); @endcode
430
 
 * Regardless of whether the asynchronous operation completes immediately or
431
 
 * not, the handler will not be invoked from within this function. Invocation of
432
 
 * the handler will be performed in a manner equivalent to using
433
 
 * asio::io_service::post().
434
 
 *
435
 
 * @par Example
436
 
 * To read into a single data buffer use the @ref buffer function as follows:
437
 
 * @code asio::async_read_at(d, 42,
438
 
 *     asio::buffer(data, size),
439
 
 *     asio::transfer_at_least(32),
440
 
 *     handler); @endcode
441
 
 * See the @ref buffer documentation for information on reading into multiple
442
 
 * buffers in one go, and how to use it with arrays, boost::array or
443
 
 * std::vector.
444
 
 */
445
 
template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
446
 
    typename CompletionCondition, typename ReadHandler>
447
 
void async_read_at(AsyncRandomAccessReadDevice& d,
448
 
    boost::uint64_t offset, const MutableBufferSequence& buffers,
449
 
    CompletionCondition completion_condition, ReadHandler handler);
450
 
 
451
 
/// Start an asynchronous operation to read a certain amount of data at the
452
 
/// specified offset.
453
 
/**
454
 
 * This function is used to asynchronously read a certain number of bytes of
455
 
 * data from a random access device at the specified offset. The function call
456
 
 * always returns immediately. The asynchronous operation will continue until
457
 
 * one of the following conditions is true:
458
 
 *
459
 
 * @li An error occurred.
460
 
 *
461
 
 * This operation is implemented in terms of one or more calls to the device's
462
 
 * async_read_some_at function.
463
 
 *
464
 
 * @param d The device from which the data is to be read. The type must support
465
 
 * the AsyncRandomAccessReadDevice concept.
466
 
 *
467
 
 * @param offset The offset at which the data will be read.
468
 
 *
469
 
 * @param b A basic_streambuf object into which the data will be read. Ownership
470
 
 * of the streambuf is retained by the caller, which must guarantee that it
471
 
 * remains valid until the handler is called.
472
 
 *
473
 
 * @param handler The handler to be called when the read operation completes.
474
 
 * Copies will be made of the handler as required. The function signature of the
475
 
 * handler must be:
476
 
 * @code void handler(
477
 
 *   // Result of operation.
478
 
 *   const asio::error_code& error,
479
 
 *
480
 
 *   // Number of bytes copied into the buffers. If an error
481
 
 *   // occurred, this will be the number of bytes successfully
482
 
 *   // transferred prior to the error.
483
 
 *   std::size_t bytes_transferred
484
 
 * ); @endcode
485
 
 * Regardless of whether the asynchronous operation completes immediately or
486
 
 * not, the handler will not be invoked from within this function. Invocation of
487
 
 * the handler will be performed in a manner equivalent to using
488
 
 * asio::io_service::post().
489
 
 *
490
 
 * @note This overload is equivalent to calling:
491
 
 * @code asio::async_read_at(
492
 
 *     d, 42, b,
493
 
 *     asio::transfer_all(),
494
 
 *     handler); @endcode
495
 
 */
496
 
template <typename AsyncRandomAccessReadDevice, typename Allocator,
497
 
    typename ReadHandler>
498
 
void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset,
499
 
    basic_streambuf<Allocator>& b, ReadHandler handler);
500
 
 
501
 
/// Start an asynchronous operation to read a certain amount of data at the
502
 
/// specified offset.
503
 
/**
504
 
 * This function is used to asynchronously read a certain number of bytes of
505
 
 * data from a random access device at the specified offset. The function call
506
 
 * always returns immediately. The asynchronous operation will continue until
507
 
 * one of the following conditions is true:
508
 
 *
509
 
 * @li The completion_condition function object returns true.
510
 
 *
511
 
 * This operation is implemented in terms of one or more calls to the device's
512
 
 * async_read_some_at function.
513
 
 *
514
 
 * @param d The device from which the data is to be read. The type must support
515
 
 * the AsyncRandomAccessReadDevice concept.
516
 
 *
517
 
 * @param offset The offset at which the data will be read.
518
 
 *
519
 
 * @param b A basic_streambuf object into which the data will be read. Ownership
520
 
 * of the streambuf is retained by the caller, which must guarantee that it
521
 
 * remains valid until the handler is called.
522
 
 *
523
 
 * @param completion_condition The function object to be called to determine
524
 
 * whether the read operation is complete. The signature of the function object
525
 
 * must be:
526
 
 * @code bool completion_condition(
527
 
 *   // Result of latest read_some_at operation.
528
 
 *   const asio::error_code& error,
529
 
 *
530
 
 *   // Number of bytes transferred so far.
531
 
 *   std::size_t bytes_transferred
532
 
 * ); @endcode
533
 
 * A return value of true indicates that the read operation is complete. False
534
 
 * indicates that further calls to the device's async_read_some_at function are
535
 
 * required.
536
 
 *
537
 
 * @param handler The handler to be called when the read operation completes.
538
 
 * Copies will be made of the handler as required. The function signature of the
539
 
 * handler must be:
540
 
 * @code void handler(
541
 
 *   // Result of operation.
542
 
 *   const asio::error_code& error,
543
 
 *
544
 
 *   // Number of bytes copied into the buffers. If an error
545
 
 *   // occurred, this will be the number of bytes successfully
546
 
 *   // transferred prior to the error.
547
 
 *   std::size_t bytes_transferred
548
 
 * ); @endcode
549
 
 * Regardless of whether the asynchronous operation completes immediately or
550
 
 * not, the handler will not be invoked from within this function. Invocation of
551
 
 * the handler will be performed in a manner equivalent to using
552
 
 * asio::io_service::post().
553
 
 */
554
 
template <typename AsyncRandomAccessReadDevice, typename Allocator,
555
 
    typename CompletionCondition, typename ReadHandler>
556
 
void async_read_at(AsyncRandomAccessReadDevice& d,
557
 
    boost::uint64_t offset, basic_streambuf<Allocator>& b,
558
 
    CompletionCondition completion_condition, ReadHandler handler);
559
 
 
560
 
/*@}*/
561
 
 
562
 
} // namespace asio
563
 
 
564
 
#include "asio/impl/read_at.ipp"
565
 
 
566
 
#include "asio/detail/pop_options.hpp"
567
 
 
568
 
#endif // ASIO_READ_AT_HPP