Stxxl  1.3.2
disk_queued_file.h
1 /***************************************************************************
2  * include/stxxl/bits/io/disk_queued_file.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2008 Andreas Beckmann <[email protected]>
7  * Copyright (C) 2009 Johannes Singler <[email protected]>
8  *
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or copy at
11  * http://www.boost.org/LICENSE_1_0.txt)
12  **************************************************************************/
13 
14 #ifndef STXXL_HEADER_IO_DISK_QUEUED_FILE
15 #define STXXL_HEADER_IO_DISK_QUEUED_FILE
16 
17 #include <stxxl/bits/io/file.h>
18 
19 
20 __STXXL_BEGIN_NAMESPACE
21 
24 
26 class disk_queued_file : public virtual file
27 {
28  int queue_id, allocator_id;
29 
30 public:
31  disk_queued_file(int queue_id, int allocator_id) : queue_id(queue_id), allocator_id(allocator_id)
32  { }
34  void * buffer,
35  offset_type pos,
36  size_type bytes,
37  const completion_handler & on_cmpl);
39  void * buffer,
40  offset_type pos,
41  size_type bytes,
42  const completion_handler & on_cmpl);
43 
44  virtual int get_queue_id() const
45  {
46  return queue_id;
47  }
48 
49  virtual int get_allocator_id() const
50  {
51  return allocator_id;
52  }
53 };
54 
56 
57 __STXXL_END_NAMESPACE
58 
59 #endif // !STXXL_HEADER_IO_DISK_QUEUED_FILE
60 // vim: et:ts=4:sw=4
request_ptr aread(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)
Schedules an asynchronous read request to the file.
Definition: disk_queued_file.cpp:21
Defines interface of file.
Definition: file.h:90
Completion handler class (Loki-style)
Definition: completion_handler.h:63
request_ptr awrite(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)
Schedules an asynchronous write request to the file.
Definition: disk_queued_file.cpp:35
virtual int get_queue_id() const
Returns the identifier of the file&#39;s queue.
Definition: disk_queued_file.h:44
Implemented as reference counting smart pointer.
Definition: request_ptr.h:34
Implementation of some file methods based on serving_request.
Definition: disk_queued_file.h:26
virtual int get_allocator_id() const
Returns the file&#39;s allocator.
Definition: disk_queued_file.h:49