Public Types | Public Member Functions | Protected Member Functions

request_base Class Reference
[I/O primitives layer]

Defines interface of request. More...

#include <request.h>

Inheritance diagram for request_base:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

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.


Member Function Documentation

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.

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

Returns:
pointer to null terminated string of characters, containing the name of I/O implementation

Implemented in request_impl_basic.

virtual bool request_base::poll (  )  [pure virtual]

Polls the status of the request.

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


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