Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
stxxl::request_with_state Class Reference

Request with completion state. More...

#include <request_with_state.h>

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

List of all members.

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

Detailed Description

Request with completion state.

Definition at line 28 of file request_with_state.h.


Member Enumeration Documentation

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

Enumerator:
OP 
DONE 
READY2DIE 

Definition at line 33 of file request_with_state.h.


Constructor & Destructor Documentation

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.

Definition at line 22 of file request_with_state.cpp.


Member Function Documentation

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

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


Member Data Documentation

Definition at line 35 of file request_with_state.h.

Referenced by stxxl::serving_request::completed().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines