Stxxl  1.3.2
Public Member Functions | Protected Member Functions | List of all members
wbtl_file Class Reference

Implementation of file based on buffered writes and block remapping via a translation layer. More...

#include <wbtl_file.h>

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

Public Member Functions

 wbtl_file (file *backend_file, size_type write_buffer_size, int write_buffers=2, int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR)
 constructs file object More...
 
offset_type size ()
 Returns size of the file. More...
 
void set_size (offset_type newsize)
 
void lock ()
 Locks file for reading and writing (acquires a lock in the file system) More...
 
void serve (const request *req) throw (io_error)
 
void discard (offset_type offset, offset_type size)
 
const char * io_type () const
 Identifies the type of I/O implementation. More...
 
- Public Member Functions inherited from disk_queued_file
 disk_queued_file (int queue_id, int allocator_id)
 
request_ptr aread (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)
 Schedules an asynchronous read request to the file. More...
 
request_ptr awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl)
 Schedules an asynchronous write request to the file. More...
 
virtual int get_queue_id () const
 Returns the identifier of the file's queue. More...
 
virtual int get_allocator_id () const
 Returns the file's allocator. More...
 
- Public Member Functions inherited from file
void add_request_ref ()
 
void delete_request_ref ()
 
int get_request_nref ()
 
virtual void set_size (offset_type newsize)=0
 Changes the size of the file. More...
 
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. More...
 
virtual void export_files (offset_type offset, offset_type length, std::string prefix)
 
virtual void remove ()
 

Protected Member Functions

void sread (void *buffer, offset_type offset, size_type bytes)
 
void swrite (void *buffer, offset_type offset, size_type bytes)
 
offset_type get_next_write_block ()
 
void check_corruption (offset_type region_pos, offset_type region_size, sortseq::iterator pred, sortseq::iterator succ)
 
- Protected Member Functions inherited from file
 file ()
 Initializes file object. More...
 

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

Implementation of file based on buffered writes and block remapping via a translation layer.

Constructor & Destructor Documentation

wbtl_file::wbtl_file ( file backend_file,
size_type  write_buffer_size,
int  write_buffers = 2,
int  queue_id = DEFAULT_QUEUE,
int  allocator_id = NO_ALLOCATOR 
)

constructs file object

Parameters
backend_filefile object used as storage backend, will be deleted in ~wbtl_file()
diskdisk(file) identifier

Member Function Documentation

const char* wbtl_file::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.

void wbtl_file::lock ( )
virtual

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

Implements file.

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