Thrill  0.1
disk_queued_file.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * foxxll/io/disk_queued_file.cpp
3  *
4  * Part of FOXXLL. See http://foxxll.org
5  *
6  * Copyright (C) 2008 Andreas Beckmann <[email protected]>
7  *
8  * Distributed under the Boost Software License, Version 1.0.
9  * (See accompanying file LICENSE_1_0.txt or copy at
10  * http://www.boost.org/LICENSE_1_0.txt)
11  **************************************************************************/
12 
15 #include <foxxll/io/file.hpp>
16 #include <foxxll/io/request.hpp>
19 #include <foxxll/singleton.hpp>
20 
21 namespace foxxll {
22 
24  void* buffer, offset_type offset, size_type bytes,
25  const completion_handler& on_complete)
26 {
27  request_ptr req = tlx::make_counting<serving_request>(
28  on_complete, this, buffer, offset, bytes, request::READ
29  );
30 
32 
33  return req;
34 }
35 
37  void* buffer, offset_type offset, size_type bytes,
38  const completion_handler& on_complete)
39 {
40  request_ptr req = tlx::make_counting<serving_request>(
41  on_complete, this, buffer, offset, bytes, request::WRITE
42  );
43 
45 
46  return req;
47 }
48 
49 } // namespace foxxll
50 
51 /**************************************************************************/
request::offset_type offset_type
the offset of a request, also the size of the file
Definition: file.hpp:58
request_ptr awrite(void *buffer, offset_type pos, size_type bytes, const completion_handler &on_complete=completion_handler()) override
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
static instance_pointer get_instance()
return instance or create base instance if empty
Definition: singleton.hpp:41
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
void add_request(request_ptr &req, disk_id_type disk)
Definition: disk_queues.cpp:60
int get_queue_id() const override