Thrill  0.1
disk_queued_file.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * foxxll/io/disk_queued_file.hpp
3  *
4  * Part of FOXXLL. See http://foxxll.org
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 FOXXLL_IO_DISK_QUEUED_FILE_HEADER
16 #define FOXXLL_IO_DISK_QUEUED_FILE_HEADER
17 
18 #include <foxxll/io/file.hpp>
19 #include <foxxll/io/request.hpp>
20 
21 namespace foxxll {
22 
23 //! \addtogroup foxxll_fileimpl
24 //! \{
25 
26 //! Implementation of some file methods based on serving_request.
27 class disk_queued_file : public virtual file
28 {
30 
31 public:
32  disk_queued_file(int queue_id, int allocator_id)
33  : queue_id_(queue_id), allocator_id_(allocator_id)
34  { }
35 
37  void* buffer, offset_type pos, size_type bytes,
38  const completion_handler& on_complete = completion_handler()) override;
39 
41  void* buffer, offset_type pos, size_type bytes,
42  const completion_handler& on_complete = completion_handler()) override;
43 
44  int get_queue_id() const override
45  {
46  return queue_id_;
47  }
48 
49  int get_allocator_id() const override
50  {
51  return allocator_id_;
52  }
53 };
54 
55 //! \}
56 
57 } // namespace foxxll
58 
59 #endif // !FOXXLL_IO_DISK_QUEUED_FILE_HEADER
60 
61 /**************************************************************************/
request::offset_type offset_type
the offset of a request, also the size of the file
Definition: file.hpp:58
int get_allocator_id() const override
Returns the file&#39;s parallel disk block allocator number.
Implementation of some file methods based on serving_request.
request_ptr awrite(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_complete=completion_handler()) override
disk_queued_file(int queue_id, int allocator_id)
tlx::delegate< void(request *r, bool success)> completion_handler
completion handler
Definition: request.hpp:46
request::size_type size_type
the size of a request
Definition: file.hpp:60
request_ptr aread(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_complete=completion_handler()) override
FOXXLL library namespace
High-performance smart pointer used as a wrapping reference counting pointer.
static const size_t bytes
number of bytes in uint_pair
Definition: uint_types.hpp:75
int get_queue_id() const override