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

Detailed Description

Implementation of some file methods based on serving_request.

Definition at line 30 of file disk_queued_file.h.

+ Inheritance diagram for stxxl::disk_queued_file:
+ Collaboration diagram for stxxl::disk_queued_file:

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=completion_handler())
 
request_ptr awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())
 
virtual int get_allocator_id () const
 Returns the file's disk allocator number. More...
 
virtual int get_queue_id () const
 Returns the identifier of the file's queue number. More...
 
- Public Member Functions inherited from stxxl::file
 file (unsigned int device_id=DEFAULT_DEVICE_ID)
 Construct a new file, usually called by a subclass. More...
 
virtual ~file ()
 
void add_request_ref ()
 increment referenced requests More...
 
virtual request_ptr aread (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())=0
 Schedules an asynchronous read request to the file. More...
 
virtual request_ptr awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())=0
 Schedules an asynchronous write request to the file. More...
 
virtual void close_remove ()
 close and remove file More...
 
void delete_request_ref ()
 decrement referenced requests 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)
 
unsigned int get_device_id () const
 Returns the file's physical device id. More...
 
unsigned_type get_request_nref ()
 return number of referenced requests More...
 
virtual const char * io_type () const =0
 Identifies the type of I/O implementation. More...
 
virtual void lock ()=0
 Locks file for reading and writing (acquires a lock in the file system). More...
 
virtual void serve (void *buffer, offset_type offset, size_type bytes, request::request_type type)=0
 
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...
 

Private Attributes

int m_allocator_id
 
int m_queue_id
 

Additional Inherited Members

- Public Types inherited from stxxl::file
typedef request::offset_type offset_type
 the offset of a request, also the size of the file More...
 
enum  open_mode {
  RDONLY = 1, WRONLY = 2, RDWR = 4, CREAT = 8,
  DIRECT = 16, TRUNC = 32, SYNC = 64, NO_LOCK = 128,
  REQUIRE_DIRECT = 256
}
 Definition of acceptable file open modes. More...
 
typedef request::size_type size_type
 the size of a request More...
 
- Static Public Member Functions inherited from stxxl::file
static int unlink (const char *path)
 unlink path from filesystem More...
 
static int truncate (const char *path, external_size_type length)
 truncate a path to given length. Use this only if you dont have a fileio-specific object, which provides truncate(). More...
 
- Static Public Attributes inherited from stxxl::file
static const unsigned int DEFAULT_DEVICE_ID = (unsigned int)(-1)
 
static const int DEFAULT_LINUXAIO_QUEUE = -2
 
static const int DEFAULT_QUEUE = -1
 
static const int NO_ALLOCATOR = -1
 
- Protected Attributes inherited from stxxl::file
unsigned int m_device_id
 The file's physical device id (e.g. used for prefetching sequence calculation) More...
 
atomic_counted_object m_request_ref
 count the number of requests referencing this file More...
 

Constructor & Destructor Documentation

stxxl::disk_queued_file::disk_queued_file ( int  queue_id,
int  allocator_id 
)
inline

Definition at line 35 of file disk_queued_file.h.

Member Function Documentation

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

Definition at line 24 of file disk_queued_file.cpp.

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

Definition at line 38 of file disk_queued_file.cpp.

virtual int stxxl::disk_queued_file::get_allocator_id ( ) const
inlinevirtual

Returns the file's disk allocator number.

Implements stxxl::file.

Definition at line 56 of file disk_queued_file.h.

virtual int stxxl::disk_queued_file::get_queue_id ( ) const
inlinevirtual

Returns the identifier of the file's queue number.

Remarks
Files allocated on the same physical device usually share the same queue, unless there is a common queue (e.g. with linuxaio).

Implements stxxl::file.

Definition at line 51 of file disk_queued_file.h.

Member Data Documentation

int stxxl::disk_queued_file::m_allocator_id
private

Definition at line 32 of file disk_queued_file.h.

int stxxl::disk_queued_file::m_queue_id
private

Definition at line 32 of file disk_queued_file.h.


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