STXXL  1.4.0
 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 
27 
29 
30 //! \addtogroup fileimpl
31 //! \{
32 
33 //! Base for Windows file system implementations.
34 class wfs_file_base : public virtual file
35 {
36 protected:
37  typedef void* HANDLE;
38 
39  mutex fd_mutex; // sequentialize function calls involving file_des
40  HANDLE file_des; // file descriptor
41  int mode_; // open mode
42  const std::string filename;
43  offset_type bytes_per_sector;
44  bool locked;
45  wfs_file_base(const std::string& filename, int mode);
46  offset_type _size();
47  void close();
48 
49 public:
50  ~wfs_file_base();
51  offset_type size();
52  void set_size(offset_type newsize);
53  void lock();
54  const char * io_type() const;
55  void close_remove();
56 };
57 
58 //! \}
59 
61 
62 #endif // STXXL_WINDOWS
63 
64 #endif // !STXXL_IO_WFS_FILE_BASE_HEADER
const std::string filename
Definition: wfs_file_base.h:42
Defines interface of file.
Definition: file.h:52
offset_type bytes_per_sector
Definition: wfs_file_base.h:43
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
Base for Windows file system implementations.
Definition: wfs_file_base.h:34
#define STXXL_END_NAMESPACE
Definition: namespace.h:17