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

Detailed Description

Request object encapsulating basic properties like file and offset.

Definition at line 38 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 ()
 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
 
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 ()
 
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_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)
 
- 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
 
filem_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
 

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 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().

void stxxl::request::check_errors ( )
inline

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

Definition at line 88 of file request.h.

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

Definition at line 97 of file request.h.

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

void stxxl::request::check_nref_failed ( bool  after)
private
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 75 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 82 of file request.h.

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

Definition at line 64 of file request.h.

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

Definition at line 63 of file request.h.

Referenced by stxxl::disk_queues::add_request().

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

Definition at line 65 of file request.h.

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

Definition at line 66 of file request.h.

request_type stxxl::request::get_type ( ) const
inline
const char * stxxl::request::io_type ( ) const
virtual

Identifies the type of I/O implementation.

Returns
pointer to null terminated string of characters, containing the name 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.

std::ostream & stxxl::request::print ( std::ostream &  out) const
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<<().

Member Data Documentation

void* stxxl::request::m_buffer
protected

Definition at line 48 of file request.h.

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

size_type stxxl::request::m_bytes
protected

Definition at line 50 of file request.h.

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

compat_unique_ptr<stxxl::io_error>::result stxxl::request::m_error
protected

Definition at line 44 of file request.h.

file* stxxl::request::m_file
protected
offset_type stxxl::request::m_offset
protected

Definition at line 49 of file request.h.

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

completion_handler stxxl::request::m_on_complete
protected

Definition at line 43 of file request.h.

request_type stxxl::request::m_type
protected

Definition at line 51 of file request.h.

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


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