Stxxl  1.3.1
Public Member Functions | Protected Member Functions | Protected Attributes
ufs_file_base Class Reference

Base for UNIX file system implementations. More...

#include <ufs_file_base.h>

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

List of all members.

Public Member Functions

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 ()
- Public Member Functions inherited from file
virtual request_ptr aread (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)=0
 Schedules an asynchronous read request to the file.
virtual request_ptr awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)=0
 Schedules an asynchronous write request to the file.
virtual void serve (const request *req)=0 throw (io_error)
void add_request_ref ()
void delete_request_ref ()
int get_request_nref ()
virtual int get_queue_id () const =0
 Returns the identifier of the file's queue.
virtual int get_allocator_id () const =0
 Returns the file's allocator.
virtual int get_physical_device_id () const
virtual 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.
virtual void export_files (offset_type offset, offset_type length, std::string prefix)

Protected Member Functions

 ufs_file_base (const std::string &filename, int mode)
offset_type _size ()
void close ()
- Protected Member Functions inherited from file
 file ()
 Initializes file object.

Protected Attributes

mutex fd_mutex
int file_des
int mode_
const std::string filename

Additional Inherited Members

- Public Types inherited from file
enum  open_mode {
  RDONLY = 1, WRONLY = 2, RDWR = 4, CREAT = 8,
  DIRECT = 16, TRUNC = 32, SYNC = 64, NO_LOCK = 128
}
 Definition of acceptable file open modes. More...
typedef request::offset_type offset_type
typedef request::size_type size_type
- Static Public Attributes inherited from file
static const int DEFAULT_QUEUE = -1
static const int NO_QUEUE = -2
static const int NO_ALLOCATOR = -1

Detailed Description

Base for UNIX file system implementations.


Member Function Documentation

__STXXL_BEGIN_NAMESPACE const char * 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 file.

Reimplemented in sim_disk_file, mmap_file, and syscall_file.

void ufs_file_base::lock ( )
virtual

Locks file for reading and writing (acquires a lock in the file system)

Implements file.

References file::RDONLY.

void ufs_file_base::set_size ( offset_type  newsize)
virtual

Changes the size of the file.

Parameters:
newsizenew file size

Implements file.

Reimplemented in sim_disk_file.

file::offset_type ufs_file_base::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: