Thrill  0.1

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

◆ offset_type

using offset_type = uint64_t

type for offsets within a file

Definition at line 38 of file request_interface.hpp.

◆ size_type

using size_type = size_t

type for block transfer sizes

Definition at line 40 of file request_interface.hpp.

Member Enumeration Documentation

◆ read_or_write

Enumerator
READ 
WRITE 

Definition at line 42 of file request_interface.hpp.

Constructor & Destructor Documentation

◆ request_interface() [1/2]

request_interface ( )
default

◆ request_interface() [2/2]

request_interface ( const request_interface )
delete

non-copyable: delete copy-constructor

◆ ~request_interface()

Member Function Documentation

◆ add_waiter()

virtual bool add_waiter ( onoff_switch sw)
pure virtual

Implemented in request_with_waiters.

◆ cancel()

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.

Referenced by request_interface::~request_interface().

◆ completed()

virtual void completed ( bool  canceled)
protectedpure virtual

Implemented in request_with_state.

◆ delete_waiter()

virtual void delete_waiter ( onoff_switch sw)
pure virtual

Implemented in request_with_waiters.

◆ io_type()

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.

Referenced by request_interface::~request_interface().

◆ notify_waiters()

virtual void notify_waiters ( )
protectedpure virtual

Implemented in request_with_waiters.

◆ operator=()

request_interface& operator= ( const request_interface )
delete

non-copyable: delete assignment operator

◆ poll()

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(), and request_interface::~request_interface().

◆ print()

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

Dumps properties of a request.

Implemented in request.

Referenced by request_interface::~request_interface().

◆ wait()

virtual void wait ( bool  measure_time = true)
pure virtual

Suspends calling thread until completion of the request.

Implemented in request_with_state.

Referenced by request_interface::~request_interface().


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