Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

request_with_state Class Reference
[File implementations]

Request with completion state. More...

#include <request_with_state.h>

Inheritance diagram for request_with_state:
Inheritance graph
[legend]
Collaboration diagram for request_with_state:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Request with completion state.


Member Enumeration Documentation

states of request OP - operating, DONE - request served, READY2DIE - can be destroyed


Member Function Documentation

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.

Returns:
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.

Returns:
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().


The documentation for this class was generated from the following files: