Implementation of file based on new[] and memcpy.
More...
#include <mem_file.h>
List of all members.
Public Member Functions |
| mem_file (int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR) |
| constructs file object
|
void | serve (const request *req) throw (io_error) |
offset_type | size () |
| Returns size of the file.
|
void | set_size (offset_type newsize) |
| Changes the size of the file.
|
void | lock () |
| Locks file for reading and writing (acquires a lock in the file system)
|
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.
|
const char * | io_type () const |
| Identifies the type of I/O implementation.
|
| 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.
|
request_ptr | awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl) |
| Schedules an asynchronous write request to the file.
|
virtual int | get_queue_id () const |
| Returns the identifier of the file's queue.
|
virtual int | get_allocator_id () const |
| Returns the file's allocator.
|
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 () |
Detailed Description
Implementation of file based on new[] and memcpy.
Constructor & Destructor Documentation
mem_file::mem_file |
( |
int |
queue_id = DEFAULT_QUEUE , |
|
|
int |
allocator_id = NO_ALLOCATOR |
|
) |
| |
|
inline |
constructs file object
- Parameters:
-
disk | disk(file) identifier |
Member Function Documentation
void mem_file::discard |
( |
offset_type |
offset, |
|
|
offset_type |
size |
|
) |
| |
|
virtual |
Discard a region of the file (mark it unused) some specialized file types may need to know freed regions.
Reimplemented from file.
const char * mem_file::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
Reimplemented from file.
Locks file for reading and writing (acquires a lock in the file system)
Implements file.
void mem_file::set_size |
( |
offset_type |
newsize | ) |
|
|
virtual |
Changes the size of the file.
- Parameters:
-
Implements file.
file::offset_type mem_file::size |
( |
| ) |
|
|
virtual |
Returns size of the file.
- Returns:
- file size in bytes
Implements file.
The documentation for this class was generated from the following files: