Request with completion state. More...
#include <request_with_state.h>
Public Member Functions | |
void | wait (bool measure_time=true) |
Suspends calling thread until completion of the request. | |
bool | poll () |
Polls the status of the request. | |
bool | cancel () |
Cancel a request. | |
Protected Types | |
enum | request_state { OP = 0, DONE = 1, READY2DIE = 2 } |
Protected Member Functions | |
request_with_state (const completion_handler &on_cmpl, file *f, void *buf, offset_type off, size_type b, request_type t) | |
Protected Attributes | |
state< request_state > | _state |
Request with completion state.
enum request_with_state::request_state [protected] |
states of request OP - operating, DONE - request served, READY2DIE - can be destroyed
bool request_with_state::cancel | ( | ) | [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 Implements request_interface.
References file::get_queue_id().
bool request_with_state::poll | ( | ) | [virtual] |
Polls the status of the request.
true
if request is completed, otherwise false
Implements request_interface.
References request::check_errors().
void request_with_state::wait | ( | bool | measure_time = true |
) | [virtual] |
Suspends calling thread until completion of the request.
Implements request_interface.
References request::check_errors().