STXXL
1.4-dev
|
Request object encapsulating basic properties like file and offset.
Public Member Functions | |
request (const completion_handler &on_compl, file *file, void *buffer, offset_type offset, size_type bytes, request_type type) | |
virtual | ~request () noexcept(false) |
void | check_alignment () const |
void | check_errors () |
Rises an exception if there were error with the I/O. More... | |
void | error_occured (const char *msg) |
Inform the request object that an error occurred during the I/O execution. More... | |
void | error_occured (const std::string &msg) |
Inform the request object that an error occurred during the I/O execution. More... | |
void * | get_buffer () const |
file * | get_file () const |
offset_type | get_offset () const |
size_type | get_size () const |
request_type | get_type () const |
virtual const char * | io_type () const |
Identifies the type of I/O implementation. More... | |
std::ostream & | print (std::ostream &out) const |
Dumps properties of a request. More... | |
Public Member Functions inherited from stxxl::request_interface | |
virtual | ~request_interface () noexcept(false) |
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 bool | poll ()=0 |
Polls the status of the request. More... | |
virtual void | wait (bool measure_time=true)=0 |
Suspends calling thread until completion of the request. More... | |
Public Member Functions inherited from stxxl::atomic_counted_object | |
atomic_counted_object () | |
new objects have zero reference count More... | |
atomic_counted_object (const atomic_counted_object &) | |
coping still creates a new object with zero reference count More... | |
~atomic_counted_object () | |
bool | dec_reference () const |
Call whenever resetting (i.e. overwriting) a pointer to the object. IMPORTANT: In case of self-assignment, call AFTER inc_reference(). More... | |
unsigned_type | get_reference_count () const |
Return the number of references to this object (for debugging) More... | |
void | inc_reference () const |
Call whenever setting a pointer to the object. More... | |
atomic_counted_object & | operator= (const atomic_counted_object &) |
assignment operator, leaves pointers unchanged More... | |
bool | unique () const |
Test if the counted_object is referenced by only one counting_ptr. More... | |
Protected Member Functions | |
void | check_nref (bool after=false) |
Protected Member Functions inherited from stxxl::request_interface | |
virtual void | completed (bool canceled)=0 |
virtual void | notify_waiters ()=0 |
Protected Attributes | |
void * | m_buffer |
size_type | m_bytes |
compat_unique_ptr < stxxl::io_error >::result | m_error |
file * | m_file |
offset_type | m_offset |
completion_handler | m_on_complete |
request_type | m_type |
Private Member Functions | |
void | check_nref_failed (bool after) |
Additional Inherited Members | |
Public Types inherited from stxxl::request_interface | |
typedef stxxl::external_size_type | offset_type |
enum | request_type { READ, WRITE } |
typedef stxxl::internal_size_type | size_type |
stxxl::request::request | ( | const completion_handler & | on_compl, |
file * | file, | ||
void * | buffer, | ||
offset_type | offset, | ||
size_type | bytes, | ||
request_type | type | ||
) |
Definition at line 21 of file request.cpp.
References stxxl::file::add_request_ref(), stxxl::atomic_counted_object::get_reference_count(), m_file, and STXXL_VERBOSE3_THIS.
|
virtualnoexcept |
Definition at line 39 of file request.cpp.
References stxxl::atomic_counted_object::get_reference_count(), and STXXL_VERBOSE3_THIS.
void stxxl::request::check_alignment | ( | ) | const |
Definition at line 44 of file request.cpp.
References m_buffer, m_bytes, m_offset, STXXL_BLOCK_ALIGN, and STXXL_ERRMSG.
Referenced by stxxl::serving_request::serving_request().
|
inline |
|
inlineprotected |
Definition at line 97 of file request.h.
Referenced by stxxl::serving_request::serve().
|
private |
Definition at line 60 of file request.cpp.
References stxxl::atomic_counted_object::get_reference_count(), stxxl::file::io_type(), m_buffer, m_bytes, m_file, m_offset, m_type, stxxl::request_interface::READ, and STXXL_ERRMSG.
|
inline |
Inform the request object that an error occurred during the I/O execution.
Definition at line 75 of file request.h.
Referenced by stxxl::serving_request::serve().
|
inline |
|
inline |
Definition at line 63 of file request.h.
Referenced by stxxl::disk_queues::add_request().
|
inline |
|
inline |
Definition at line 67 of file request.h.
Referenced by stxxl::request_queue_impl_qwqr::add_request(), and stxxl::request_queue_impl_qwqr::cancel_request().
|
virtual |
Identifies the type of I/O implementation.
Implements stxxl::request_interface.
Reimplemented in stxxl::serving_request.
Definition at line 75 of file request.cpp.
References stxxl::file::io_type(), and m_file.
|
virtual |
Dumps properties of a request.
Implements stxxl::request_interface.
Definition at line 80 of file request.cpp.
References m_buffer, m_bytes, m_file, m_offset, m_type, and stxxl::request_interface::READ.
Referenced by stxxl::operator<<().
|
protected |
Definition at line 48 of file request.h.
Referenced by check_alignment(), check_nref_failed(), print(), and stxxl::serving_request::serve().
|
protected |
Definition at line 50 of file request.h.
Referenced by check_alignment(), check_nref_failed(), print(), and stxxl::serving_request::serve().
|
protected |
|
protected |
Definition at line 47 of file request.h.
Referenced by check_nref_failed(), stxxl::serving_request::io_type(), io_type(), print(), request(), and stxxl::serving_request::serve().
|
protected |
Definition at line 49 of file request.h.
Referenced by check_alignment(), check_nref_failed(), print(), and stxxl::serving_request::serve().
|
protected |
|
protected |
Definition at line 51 of file request.h.
Referenced by check_nref_failed(), print(), and stxxl::serving_request::serve().