STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
wfs_file_base.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/io/wfs_file_base.h
3  *
4  * Windows file system file base
5  *
6  * Part of the STXXL. See http://stxxl.sourceforge.net
7  *
8  * Copyright (C) 2005 Roman Dementiev <[email protected]>
9  * Copyright (C) 2008, 2010 Andreas Beckmann <[email protected]>
10  * Copyright (C) 2009, 2010 Johannes Singler <[email protected]>
11  *
12  * Distributed under the Boost Software License, Version 1.0.
13  * (See accompanying file LICENSE_1_0.txt or copy at
14  * http://www.boost.org/LICENSE_1_0.txt)
15  **************************************************************************/
16 
17 #ifndef STXXL_IO_WFS_FILE_BASE_HEADER
18 #define STXXL_IO_WFS_FILE_BASE_HEADER
19 
20 #include <stxxl/bits/config.h>
21 
22 #if STXXL_WINDOWS
23 
24 #include <stxxl/bits/io/file.h>
25 #include <stxxl/bits/io/request.h>
26 
28 
29 //! \addtogroup fileimpl
30 //! \{
31 
32 //! Base for Windows file system implementations.
33 class wfs_file_base : public virtual file
34 {
35 protected:
36  typedef void* HANDLE;
37 
38  mutex fd_mutex; // sequentialize function calls involving file_des
39  HANDLE file_des; // file descriptor
40  int mode_; // open mode
41  const std::string filename;
42  offset_type bytes_per_sector;
43  bool locked;
44  wfs_file_base(const std::string& filename, int mode);
45  offset_type _size();
46  void close();
47 
48 public:
49  ~wfs_file_base();
50  offset_type size();
51  void set_size(offset_type newsize);
52  void lock();
53  const char * io_type() const;
54  void close_remove();
55 };
56 
57 //! \}
58 
60 
61 #endif // STXXL_WINDOWS
62 
63 #endif // !STXXL_IO_WFS_FILE_BASE_HEADER
const std::string filename
Definition: wfs_file_base.h:41
Defines interface of file.
Definition: file.h:56
offset_type bytes_per_sector
Definition: wfs_file_base.h:42
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
Base for Windows file system implementations.
Definition: wfs_file_base.h:33
#define STXXL_END_NAMESPACE
Definition: namespace.h:17