|
Stxxl
1.4.0
|
Implementation of file based on buffered writes and block remapping via a translation layer. More...
#include <wbtl_file.h>


Classes | |
| struct | FirstFit |
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 | |
| ~wbtl_file () | |
| offset_type | size () |
| Returns size of the file. | |
| void | set_size (offset_type newsize) |
| void | lock () |
| Locks file for reading and writing (acquires a lock in the file system) | |
| 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. | |
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) |
Private Types | |
| typedef std::pair< offset_type, offset_type > | place |
| typedef std::map< offset_type, offset_type > | sortseq |
| typedef std::map< offset_type, place > | place_map |
Private Member Functions | |
| void | _add_free_region (offset_type offset, offset_type size) |
Private Attributes | |
| file * | storage |
| offset_type | sz |
| size_type | write_block_size |
| mutex | mapping_mutex |
| sortseq | address_mapping |
| place_map | reverse_mapping |
| sortseq | free_space |
| offset_type | free_bytes |
| mutex | buffer_mutex |
| char * | write_buffer [2] |
| offset_type | buffer_address [2] |
| int | curbuf |
| size_type | curpos |
| request_ptr | backend_request |
Implementation of file based on buffered writes and block remapping via a translation layer.
Definition at line 37 of file wbtl_file.h.
typedef std::pair<offset_type, offset_type> stxxl::wbtl_file::place [private] |
Definition at line 39 of file wbtl_file.h.
typedef std::map<offset_type, place> stxxl::wbtl_file::place_map [private] |
Definition at line 41 of file wbtl_file.h.
typedef std::map<offset_type, offset_type> stxxl::wbtl_file::sortseq [private] |
Definition at line 40 of file wbtl_file.h.
| stxxl::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
| backend_file | file object used as storage backend, will be deleted in ~wbtl_file() |
| disk | disk(file) identifier |
| void stxxl::wbtl_file::_add_free_region | ( | offset_type | offset, |
| offset_type | size | ||
| ) | [private] |
| void stxxl::wbtl_file::check_corruption | ( | offset_type | region_pos, |
| offset_type | region_size, | ||
| sortseq::iterator | pred, | ||
| sortseq::iterator | succ | ||
| ) | [protected] |
| void stxxl::wbtl_file::discard | ( | offset_type | offset, |
| offset_type | size | ||
| ) |
| offset_type stxxl::wbtl_file::get_next_write_block | ( | ) | [protected] |
| const char* stxxl::wbtl_file::io_type | ( | ) | const [virtual] |
Identifies the type of I/O implementation.
Reimplemented from stxxl::file.
| void stxxl::wbtl_file::lock | ( | ) | [virtual] |
Locks file for reading and writing (acquires a lock in the file system)
Implements stxxl::file.
Referenced by stxxl::create_file().
| void stxxl::wbtl_file::serve | ( | const request * | req | ) | throw (io_error) [virtual] |
Implements stxxl::file.
| void stxxl::wbtl_file::set_size | ( | offset_type | newsize | ) |
| offset_type stxxl::wbtl_file::size | ( | ) | [virtual] |
| void stxxl::wbtl_file::sread | ( | void * | buffer, |
| offset_type | offset, | ||
| size_type | bytes | ||
| ) | [protected] |
| void stxxl::wbtl_file::swrite | ( | void * | buffer, |
| offset_type | offset, | ||
| size_type | bytes | ||
| ) | [protected] |
sortseq stxxl::wbtl_file::address_mapping [private] |
Definition at line 50 of file wbtl_file.h.
request_ptr stxxl::wbtl_file::backend_request [private] |
Definition at line 67 of file wbtl_file.h.
offset_type stxxl::wbtl_file::buffer_address[2] [private] |
Definition at line 64 of file wbtl_file.h.
mutex stxxl::wbtl_file::buffer_mutex [private] |
Definition at line 62 of file wbtl_file.h.
int stxxl::wbtl_file::curbuf [private] |
Definition at line 65 of file wbtl_file.h.
size_type stxxl::wbtl_file::curpos [private] |
Definition at line 66 of file wbtl_file.h.
offset_type stxxl::wbtl_file::free_bytes [private] |
Definition at line 55 of file wbtl_file.h.
sortseq stxxl::wbtl_file::free_space [private] |
Definition at line 54 of file wbtl_file.h.
mutex stxxl::wbtl_file::mapping_mutex [private] |
Definition at line 48 of file wbtl_file.h.
place_map stxxl::wbtl_file::reverse_mapping [private] |
Definition at line 52 of file wbtl_file.h.
file* stxxl::wbtl_file::storage [private] |
Definition at line 44 of file wbtl_file.h.
offset_type stxxl::wbtl_file::sz [private] |
Definition at line 45 of file wbtl_file.h.
size_type stxxl::wbtl_file::write_block_size [private] |
Definition at line 46 of file wbtl_file.h.
char* stxxl::wbtl_file::write_buffer[2] [private] |
Definition at line 63 of file wbtl_file.h.
1.7.6.1