STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::request Class Reference

Detailed Description

Request with basic properties like file and offset.

Definition at line 39 of file request.h.

+ Inheritance diagram for stxxl::request:
+ Collaboration diagram for stxxl::request:

Public Member Functions

 request (const completion_handler &on_compl, file *file__, void *buffer_, offset_type offset_, size_type bytes_, request_type type_)
 
virtual ~request ()
 
void check_alignment () const
 
void check_errors () throw (stxxl::io_error)
 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
 
fileget_file () const
 
offset_type get_offset () const
 
size_type get_size () const
 
request_type get_type () const
 
std::ostream & print (std::ostream &out) const
 Dumps properties of a request. More...
 
- Public Member Functions inherited from stxxl::request_interface
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...
 
virtual bool poll ()=0
 Polls the status of the request. More...
 
virtual void serve ()=0
 
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_objectoperator= (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)
 
void completed ()
 
- Protected Member Functions inherited from stxxl::request_interface
virtual void notify_waiters ()=0
 

Protected Attributes

void * buffer
 
size_type bytes
 
compat_unique_ptr
< stxxl::io_error >::result 
error
 
filefile_
 
offset_type offset
 
completion_handler on_complete
 
request_type 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
 

Constructor & Destructor Documentation

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

Member Function Documentation

void stxxl::request::check_alignment ( ) const

Definition at line 52 of file request.cpp.

References BLOCK_ALIGN, buffer, bytes, offset, and STXXL_ERRMSG.

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 89 of file request.h.

void stxxl::request::check_nref ( bool  after = false)
inlineprotected

Definition at line 96 of file request.h.

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

void stxxl::request::check_nref_failed ( bool  after)
private
void stxxl::request::completed ( )
protectedvirtual
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 76 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 83 of file request.h.

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

Definition at line 65 of file request.h.

Referenced by print().

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

Definition at line 64 of file request.h.

Referenced by check_nref_failed(), and print().

offset_type stxxl::request::get_offset ( ) const
inline

Definition at line 66 of file request.h.

Referenced by print().

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

Definition at line 67 of file request.h.

References bytes.

Referenced by print().

request_type stxxl::request::get_type ( ) const
inline
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<<().

Member Data Documentation

void* stxxl::request::buffer
protected

Definition at line 47 of file request.h.

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

size_type stxxl::request::bytes
protected

Definition at line 49 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 43 of file request.h.

file* stxxl::request::file_
protected
offset_type stxxl::request::offset
protected

Definition at line 48 of file request.h.

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

completion_handler stxxl::request::on_complete
protected

Definition at line 42 of file request.h.

Referenced by completed().

request_type stxxl::request::type
protected

Definition at line 50 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: