Defines interface of request. More...
#include <request.h>
Public Types | |
enum | request_type { READ, WRITE } |
typedef stxxl::uint64 | offset_type |
typedef stxxl::unsigned_type | size_type |
Public Member Functions | |
virtual void | serve ()=0 |
virtual void | wait (bool measure_time=true)=0 |
Suspends calling thread until completion of the request. | |
virtual bool | cancel ()=0 |
Cancel request The request is cancelled unless already being processed. However, cancellation cannot be guaranteed. Cancelled requests must still be waited for in order to ensure correct operation. | |
virtual bool | poll ()=0 |
Polls the status of the request. | |
virtual const char * | io_type () const =0 |
Identifies the type of I/O implementation. | |
Protected Member Functions | |
virtual bool | add_waiter (onoff_switch *sw)=0 |
virtual void | delete_waiter (onoff_switch *sw)=0 |
virtual void | notify_waiters ()=0 |
virtual void | completed ()=0 |
Defines interface of request.
Since all library I/O operations are asynchronous, one needs to keep track of their status: whether an I/O completed or not.
virtual bool request_base::cancel | ( | ) | [pure virtual] |
Cancel request The request is cancelled unless already being processed. However, cancellation cannot be guaranteed. Cancelled requests must still be waited for in order to ensure correct operation.
true
iff the request was cancelled successfully Implemented in request_state_impl_basic.
virtual const char* request_base::io_type | ( | ) | const [pure virtual] |
Identifies the type of I/O implementation.
Implemented in request_impl_basic.
virtual bool request_base::poll | ( | ) | [pure virtual] |
Polls the status of the request.
true
if request is completed, otherwise false
Implemented in request_state_impl_basic.
virtual void request_base::wait | ( | bool | measure_time = true |
) | [pure virtual] |
Suspends calling thread until completion of the request.
Implemented in request_state_impl_basic.