Stxxl
1.3.1
|
Implementation of file based on new[] and memcpy. More...
#include <mem_file.h>
Public Member Functions | |
mem_file (int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR) | |
constructs file object More... | |
void | serve (const request *req) throw (io_error) |
offset_type | size () |
Returns size of the file. More... | |
void | set_size (offset_type newsize) |
Changes the size of the file. More... | |
void | lock () |
Locks file for reading and writing (acquires a lock in the file system) More... | |
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... | |
const char * | io_type () const |
Identifies the type of I/O implementation. More... | |
![]() | |
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... | |
![]() | |
void | add_request_ref () |
void | delete_request_ref () |
int | get_request_nref () |
virtual int | get_physical_device_id () const |
virtual void | export_files (offset_type offset, offset_type length, std::string prefix) |
virtual void | remove () |
Additional Inherited Members | |
![]() | |
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 const int | DEFAULT_QUEUE = -1 |
static const int | NO_QUEUE = -2 |
static const int | NO_ALLOCATOR = -1 |
![]() | |
file () | |
Initializes file object. More... | |
Implementation of file based on new[] and memcpy.
|
inline |
constructs file object
disk | disk(file) identifier |
References discard(), io_type(), lock(), set_size(), and size().
|
virtual |
Discard a region of the file (mark it unused) some specialized file types may need to know freed regions.
Reimplemented from file.
Referenced by mem_file().
|
virtual |
Identifies the type of I/O implementation.
Reimplemented from file.
Referenced by mem_file().
|
virtual |
Locks file for reading and writing (acquires a lock in the file system)
Implements file.
Referenced by mem_file().
|
virtual |
Changes the size of the file.
newsize | new file size |
Implements file.
Referenced by mem_file().
|
virtual |