|
Stxxl 1.2.1
|
Defines interface of file. More...
#include <iobase.h>

Public Types | |
| enum | open_mode { RDONLY = 1, WRONLY = 2, RDWR = 4, CREAT = 8, DIRECT = 16, TRUNC = 32 } |
Definition of acceptable file open modes. More... | |
Public Member Functions | |
| virtual request_ptr | aread (void *buffer, stxxl::int64 pos, size_t bytes, completion_handler on_cmpl)=0 |
| Schedules asynchronous read request to the file. | |
| virtual request_ptr | awrite (void *buffer, stxxl::int64 pos, size_t bytes, completion_handler on_cmpl)=0 |
| Schedules asynchronous write request to the file. | |
| virtual void | set_size (stxxl::int64 newsize)=0 |
| Changes the size of the file. | |
| virtual stxxl::int64 | size ()=0 |
| Returns size of the file. | |
Protected Member Functions | |
| file (int _id) | |
| Initializes file object. | |
Defines interface of file.
It is a base class for different implementations that might base on various file systems or even remote storage interfaces
| enum file::open_mode |
Definition of acceptable file open modes.
Various open modes in a file system must be converted to this set of acceptable modes
| file::file | ( | int | _id | ) | [inline, protected] |
Initializes file object.
| _id | file identifier |
| virtual request_ptr file::aread | ( | void * | buffer, |
| stxxl::int64 | pos, | ||
| size_t | bytes, | ||
| completion_handler | on_cmpl | ||
| ) | [pure virtual] |
Schedules asynchronous read request to the file.
| buffer | pointer to memory buffer to read into |
| pos | starting file position to read |
| bytes | number of bytes to transfer |
| on_cmpl | I/O completion handler |
request_ptr object, that can be used to track the status of the operation Implemented in mem_file, mmap_file, sim_disk_file, and syscall_file.
Referenced by typed_block< sizeof(value_type), value_type >::read().
| virtual request_ptr file::awrite | ( | void * | buffer, |
| stxxl::int64 | pos, | ||
| size_t | bytes, | ||
| completion_handler | on_cmpl | ||
| ) | [pure virtual] |
Schedules asynchronous write request to the file.
| buffer | pointer to memory buffer to write from |
| pos | starting file position to write |
| bytes | number of bytes to transfer |
| on_cmpl | I/O completion handler |
request_ptr object, that can be used to track the status of the operation Implemented in mem_file, mmap_file, sim_disk_file, and syscall_file.
Referenced by typed_block< sizeof(value_type), value_type >::write().
| virtual void file::set_size | ( | stxxl::int64 | newsize | ) | [pure virtual] |
Changes the size of the file.
| newsize | value of the new file size |
Implemented in mem_file, sim_disk_file, and ufs_file_base.
Referenced by vector< Tp_, PgSz_, PgTp_, BlkSize_, AllocStr_, SzTp_ >::vector().
| virtual stxxl::int64 file::size | ( | ) | [pure virtual] |
1.7.3