00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef STXXL_MMAP_FILE_HEADER
00016 #define STXXL_MMAP_FILE_HEADER
00017
00018 #ifndef STXXL_HAVE_MMAP_FILE
00019 #ifdef STXXL_BOOST_CONFIG
00020 #include <boost/config.hpp>
00021 #endif
00022
00023 #ifndef BOOST_MSVC
00024
00025 #define STXXL_HAVE_MMAP_FILE 1
00026 #else
00027 #define STXXL_HAVE_MMAP_FILE 0
00028 #endif
00029 #endif
00030
00031 #if STXXL_HAVE_MMAP_FILE
00032
00033 #include <sys/mman.h>
00034
00035 #include <stxxl/bits/io/ufs_file_base.h>
00036 #include <stxxl/bits/io/disk_queued_file.h>
00037
00038
00039 __STXXL_BEGIN_NAMESPACE
00040
00046
00048 class mmap_file : public ufs_file_base, public disk_queued_file
00049 {
00050 public:
00055 inline mmap_file(const std::string & filename, int mode, int queue_id = DEFAULT_QUEUE, int allocator_id = NO_ALLOCATOR) :
00056 ufs_file_base(filename, mode), disk_queued_file(queue_id, allocator_id)
00057 { }
00058 void serve(const request * req) throw (io_error);
00059 const char * io_type() const;
00060 };
00061
00063
00064 __STXXL_END_NAMESPACE
00065
00066 #endif // #if STXXL_HAVE_MMAP_FILE
00067
00068 #endif // !STXXL_MMAP_FILE_HEADER