STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::wfs_file_base Class Reference

Detailed Description

Base for Windows file system implementations.

Definition at line 33 of file wfs_file_base.h.

+ Inheritance diagram for stxxl::wfs_file_base:
+ Collaboration diagram for stxxl::wfs_file_base:

Public Member Functions

 ~wfs_file_base ()
 
void close_remove ()
 close and remove file More...
 
const char * io_type () const
 Identifies the type of I/O implementation. More...
 
void lock ()
 Locks file for reading and writing (acquires a lock in the file system). More...
 
void set_size (offset_type newsize)
 
offset_type size ()
 Returns size of the file. More...
 
- Public Member Functions inherited from stxxl::file
 file (unsigned int device_id=DEFAULT_DEVICE_ID)
 Construct a new file, usually called by a subclass. More...
 
virtual ~file ()
 
void add_request_ref ()
 increment referenced requests More...
 
virtual request_ptr aread (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())=0
 Schedules an asynchronous read request to the file. More...
 
virtual request_ptr awrite (void *buffer, offset_type pos, size_type bytes, const completion_handler &on_cmpl=completion_handler())=0
 Schedules an asynchronous write request to the file. More...
 
void delete_request_ref ()
 decrement referenced requests More...
 
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 int get_allocator_id () const =0
 Returns the file's disk allocator number. More...
 
unsigned int get_device_id () const
 Returns the file's physical device id. More...
 
virtual int get_queue_id () const =0
 Returns the identifier of the file's queue number. More...
 
unsigned_type get_request_nref ()
 return number of referenced requests More...
 
virtual void serve (void *buffer, offset_type offset, size_type bytes, request::request_type type)=0
 
virtual void set_size (offset_type newsize)=0
 Changes the size of the file. More...
 

Protected Types

typedef void * HANDLE
 

Protected Member Functions

 wfs_file_base (const std::string &filename, int mode)
 
offset_type _size ()
 
void close ()
 

Protected Attributes

offset_type bytes_per_sector
 
mutex fd_mutex
 
HANDLE file_des
 
const std::string filename
 
bool locked
 
int mode_
 
- Protected Attributes inherited from stxxl::file
unsigned int m_device_id
 The file's physical device id (e.g. used for prefetching sequence calculation) More...
 
atomic_counted_object m_request_ref
 count the number of requests referencing this file More...
 

Additional Inherited Members

- Public Types inherited from stxxl::file
typedef request::offset_type offset_type
 the offset of a request, also the size of the file More...
 
enum  open_mode {
  RDONLY = 1, WRONLY = 2, RDWR = 4, CREAT = 8,
  DIRECT = 16, TRUNC = 32, SYNC = 64, NO_LOCK = 128,
  REQUIRE_DIRECT = 256
}
 Definition of acceptable file open modes. More...
 
typedef request::size_type size_type
 the size of a request More...
 
- Static Public Member Functions inherited from stxxl::file
static int unlink (const char *path)
 unlink path from filesystem More...
 
static int truncate (const char *path, external_size_type length)
 truncate a path to given length. Use this only if you dont have a fileio-specific object, which provides truncate(). More...
 
- Static Public Attributes inherited from stxxl::file
static const unsigned int DEFAULT_DEVICE_ID = (unsigned int)(-1)
 
static const int DEFAULT_LINUXAIO_QUEUE = -2
 
static const int DEFAULT_QUEUE = -1
 
static const int NO_ALLOCATOR = -1
 

Member Typedef Documentation

typedef void* stxxl::wfs_file_base::HANDLE
protected

Definition at line 36 of file wfs_file_base.h.

Constructor & Destructor Documentation

stxxl::wfs_file_base::wfs_file_base ( const std::string &  filename,
int  mode 
)
protected
stxxl::wfs_file_base::~wfs_file_base ( )

Definition at line 148 of file wfs_file_base.cpp.

References close().

Member Function Documentation

file::offset_type stxxl::wfs_file_base::_size ( )
protected

Definition at line 176 of file wfs_file_base.cpp.

References file_des, and STXXL_THROW_WIN_LASTERROR.

Referenced by set_size(), and size().

void stxxl::wfs_file_base::close ( )
protected

Definition at line 153 of file wfs_file_base.cpp.

References fd_mutex, file_des, and STXXL_THROW_WIN_LASTERROR.

Referenced by close_remove(), and ~wfs_file_base().

void stxxl::wfs_file_base::close_remove ( )
virtual

close and remove file

Reimplemented from stxxl::file.

Definition at line 231 of file wfs_file_base.cpp.

References close(), and filename.

const char * stxxl::wfs_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

Implements stxxl::file.

Reimplemented in stxxl::wincall_file.

Definition at line 27 of file wfs_file_base.cpp.

void stxxl::wfs_file_base::lock ( )
virtual

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

Implements stxxl::file.

Definition at line 166 of file wfs_file_base.cpp.

References fd_mutex, file_des, locked, and STXXL_THROW_WIN_LASTERROR.

Referenced by stxxl::create_file(), and wfs_file_base().

file::offset_type stxxl::wfs_file_base::size ( )
virtual

Returns size of the file.

Returns
file size in bytes

Implements stxxl::file.

Definition at line 185 of file wfs_file_base.cpp.

References _size(), and fd_mutex.

Member Data Documentation

offset_type stxxl::wfs_file_base::bytes_per_sector
protected

Definition at line 42 of file wfs_file_base.h.

Referenced by set_size(), and wfs_file_base().

mutex stxxl::wfs_file_base::fd_mutex
protected

Definition at line 38 of file wfs_file_base.h.

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

HANDLE stxxl::wfs_file_base::file_des
protected

Definition at line 39 of file wfs_file_base.h.

Referenced by _size(), close(), lock(), set_size(), and wfs_file_base().

const std::string stxxl::wfs_file_base::filename
protected

Definition at line 41 of file wfs_file_base.h.

Referenced by close_remove(), and set_size().

bool stxxl::wfs_file_base::locked
protected

Definition at line 43 of file wfs_file_base.h.

Referenced by lock().

int stxxl::wfs_file_base::mode_
protected

Definition at line 40 of file wfs_file_base.h.

Referenced by set_size(), and wfs_file_base().


The documentation for this class was generated from the following files: