Thrill
0.1
|
Functional interface of a request.
Since all library I/O operations are asynchronous, one needs to keep track of their status: e.g. whether an I/O operation completed or not.
Definition at line 34 of file request_interface.hpp.
#include <request_interface.hpp>
Public Types | |
using | offset_type = uint64_t |
type for offsets within a file More... | |
enum | read_or_write { READ, WRITE } |
using | size_type = size_t |
type for block transfer sizes More... | |
Public Member Functions | |
request_interface ()=default | |
request_interface (const request_interface &)=delete | |
non-copyable: delete copy-constructor More... | |
virtual | ~request_interface () |
virtual bool | add_waiter (onoff_switch *sw)=0 |
virtual bool | cancel ()=0 |
Cancel a request. More... | |
virtual void | delete_waiter (onoff_switch *sw)=0 |
virtual const char * | io_type () const =0 |
Identifies the type of I/O implementation. More... | |
request_interface & | operator= (const request_interface &)=delete |
non-copyable: delete assignment operator More... | |
virtual bool | poll ()=0 |
virtual std::ostream & | print (std::ostream &out) const =0 |
Dumps properties of a request. More... | |
virtual void | wait (bool measure_time=true)=0 |
Suspends calling thread until completion of the request. More... | |
Protected Member Functions | |
virtual void | completed (bool canceled)=0 |
virtual void | notify_waiters ()=0 |
using offset_type = uint64_t |
type for offsets within a file
Definition at line 38 of file request_interface.hpp.
using size_type = size_t |
type for block transfer sizes
Definition at line 40 of file request_interface.hpp.
enum read_or_write |
Enumerator | |
---|---|
READ | |
WRITE |
Definition at line 42 of file request_interface.hpp.
|
default |
|
delete |
non-copyable: delete copy-constructor
|
inlinevirtual |
Definition at line 62 of file request_interface.hpp.
References request_interface::cancel(), request_interface::io_type(), request_interface::poll(), request_interface::print(), and request_interface::wait().
|
pure virtual |
Implemented in request_with_waiters.
|
pure virtual |
Cancel a request.
The request is canceled unless already being processed. However, cancelation cannot be guaranteed. Canceled requests must still be waited for in order to ensure correct operation. If the request was canceled successfully, the completion handler will not be called.
true
iff the request was canceled successfully Implemented in request_with_state.
Referenced by request_interface::~request_interface().
|
protectedpure virtual |
Implemented in request_with_state.
|
pure virtual |
Implemented in request_with_waiters.
|
pure virtual |
Identifies the type of I/O implementation.
Implemented in request, and serving_request.
Referenced by request_interface::~request_interface().
|
protectedpure virtual |
Implemented in request_with_waiters.
|
delete |
non-copyable: delete assignment operator
|
pure virtual |
Polls the status of the request.
true
if request is completed, otherwise false
Implemented in request_with_state.
Referenced by request_with_waiters::add_waiter(), and request_interface::~request_interface().
|
pure virtual |
Dumps properties of a request.
Implemented in request.
Referenced by request_interface::~request_interface().
|
pure virtual |
Suspends calling thread until completion of the request.
Implemented in request_with_state.
Referenced by request_interface::~request_interface().