STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mmap_file.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/io/mmap_file.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2002 Roman Dementiev <[email protected]>
7  * Copyright (C) 2008 Andreas Beckmann <[email protected]>
8  * Copyright (C) 2009 Johannes Singler <[email protected]>
9  *
10  * Distributed under the Boost Software License, Version 1.0.
11  * (See accompanying file LICENSE_1_0.txt or copy at
12  * http://www.boost.org/LICENSE_1_0.txt)
13  **************************************************************************/
14 
15 #ifndef STXXL_IO_MMAP_FILE_HEADER
16 #define STXXL_IO_MMAP_FILE_HEADER
17 
18 #include <stxxl/bits/config.h>
19 
20 #if STXXL_HAVE_MMAP_FILE
21 
24 
26 
27 //! \addtogroup fileimpl
28 //! \{
29 
30 //! Implementation of memory mapped access file.
32 {
33 public:
34  //! Constructs file object.
35  //! \param filename path of file
36  //! \param mode open mode, see \c stxxl::file::open_modes
37  //! \param queue_id disk queue identifier
38  //! \param allocator_id linked disk_allocator
39  //! \param device_id physical device identifier
40  inline mmap_file(
41  const std::string& filename,
42  int mode,
43  int queue_id = DEFAULT_QUEUE,
44  int allocator_id = NO_ALLOCATOR,
45  unsigned int device_id = DEFAULT_DEVICE_ID)
46  : file(device_id),
47  ufs_file_base(filename, mode),
48  disk_queued_file(queue_id, allocator_id)
49  { }
50  void serve(void* buffer, offset_type offset, size_type bytes,
52  const char * io_type() const;
53 };
54 
55 //! \}
56 
58 
59 #endif // #if STXXL_HAVE_MMAP_FILE
60 
61 #endif // !STXXL_IO_MMAP_FILE_HEADER
mmap_file(const std::string &filename, int mode, int queue_id=DEFAULT_QUEUE, int allocator_id=NO_ALLOCATOR, unsigned int device_id=DEFAULT_DEVICE_ID)
Constructs file object.
Definition: mmap_file.h:40
Defines interface of file.
Definition: file.h:56
Implementation of memory mapped access file.
Definition: mmap_file.h:31
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
Implementation of some file methods based on serving_request.
static const size_t bytes
number of bytes in uint_pair
Definition: uint_types.h:96
Base for UNIX file system implementations.
Definition: ufs_file_base.h:33
#define STXXL_END_NAMESPACE
Definition: namespace.h:17