Implementation of file based on other files, dynamically allocate one file per block. Allows for dynamic disk space consumption.
More...
#include <fileperblock_file.h>
List of all members.
Public Member Functions |
| | fileperblock_file (const std::string &filename_prefix, int mode, int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR) |
| | constructs file object
|
|
virtual void | serve (const request *req) throw (io_error) |
| virtual void | set_size (offset_type new_size) |
| | Changes the size of the file.
|
| virtual offset_type | size () |
| | Returns size of the file.
|
| virtual void | lock () |
| | Locks file for reading and writing (acquires a lock in the file system)
|
| virtual void | discard (offset_type offset, offset_type length) |
| | Frees the specified region. Actually deletes the corresponding file if the whole thing is deleted.
|
| virtual void | export_files (offset_type offset, offset_type length, std::string filename) |
| | Rename the file corresponding to the offset such that it is out of reach for deleting.
|
| const char * | io_type () const |
| | Identifies the type of I/O implementation.
|
|
| 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.
|
| request_ptr | awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl) |
| | Schedules an asynchronous write request to the file.
|
| virtual int | get_queue_id () const |
| | Returns the identifier of the file's queue.
|
| virtual int | get_allocator_id () const |
| | Returns the file's allocator.
|
|
void | add_request_ref () |
|
void | delete_request_ref () |
|
int | get_request_nref () |
|
virtual int | get_physical_device_id () const |
|
virtual void | remove () |
Protected Member Functions |
| std::string | filename_for_block (unsigned_type offset) |
| | Constructs a file name for a given block.
|
Detailed Description
template<class base_file_type>
class fileperblock_file< base_file_type >
Implementation of file based on other files, dynamically allocate one file per block. Allows for dynamic disk space consumption.
Constructor & Destructor Documentation
template<class base_file_type >
| __STXXL_BEGIN_NAMESPACE fileperblock_file< base_file_type >::fileperblock_file |
( |
const std::string & |
filename_prefix, |
|
|
int |
mode, |
|
|
int |
queue_id = DEFAULT_QUEUE, |
|
|
int |
allocator_id = NO_ALLOCATOR |
|
) |
| |
constructs file object
- Parameters:
-
| filename_prefix | filename prefix, numbering will be appended to it |
| mode | open mode, see file::open_modes |
| disk | disk(file) identifier |
Member Function Documentation
template<class base_file_type >
| void fileperblock_file< base_file_type >::discard |
( |
offset_type |
offset, |
|
|
offset_type |
length |
|
) |
| |
|
virtual |
Frees the specified region. Actually deletes the corresponding file if the whole thing is deleted.
Reimplemented from file.
template<class base_file_type >
| void fileperblock_file< base_file_type >::export_files |
( |
offset_type |
offset, |
|
|
offset_type |
length, |
|
|
std::string |
filename |
|
) |
| |
|
virtual |
Rename the file corresponding to the offset such that it is out of reach for deleting.
Reimplemented from file.
template<class base_file_type >
| std::string fileperblock_file< base_file_type >::filename_for_block |
( |
unsigned_type |
offset | ) |
|
|
protected |
Constructs a file name for a given block.
template<class base_file_type >
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.
template<class base_file_type >
template<class base_file_type>
Changes the size of the file.
- Parameters:
-
| new_size | value of the new file size |
Implements file.
template<class base_file_type>
Returns size of the file.
- Returns:
- file size in length
Implements file.
The documentation for this class was generated from the following files: