Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
stxxl::mem_file Class Reference

Implementation of file based on new[] and memcpy. More...

#include <mem_file.h>

Inheritance diagram for stxxl::mem_file:
Inheritance graph
[legend]
Collaboration diagram for stxxl::mem_file:
Collaboration graph
[legend]

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)
 ~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

Detailed Description

Implementation of file based on new[] and memcpy.

Definition at line 27 of file mem_file.h.


Constructor & Destructor Documentation

stxxl::mem_file::mem_file ( int  queue_id = DEFAULT_QUEUE,
int  allocator_id = NO_ALLOCATOR 
) [inline]

constructs file object

Parameters:
diskdisk(file) identifier

Definition at line 35 of file mem_file.h.

Definition at line 47 of file mem_file.cpp.


Member Function Documentation

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.

Returns:
pointer to null terminated string of characters, containing the name 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.

Parameters:
newsizenew file size

Implements stxxl::file.

Definition at line 63 of file mem_file.cpp.

Returns size of the file.

Returns:
file size in bytes

Implements stxxl::file.

Definition at line 58 of file mem_file.cpp.


Member Data Documentation

char* stxxl::mem_file::ptr [private]

Definition at line 29 of file mem_file.h.

Definition at line 30 of file mem_file.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines