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