STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
disk_queued_file.h
Go to the documentation of this file.
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_IO_DISK_QUEUED_FILE_HEADER
15 #define STXXL_IO_DISK_QUEUED_FILE_HEADER
16 
17 #include <stxxl/bits/io/file.h>
18 #include <stxxl/bits/io/request.h>
19 #include <stxxl/bits/namespace.h>
20 
21 
23 
24 //! \addtogroup fileimpl
25 //! \{
26 
27 class completion_handler;
28 
29 //! Implementation of some file methods based on serving_request.
30 class disk_queued_file : public virtual file
31 {
32  int queue_id, allocator_id;
33 
34 public:
35  disk_queued_file(int queue_id, int allocator_id) : queue_id(queue_id), allocator_id(allocator_id)
36  { }
37  request_ptr aread(
38  void* buffer,
39  offset_type pos,
40  size_type bytes,
41  const completion_handler& on_cmpl);
42  request_ptr awrite(
43  void* buffer,
44  offset_type pos,
45  size_type bytes,
46  const completion_handler& on_cmpl);
47 
48  virtual int get_queue_id() const
49  {
50  return queue_id;
51  }
52 
53  virtual int get_allocator_id() const
54  {
55  return allocator_id;
56  }
57 };
58 
59 //! \}
60 
62 
63 #endif // !STXXL_IO_DISK_QUEUED_FILE_HEADER
64 // vim: et:ts=4:sw=4
static const int bytes
number of bytes in uint_pair
Definition: uint_types.h:99
Completion handler class (Loki-style).
virtual int get_allocator_id() const
Returns the file&#39;s allocator.
Defines interface of file.
Definition: file.h:52
virtual int get_queue_id() const
Returns the identifier of the file&#39;s queue.
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
Implementation of some file methods based on serving_request.
disk_queued_file(int queue_id, int allocator_id)
#define STXXL_END_NAMESPACE
Definition: namespace.h:17