Stxxl  1.3.2
Public Member Functions | List of all members
disk_queued_file Class Reference

Implementation of some file methods based on serving_request. More...

#include <disk_queued_file.h>

Inheritance diagram for disk_queued_file:
Inheritance graph
[legend]
Collaboration diagram for disk_queued_file:
Collaboration graph
[legend]

Public Member Functions

 disk_queued_file (int queue_id, int allocator_id)
 
request_ptr aread (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)
 Schedules an asynchronous read request to the file. More...
 
request_ptr awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)
 Schedules an asynchronous write request to the file. More...
 
virtual int get_queue_id () const
 Returns the identifier of the file's queue. More...
 
virtual int get_allocator_id () const
 Returns the file's allocator. More...
 
- Public Member Functions inherited from file
virtual void serve (const request *req)=0 throw (io_error)
 
void add_request_ref ()
 
void delete_request_ref ()
 
int get_request_nref ()
 
virtual void set_size (offset_type newsize)=0
 Changes the size of the file. More...
 
virtual offset_type size ()=0
 Returns size of the file. More...
 
virtual int get_physical_device_id () const
 
virtual void lock ()=0
 Locks file for reading and writing (acquires a lock in the file system) More...
 
virtual void discard (offset_type offset, offset_type size)
 Discard a region of the file (mark it unused) some specialized file types may need to know freed regions. More...
 
virtual void export_files (offset_type offset, offset_type length, std::string prefix)
 
virtual void remove ()
 
virtual const char * io_type () const
 Identifies the type of I/O implementation. More...
 

Additional Inherited Members

- Public Types inherited from file
enum  open_mode {
  RDONLY = 1, WRONLY = 2, RDWR = 4, CREAT = 8,
  DIRECT = 16, TRUNC = 32, SYNC = 64, NO_LOCK = 128
}
 Definition of acceptable file open modes. More...
 
typedef request::offset_type offset_type
 
typedef request::size_type size_type
 
- Static Public Attributes inherited from file
static const int DEFAULT_QUEUE = -1
 
static const int NO_QUEUE = -2
 
static const int NO_ALLOCATOR = -1
 
- Protected Member Functions inherited from file
 file ()
 Initializes file object. More...
 

Detailed Description

Implementation of some file methods based on serving_request.

Member Function Documentation

__STXXL_BEGIN_NAMESPACE request_ptr disk_queued_file::aread ( void *  buffer,
offset_type  pos,
size_type  bytes,
const completion_handler on_cmpl 
)
virtual

Schedules an asynchronous read request to the file.

Parameters
bufferpointer to memory buffer to read into
posfile position to start read from
bytesnumber of bytes to transfer
on_cmplI/O completion handler
Returns
request_ptr request object, which can be used to track the status of the operation

Implements file.

References get_queue_id().

request_ptr disk_queued_file::awrite ( void *  buffer,
offset_type  pos,
size_type  bytes,
const completion_handler on_cmpl 
)
virtual

Schedules an asynchronous write request to the file.

Parameters
bufferpointer to memory buffer to write from
posstarting file position to write
bytesnumber of bytes to transfer
on_cmplI/O completion handler
Returns
request_ptr request object, which can be used to track the status of the operation

Implements file.

References get_queue_id().

virtual int disk_queued_file::get_allocator_id ( ) const
inlinevirtual

Returns the file's allocator.

Returns
allocator number

Implements file.

virtual int disk_queued_file::get_queue_id ( ) const
inlinevirtual

Returns the identifier of the file's queue.

Remarks
Files allocated on the same physical device usually share the same queue
Returns
queue number

Implements file.

Referenced by aread(), and awrite().


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