Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
stxxl::request Class Reference

Request with basic properties like file and offset. More...

#include <request.h>

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

List of all members.

Public Member Functions

int nref ()
 request (const completion_handler &on_compl, file *file__, void *buffer_, offset_type offset_, size_type bytes_, request_type type_)
virtual ~request ()
fileget_file () const
void * get_buffer () const
offset_type get_offset () const
size_type get_size () const
request_type get_type () const
void check_alignment () const
std::ostream & print (std::ostream &out) const
 Dumps properties of a request.
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.

Protected Member Functions

void completed ()
void check_nref (bool after=false)

Protected Attributes

completion_handler on_complete
int ref_cnt
compat_unique_ptr
< stxxl::io_error >::result 
error
mutex ref_cnt_mutex
filefile_
void * buffer
offset_type offset
size_type bytes
request_type type

Private Member Functions

void add_ref ()
bool sub_ref ()
void check_nref_failed (bool after)

Detailed Description

Request with basic properties like file and offset.

Examples:
io/test_cancel.cpp, io/test_io.cpp, and mng/test_mng.cpp.

Definition at line 39 of file request.h.


Constructor & Destructor Documentation

stxxl::request::request ( const completion_handler on_compl,
file file__,
void *  buffer_,
offset_type  offset_,
size_type  bytes_,
request_type  type_ 
)

Definition at line 22 of file request.cpp.

References stxxl::file::add_request_ref(), file_, and ref_cnt.

stxxl::request::~request ( ) [virtual]

Definition at line 39 of file request.cpp.

References ref_cnt.


Member Function Documentation

void stxxl::request::add_ref ( ) [inline, private]

Definition at line 108 of file request.h.

Referenced by stxxl::request_ptr::add_ref().

Definition at line 52 of file request.cpp.

References BLOCK_ALIGN, buffer, bytes, and offset.

Referenced by stxxl::serving_request::serving_request().

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

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

Definition at line 101 of file request.h.

void stxxl::request::check_nref ( bool  after = false) [inline, protected]

Definition at line 128 of file request.h.

Referenced by stxxl::serving_request::serve().

void stxxl::request::check_nref_failed ( bool  after) [private]
void stxxl::request::completed ( ) [protected, virtual]
void stxxl::request::error_occured ( const char *  msg) [inline]

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

Definition at line 88 of file request.h.

Referenced by stxxl::serving_request::serve().

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

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

Definition at line 95 of file request.h.

void* stxxl::request::get_buffer ( ) const [inline]

Definition at line 77 of file request.h.

Referenced by print().

file* stxxl::request::get_file ( ) const [inline]

Definition at line 76 of file request.h.

Referenced by check_nref_failed(), and print().

Definition at line 78 of file request.h.

Referenced by print().

size_type stxxl::request::get_size ( ) const [inline]

Definition at line 79 of file request.h.

Referenced by print().

int stxxl::request::nref ( ) [inline]

Definition at line 61 of file request.h.

Referenced by check_nref_failed(), and stxxl::request_queue_impl_qwqr::worker().

std::ostream & stxxl::request::print ( std::ostream &  out) const [virtual]

Dumps properties of a request.

Implements stxxl::request_interface.

Definition at line 83 of file request.cpp.

References get_buffer(), get_file(), get_offset(), get_size(), get_type(), and stxxl::request_interface::READ.

Referenced by stxxl::operator<<().

bool stxxl::request::sub_ref ( ) [inline, private]

Definition at line 115 of file request.h.


Member Data Documentation

void* stxxl::request::buffer [protected]

Definition at line 52 of file request.h.

Referenced by check_alignment(), check_nref_failed(), and stxxl::serving_request::serve().

Definition at line 54 of file request.h.

Referenced by check_alignment(), check_nref_failed(), and stxxl::serving_request::serve().

compat_unique_ptr<stxxl::io_error>::result stxxl::request::error [protected]

Definition at line 46 of file request.h.

Definition at line 53 of file request.h.

Referenced by check_alignment(), check_nref_failed(), and stxxl::serving_request::serve().

Definition at line 44 of file request.h.

Referenced by completed().

int stxxl::request::ref_cnt [protected]

Definition at line 45 of file request.h.

Referenced by request(), and ~request().

Definition at line 48 of file request.h.

Definition at line 55 of file request.h.

Referenced by check_nref_failed(), and stxxl::serving_request::serve().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines