Public Member Functions | Friends

request Class Reference
[I/O primitives layer]

Defines interface of request. More...

#include <iobase.h>

Inheritance diagram for request:
Inheritance graph
[legend]
Collaboration diagram for request:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void wait ()=0
 Suspends calling thread until completion of the request.
virtual bool poll ()=0
 Polls the status of the request.
virtual const char * io_type ()
 Identifies the type of request I/O implementation.
void error_occured (const char *msg)
 Inform the request object that an error occurred during the I/O execution.
void error_occured (const std::string &msg)
 Inform the request object that an error occurred during the I/O execution.
void check_errors () throw (stxxl::io_error)
 Rises an exception if there were error with the I/O.

Friends

int wait_any (request_ptr req_array[], int count)
 Collection of functions to track statuses of a number of requests.

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

void request::check_errors (  )  throw (stxxl::io_error) [inline]

Rises an exception if there were error with the I/O.

Referenced by ufs_request_base::poll(), mem_request::poll(), ufs_request_base::wait(), and mem_request::wait().

void request::error_occured ( const std::string &  msg  )  [inline]

Inform the request object that an error occurred during the I/O execution.

void request::error_occured ( const char *  msg  )  [inline]

Inform the request object that an error occurred during the I/O execution.

virtual const char* request::io_type (  )  [inline, virtual]

Identifies the type of request I/O implementation.

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

Reimplemented in mem_request, mmap_request, sim_disk_request, syscall_request, and ufs_request_base.

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

Polls the status of the request.

Returns:
true if request is completed, otherwise false

Implemented in mem_request, and ufs_request_base.

virtual void request::wait (  )  [pure virtual]

Suspends calling thread until completion of the request.

Implemented in mem_request, and ufs_request_base.


Friends And Related Function Documentation

int wait_any ( request_ptr  req_array[],
int  count 
) [friend]

Collection of functions to track statuses of a number of requests.

Suspends calling thread until any of requests is completed

Parameters:
req_array array of request_ptr objects
count size of req_array
Returns:
index in req_array pointing to the first completed request

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