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

Base for UNIX file system implementations. More...

#include <ufs_file_base.h>

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

List of all members.

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

Detailed Description

Base for UNIX file system implementations.

Definition at line 30 of file ufs_file_base.h.


Constructor & Destructor Documentation

stxxl::ufs_file_base::ufs_file_base ( const std::string &  filename,
int  mode 
) [protected]

Definition at line 100 of file ufs_file_base.cpp.

References close().


Member Function Documentation

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.

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

Parameters:
newsizenew 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().

Returns size of the file.

Returns:
file size in bytes

Implements stxxl::file.

Definition at line 146 of file ufs_file_base.cpp.

References _size(), and fd_mutex.

Referenced by main().

Definition at line 190 of file ufs_file_base.cpp.

References filename, and remove().

Referenced by stxxl::create_file().


Member Data Documentation

Definition at line 33 of file ufs_file_base.h.

Referenced by close(), lock(), set_size(), and size().

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.

Referenced by lock(), remove(), and unlink().

int stxxl::ufs_file_base::mode_ [protected]

Definition at line 35 of file ufs_file_base.h.

Referenced by lock(), and set_size().


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