Stxxl  1.2.1
Public Member Functions
mem_file Class Reference

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

#include <mem_file.h>

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

List of all members.

Public Member Functions

 mem_file (int disk=-1)
 constructs file object
request_ptr aread (void *buffer, stxxl::int64 pos, size_t bytes, completion_handler on_cmpl)
 Schedules asynchronous read request to the file.
request_ptr awrite (void *buffer, stxxl::int64 pos, size_t bytes, completion_handler on_cmpl)
 Schedules asynchronous write request to the file.
stxxl::int64 size ()
 Returns size of the file.
void set_size (stxxl::int64 newsize)
 Changes the size of the file.

Detailed Description

Implementation of file based on new[] and memcpy.


Constructor & Destructor Documentation

mem_file::mem_file ( int  disk = -1)

constructs file object

Parameters:
diskdisk(file) identifier

Member Function Documentation

request_ptr mem_file::aread ( void *  buffer,
stxxl::int64  pos,
size_t  bytes,
completion_handler  on_cmpl 
) [virtual]

Schedules asynchronous read request to the file.

Parameters:
bufferpointer to memory buffer to read into
posstarting file position to read
bytesnumber of bytes to transfer
on_cmplI/O completion handler
Returns:
request_ptr object, that can be used to track the status of the operation

Implements file.

References request_ptr::get().

request_ptr mem_file::awrite ( void *  buffer,
stxxl::int64  pos,
size_t  bytes,
completion_handler  on_cmpl 
) [virtual]

Schedules asynchronous write request to the file.

Parameters:
bufferpointer to memory buffer to write from
posstarting file position to write
bytesnumber of bytes to transfer
on_cmplI/O completion handler
Returns:
request_ptr object, that can be used to track the status of the operation

Implements file.

References request_ptr::get().

void mem_file::set_size ( stxxl::int64  newsize) [virtual]

Changes the size of the file.

Parameters:
newsizevalue of the new file size

Implements file.

stxxl::int64 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: