Stxxl
1.4.0
|
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 | |
void | serve (const request *req) throw (io_error) |
~mem_file () | |
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. | |
Private Attributes | |
char * | ptr |
offset_type | sz |
Implementation of file based on new[] and memcpy.
Definition at line 27 of file mem_file.h.
stxxl::mem_file::mem_file | ( | int | queue_id = DEFAULT_QUEUE , |
int | allocator_id = NO_ALLOCATOR |
||
) | [inline] |
constructs file object
disk | disk(file) identifier |
Definition at line 35 of file mem_file.h.
Definition at line 47 of file mem_file.cpp.
void stxxl::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 stxxl::file.
Definition at line 70 of file mem_file.cpp.
References BLOCK_ALIGN.
const char * stxxl::mem_file::io_type | ( | ) | const [virtual] |
Identifies the type of I/O implementation.
Reimplemented from stxxl::file.
Definition at line 42 of file mem_file.cpp.
void stxxl::mem_file::lock | ( | ) | [virtual] |
Locks file for reading and writing (acquires a lock in the file system)
Implements stxxl::file.
Definition at line 53 of file mem_file.cpp.
Referenced by stxxl::create_file().
void stxxl::mem_file::serve | ( | const request * | req | ) | throw (io_error) [virtual] |
Implements stxxl::file.
Definition at line 22 of file mem_file.cpp.
void stxxl::mem_file::set_size | ( | offset_type | newsize | ) | [virtual] |
Changes the size of the file.
newsize | new file size |
Implements stxxl::file.
Definition at line 63 of file mem_file.cpp.
file::offset_type stxxl::mem_file::size | ( | ) | [virtual] |
Returns size of the file.
Implements stxxl::file.
Definition at line 58 of file mem_file.cpp.
char* stxxl::mem_file::ptr [private] |
Definition at line 29 of file mem_file.h.
offset_type stxxl::mem_file::sz [private] |
Definition at line 30 of file mem_file.h.