STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::linuxaio_request Class Reference

Detailed Description

Request for an linuxaio_file.

Definition at line 32 of file linuxaio_request.h.

+ Inheritance diagram for stxxl::linuxaio_request:
+ Collaboration diagram for stxxl::linuxaio_request:

Public Member Functions

 linuxaio_request (const completion_handler &on_cmpl, file *file, void *buffer, offset_type offset, size_type bytes, request_type type)
 
bool cancel ()
 Cancel the request. More...
 
bool cancel_aio ()
 Cancel already posted request. More...
 
void completed (bool posted, bool canceled)
 
void completed (bool canceled)
 
bool post ()
 Submits an I/O request to the OS. More...
 
- Public Member Functions inherited from stxxl::request_with_state
virtual ~request_with_state ()
 
bool cancel ()
 Cancel a request. More...
 
bool poll ()
 Polls the status of the request. More...
 
void wait (bool measure_time=true)
 Suspends calling thread until completion of the request. More...
 
- Public Member Functions inherited from stxxl::request_with_waiters
 request_with_waiters (const completion_handler &on_cmpl, file *f, void *buf, offset_type off, size_type b, request_type t)
 
- Public Member Functions inherited from stxxl::request
 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
 
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 () noexcept(false)
 
- 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...
 

Private Member Functions

void fill_control_block ()
 

Private Attributes

iocb cb
 control block of async request More...
 

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
 
- Protected Types inherited from stxxl::request_with_state
enum  request_state { OP = 0, DONE = 1, READY2DIE = 2 }
 states of request OP - operating, DONE - request served, READY2DIE - can be destroyed More...
 
- Protected Member Functions inherited from stxxl::request_with_state
 request_with_state (const completion_handler &on_cmpl, file *f, void *buf, offset_type off, size_type b, request_type t)
 
void completed (bool canceled)
 
- Protected Member Functions inherited from stxxl::request_with_waiters
bool add_waiter (onoff_switch *sw)
 
void delete_waiter (onoff_switch *sw)
 
void notify_waiters ()
 
size_t num_waiters ()
 returns number of waiters More...
 
- Protected Member Functions inherited from stxxl::request
void check_nref (bool after=false)
 
- Protected Attributes inherited from stxxl::request_with_state
state< request_statem_state
 
- Protected Attributes inherited from stxxl::request
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
 

Constructor & Destructor Documentation

stxxl::linuxaio_request::linuxaio_request ( const completion_handler on_cmpl,
file file,
void *  buffer,
offset_type  offset,
size_type  bytes,
request_type  type 
)
inline

Definition at line 43 of file linuxaio_request.h.

References STXXL_VERBOSE_LINUXAIO.

Member Function Documentation

bool stxxl::linuxaio_request::cancel ( )
virtual

Cancel the request.

Routine is called by user, as part of the request interface.

Implements stxxl::request_interface.

Definition at line 96 of file linuxaio_request.cpp.

References stxxl::linuxaio_queue::cancel_request(), and STXXL_VERBOSE_LINUXAIO.

bool stxxl::linuxaio_request::cancel_aio ( )

Cancel already posted request.

Definition at line 110 of file linuxaio_request.cpp.

References stxxl::linuxaio_queue::get_io_context(), stxxl::linuxaio_queue::handle_events(), and STXXL_VERBOSE_LINUXAIO.

void stxxl::linuxaio_request::completed ( bool  posted,
bool  canceled 
)

Definition at line 27 of file linuxaio_request.cpp.

References STXXL_VERBOSE_LINUXAIO.

void stxxl::linuxaio_request::completed ( bool  canceled)
inlinevirtual

Implements stxxl::request_interface.

Definition at line 64 of file linuxaio_request.h.

References completed().

Referenced by completed().

void stxxl::linuxaio_request::fill_control_block ( )
private

Definition at line 49 of file linuxaio_request.cpp.

References stxxl::ufs_file_base::file_des.

bool stxxl::linuxaio_request::post ( )

Submits an I/O request to the OS.

Returns
false if submission fails

Definition at line 66 of file linuxaio_request.cpp.

References stxxl::linuxaio_queue::get_io_context(), STXXL_THROW_ERRNO, STXXL_VERBOSE_LINUXAIO, and stxxl::timestamp().

Member Data Documentation

iocb stxxl::linuxaio_request::cb
private

control block of async request

Definition at line 38 of file linuxaio_request.h.


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