STXXL  1.4.1
 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  * Copyright (C) 2014 Timo Bingmann <[email protected]>
9  *
10  * Distributed under the Boost Software License, Version 1.0.
11  * (See accompanying file LICENSE_1_0.txt or copy at
12  * http://www.boost.org/LICENSE_1_0.txt)
13  **************************************************************************/
14 
15 #ifndef STXXL_IO_DISK_QUEUED_FILE_HEADER
16 #define STXXL_IO_DISK_QUEUED_FILE_HEADER
17 
18 #include <stxxl/bits/io/file.h>
19 #include <stxxl/bits/io/request.h>
20 #include <stxxl/bits/namespace.h>
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 m_queue_id, m_allocator_id;
33 
34 public:
35  disk_queued_file(int queue_id, int allocator_id)
36  : m_queue_id(queue_id), m_allocator_id(allocator_id)
37  { }
38 
39  request_ptr aread(
40  void* buffer,
41  offset_type pos,
42  size_type bytes,
43  const completion_handler& on_cmpl = completion_handler());
44 
45  request_ptr awrite(
46  void* buffer,
47  offset_type pos,
48  size_type bytes,
49  const completion_handler& on_cmpl = completion_handler());
50 
51  virtual int get_queue_id() const
52  {
53  return m_queue_id;
54  }
55 
56  virtual int get_allocator_id() const
57  {
58  return m_allocator_id;
59  }
60 };
61 
62 //! \}
63 
65 
66 #endif // !STXXL_IO_DISK_QUEUED_FILE_HEADER
67 // vim: et:ts=4:sw=4
Completion handler class (Loki-style).
High-performance smart pointer used as a wrapping reference counting pointer.
Definition: counting_ptr.h:50
virtual int get_allocator_id() const
Returns the file&#39;s disk allocator number.
Defines interface of file.
Definition: file.h:56
virtual int get_queue_id() const
Returns the identifier of the file&#39;s queue number.
#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)
static const size_t bytes
number of bytes in uint_pair
Definition: uint_types.h:96
#define STXXL_END_NAMESPACE
Definition: namespace.h:17