Stxxl
1.4.0
|
Base for UNIX file system implementations. More...
#include <ufs_file_base.h>
Public Member Functions | |
~ufs_file_base () | |
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) | |
const char * | io_type () const |
Identifies the type of I/O implementation. | |
void | remove () |
void | unlink () |
Protected Member Functions | |
ufs_file_base (const std::string &filename, int mode) | |
offset_type | _size () |
void | close () |
Protected Attributes | |
mutex | fd_mutex |
int | file_des |
int | mode_ |
const std::string | filename |
Base for UNIX file system implementations.
Definition at line 30 of file ufs_file_base.h.
stxxl::ufs_file_base::ufs_file_base | ( | const std::string & | filename, |
int | mode | ||
) | [protected] |
Definition at line 36 of file ufs_file_base.cpp.
References stxxl::file::CREAT, stxxl::file::DIRECT, file_des, lock(), stxxl::file::NO_LOCK, O_DIRECT, O_DSYNC, O_RSYNC, O_SYNC, stxxl::file::RDONLY, stxxl::file::RDWR, STXXL_THROW2, stxxl::file::SYNC, stxxl::file::TRUNC, and stxxl::file::WRONLY.
Definition at line 100 of file ufs_file_base.cpp.
References close().
file::offset_type stxxl::ufs_file_base::_size | ( | ) | [protected] |
Definition at line 134 of file ufs_file_base.cpp.
References file_des, and stxxl_check_ge_0.
Referenced by set_size(), and size().
void stxxl::ufs_file_base::close | ( | ) | [protected] |
Definition at line 105 of file ufs_file_base.cpp.
References fd_mutex, file_des, and stxxl_function_error.
Referenced by remove(), and ~ufs_file_base().
const char * stxxl::ufs_file_base::io_type | ( | ) | const [virtual] |
Identifies the type of I/O implementation.
Reimplemented from stxxl::file.
Reimplemented in stxxl::sim_disk_file, stxxl::mmap_file, and stxxl::syscall_file.
Definition at line 31 of file ufs_file_base.cpp.
void stxxl::ufs_file_base::lock | ( | ) | [virtual] |
Locks file for reading and writing (acquires a lock in the file system)
Implements stxxl::file.
Definition at line 118 of file ufs_file_base.cpp.
References fd_mutex, file_des, filename, mode_, stxxl::file::RDONLY, and STXXL_THROW2.
Referenced by stxxl::create_file(), and ufs_file_base().
void stxxl::ufs_file_base::remove | ( | ) | [virtual] |
Reimplemented from stxxl::file.
Definition at line 184 of file ufs_file_base.cpp.
References close(), and filename.
Referenced by unlink().
void stxxl::ufs_file_base::set_size | ( | offset_type | newsize | ) | [virtual] |
Changes the size of the file.
newsize | new file size |
Implements stxxl::file.
Reimplemented in stxxl::sim_disk_file.
Definition at line 152 of file ufs_file_base.cpp.
References _size(), fd_mutex, file_des, mode_, stxxl::file::RDONLY, and stxxl_check_ge_0.
Referenced by main().
file::offset_type stxxl::ufs_file_base::size | ( | ) | [virtual] |
Returns size of the file.
Implements stxxl::file.
Definition at line 146 of file ufs_file_base.cpp.
References _size(), and fd_mutex.
Referenced by main().
void stxxl::ufs_file_base::unlink | ( | ) |
Definition at line 190 of file ufs_file_base.cpp.
References filename, and remove().
Referenced by stxxl::create_file().
mutex stxxl::ufs_file_base::fd_mutex [protected] |
Definition at line 33 of file ufs_file_base.h.
Referenced by close(), lock(), set_size(), and size().
int stxxl::ufs_file_base::file_des [protected] |
Definition at line 34 of file ufs_file_base.h.
Referenced by _size(), close(), lock(), set_size(), and ufs_file_base().
const std::string stxxl::ufs_file_base::filename [protected] |
Definition at line 36 of file ufs_file_base.h.
int stxxl::ufs_file_base::mode_ [protected] |
Definition at line 35 of file ufs_file_base.h.
Referenced by lock(), and set_size().