Stxxl
1.4.0
|
Functional interface of a request. More...
#include <request_interface.h>
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. | |
virtual bool | cancel ()=0 |
Cancel a request. | |
virtual bool | poll ()=0 |
Polls the status of the request. | |
virtual const char * | io_type () const =0 |
Identifies the type of I/O implementation. | |
virtual std::ostream & | print (std::ostream &out) const =0 |
Dumps properties of a request. | |
virtual | ~request_interface () |
Protected Member Functions | |
virtual void | notify_waiters ()=0 |
virtual void | completed ()=0 |
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 37 of file request_interface.h.
Definition at line 40 of file request_interface.h.
Definition at line 41 of file request_interface.h.
Definition at line 42 of file request_interface.h.
virtual stxxl::request_interface::~request_interface | ( | ) | [inline, virtual] |
Definition at line 82 of file request_interface.h.
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.
true
iff the request was canceled successfully Implemented in stxxl::request_with_state.
virtual void stxxl::request_interface::completed | ( | ) | [protected, pure virtual] |
Implemented in stxxl::request, and stxxl::serving_request.
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.
Implemented in stxxl::serving_request.
Referenced by stxxl::request::check_nref_failed().
virtual void stxxl::request_interface::notify_waiters | ( | ) | [protected, pure virtual] |
Implemented in stxxl::request_with_waiters.
Referenced by stxxl::request::completed().
virtual bool stxxl::request_interface::poll | ( | ) | [pure virtual] |
Polls the status of the request.
true
if request is completed, otherwise false
Implemented in stxxl::request_with_state.
virtual std::ostream& stxxl::request_interface::print | ( | std::ostream & | out | ) | const [pure virtual] |
Dumps properties of a request.
Implemented in stxxl::request.
virtual void stxxl::request_interface::serve | ( | ) | [pure virtual] |
Implemented in stxxl::serving_request.
Referenced by stxxl::fileperblock_file< base_file_type >::serve(), stxxl::request_queue_impl_1q::worker(), and stxxl::request_queue_impl_qwqr::worker().
virtual void stxxl::request_interface::wait | ( | bool | measure_time = true | ) | [pure virtual] |
Suspends calling thread until completion of the request.
Implemented in stxxl::request_with_state.
Referenced by stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >::clean_sync(), stxxl::stream::basic_runs_creator< Input_, CompareType_, BlockSize_, AllocStr_ >::compute_result(), stxxl::ksort_local::create_runs(), stxxl::ksort(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, RawSize_, BTreeType >::load(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::load(), stxxl::fileperblock_file< base_file_type >::lock(), main(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::multi_merge(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, RawSize_, BTreeType >::save(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::save(), stxxl::sort(), stxxl::stable_ksort(), and stxxl::buffered_writer< block_type >::write().