Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 34 of file request_interface.hpp.

+ Inheritance diagram for request_interface:

#include <request_interface.hpp>

Public Types

using offset_type = uint64_t
 type for offsets within a file More...
 
enum  read_or_write { READ, WRITE }
 
using size_type = size_t
 type for block transfer sizes More...
 

Public Member Functions

 request_interface ()=default
 
 request_interface (const request_interface &)=delete
 non-copyable: delete copy-constructor More...
 
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...
 
request_interfaceoperator= (const request_interface &)=delete
 non-copyable: delete assignment operator More...
 
virtual bool poll ()=0
 
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
 

Member Typedef Documentation

using offset_type = uint64_t

type for offsets within a file

Definition at line 38 of file request_interface.hpp.

using size_type = size_t

type for block transfer sizes

Definition at line 40 of file request_interface.hpp.

Member Enumeration Documentation

Enumerator
READ 
WRITE 

Definition at line 42 of file request_interface.hpp.

Constructor & Destructor Documentation

request_interface ( )
default
request_interface ( const request_interface )
delete

non-copyable: delete copy-constructor

virtual ~request_interface ( )
inlinevirtual

Definition at line 62 of file request_interface.hpp.

Member Function Documentation

virtual bool add_waiter ( onoff_switch sw)
pure virtual

Implemented in request_with_waiters.

virtual bool 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 request_with_state.

virtual void completed ( bool  canceled)
protectedpure virtual

Implemented in request_with_state.

virtual void delete_waiter ( onoff_switch sw)
pure virtual

Implemented in request_with_waiters.

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

virtual void notify_waiters ( )
protectedpure virtual

Implemented in request_with_waiters.

request_interface& operator= ( const request_interface )
delete

non-copyable: delete assignment operator

virtual bool poll ( )
pure virtual

Polls the status of the request.

Returns
true if request is completed, otherwise false

Implemented in request_with_state.

Referenced by request_with_waiters::add_waiter().

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

Dumps properties of a request.

Implemented in request.

virtual void wait ( bool  measure_time = true)
pure virtual

Suspends calling thread until completion of the request.

Implemented in request_with_state.


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