Stxxl  1.3.2
Public Types | Public Member Functions | Protected Member Functions | List of all members
request_interface Class Referenceabstract

Functional interface of a request. More...

#include <request_interface.h>

Inheritance diagram for request_interface:
Inheritance graph

Public Types

enum  request_type { READ, WRITE }
typedef stxxl::external_size_type offset_type
typedef stxxl::internal_size_type size_type

Public Member Functions

virtual bool add_waiter (onoff_switch *sw)=0
virtual void delete_waiter (onoff_switch *sw)=0
virtual void serve ()=0
virtual void wait (bool measure_time=true)=0
 Suspends calling thread until completion of the request. More...
virtual bool cancel ()=0
 Cancel a request. More...
virtual bool poll ()=0
 Polls the status of the request. More...
virtual const char * io_type () const =0
 Identifies the type of I/O implementation. More...
virtual std::ostream & print (std::ostream &out) const =0
 Dumps properties of a request. More...

Protected Member Functions

virtual void notify_waiters ()=0
virtual void completed ()=0

Detailed Description

Functional interface of a request.

Since all library I/O operations are asynchronous, one needs to keep track of their status: e.g. whether an I/O operation completed or not.

Member Function Documentation

virtual bool request_interface::cancel ( )
pure 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

Implemented in request_with_state.

virtual const char* request_interface::io_type ( ) const
pure virtual

Identifies the type of I/O implementation.

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

Implemented in serving_request.

virtual bool request_interface::poll ( )
pure virtual

Polls the status of the request.

true if request is completed, otherwise false

Implemented in request_with_state.

Referenced by buffered_writer< typed_block >::get_free_block().

virtual std::ostream& request_interface::print ( std::ostream &  out) const
pure virtual

Dumps properties of a request.

Implemented in request.

virtual void request_interface::wait ( bool  measure_time = true)
pure virtual

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