Stxxl
1.4.0
|
Request with completion state. More...
#include <request_with_state.h>
Public Member Functions | |
virtual | ~request_with_state () |
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.
Definition at line 28 of file request_with_state.h.
enum stxxl::request_with_state::request_state [protected] |
states of request OP - operating, DONE - request served, READY2DIE - can be destroyed
Definition at line 33 of file request_with_state.h.
stxxl::request_with_state::request_with_state | ( | const completion_handler & | on_cmpl, |
file * | f, | ||
void * | buf, | ||
offset_type | off, | ||
size_type | b, | ||
request_type | t | ||
) | [inline, protected] |
Definition at line 38 of file request_with_state.h.
stxxl::request_with_state::~request_with_state | ( | ) | [virtual] |
Definition at line 22 of file request_with_state.cpp.
bool stxxl::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 stxxl::request_interface.
Definition at line 46 of file request_with_state.cpp.
bool stxxl::request_with_state::poll | ( | ) | [virtual] |
Polls the status of the request.
true
if request is completed, otherwise false
Implements stxxl::request_interface.
Definition at line 66 of file request_with_state.cpp.
void stxxl::request_with_state::wait | ( | bool | measure_time = true | ) | [virtual] |
Suspends calling thread until completion of the request.
Implements stxxl::request_interface.
Definition at line 35 of file request_with_state.cpp.
state<request_state> stxxl::request_with_state::_state [protected] |
Definition at line 35 of file request_with_state.h.
Referenced by stxxl::serving_request::completed().