Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
request_queue.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * foxxll/io/request_queue.hpp
3  *
4  * Part of FOXXLL. See http://foxxll.org
5  *
6  * Copyright (C) 2009 Andreas Beckmann <[email protected]>
7  * Copyright (C) 2011 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 FOXXLL_IO_REQUEST_QUEUE_HEADER
15 #define FOXXLL_IO_REQUEST_QUEUE_HEADER
16 
17 #include <tlx/unused.hpp>
18 
19 #include <foxxll/io/request.hpp>
20 
21 namespace foxxll {
22 
23 //! \addtogroup foxxll_reqlayer
24 //! \{
25 
26 //! Interface of a request_queue to which requests can be added and canceled.
28 {
29 public:
30  enum priority_op { READ, WRITE, NONE };
31 
32 public:
33  request_queue() = default;
34 
35  //! non-copyable: delete copy-constructor
36  request_queue(const request_queue&) = delete;
37  //! non-copyable: delete assignment operator
38  request_queue& operator = (const request_queue&) = delete;
39  //! move-constructor: default
40  request_queue(request_queue&&) = default;
41  //! move-assignment operator: default
43 
44 public:
45  virtual void add_request(request_ptr& req) = 0;
46  virtual bool cancel_request(request_ptr& req) = 0;
47  virtual ~request_queue() { }
48  virtual void set_priority_op(const priority_op& p) { tlx::unused(p); }
49 };
50 
51 //! \}
52 
53 } // namespace foxxll
54 
55 #endif // !FOXXLL_IO_REQUEST_QUEUE_HEADER
56 
57 /**************************************************************************/
Interface of a request_queue to which requests can be added and canceled.
virtual void add_request(request_ptr &req)=0
void unused(Types &&...)
Definition: unused.hpp:20
High-performance smart pointer used as a wrapping reference counting pointer.
request_queue & operator=(const request_queue &)=delete
non-copyable: delete assignment operator
virtual bool cancel_request(request_ptr &req)=0
virtual void set_priority_op(const priority_op &p)