STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::request_interface Class Referenceabstract

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.

Definition at line 36 of file request_interface.h.

+ Inheritance diagram for stxxl::request_interface:
+ Collaboration diagram for stxxl::request_interface:

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Additional Inherited Members

- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
READ 
WRITE 

Definition at line 41 of file request_interface.h.

Constructor & Destructor Documentation

virtual stxxl::request_interface::~request_interface ( )
inlinevirtual

Definition at line 77 of file request_interface.h.

Member Function Documentation

virtual bool stxxl::request_interface::add_waiter ( onoff_switch sw)
pure virtual

Implemented in stxxl::request_with_waiters.

virtual bool stxxl::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.

Returns
true iff the request was canceled successfully

Implemented in stxxl::linuxaio_request, and stxxl::request_with_state.

virtual void stxxl::request_interface::completed ( bool  canceled)
protectedpure virtual
virtual void stxxl::request_interface::delete_waiter ( onoff_switch sw)
pure virtual

Implemented in stxxl::request_with_waiters.

virtual const char* stxxl::request_interface::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 stxxl::request, and stxxl::serving_request.

virtual void stxxl::request_interface::notify_waiters ( )
protectedpure virtual

Implemented in stxxl::request_with_waiters.

virtual bool stxxl::request_interface::poll ( )
pure virtual

Polls the status of the request.

Returns
true if request is completed, otherwise false

Implemented in stxxl::request_with_state.

Referenced by stxxl::prefetch_pool< BlockType >::poll().

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

Dumps properties of a request.

Implemented in stxxl::request.


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