The classes mapped_file_source, mapped_file_sink and mapped_file provide access to memory-mapped files on Windows and POSIX systems. These Devices behave much like the File Wrappers basic_file_source, basic_file_sink and basic_file, with the following important differences:
Wide-character versions of the memory-mapped file Devices may be defined as follows, using the template converter:
#include <boost/iostreams/converter.hpp> #include <boost/iostreams/maped_file.hpp> typedef converter<mapped_file_source> wmapped_file_source; typedef converter<mapped_file_sink> wmapped_file_sink;
The memory-mapped file Devices are based on the work of Craig Henderson ([Henderson]).
The memory-mapped file Devices depend on the source file <libs/iostreams/src/mapped_file.cpp>. This source file makes use of Windows or POSIX headers depending on the user's operating system. For installation instructions see Installation.
<boost/iostreams/device/mapped_file.hpp>mapped_file_sourceModel of Source providing read-only access to memory-mapped files on Windows and POSIX systems.
namespace boost { namespace iostreams { class mapped_file_source : public source { // Exposition only public: mapped_file_source(const std::string& path); ... }; } } // End namespace boost::io
mapped_file_source::mapped_file_source mapped_file_source(const std::string& path);
Constructs a mapped_file_source to access the file with the given pathname.
mapped_file_sinkModel of Sink providing write-only access to memory-mapped files on Windows and POSIX systems.
namespace boost { namespace iostreams { class mapped_file_sink : public sink { // Exposition only public: mapped_file_sink(const std::string& path); ... }; } } // End namespace boost::io
mapped_file_sink::mapped_file_sink mapped_file_sink(const std::string& path);
Constructs a mapped_file_sink to access the file with the given pathname.
mapped_fileModel of SeekableDevice providing read-write access to memory-mapped files on Windows and POSIX systems.
namespace boost { namespace iostreams { class mapped_file : public device<seekable> { // Exposition only public: mapped_file(const std::string& path); ... }; } } // End namespace boost::io
mapped_file_::mapped_file mapped_file(const std::string& path);
Constructs a mapped_file to access the file with the given pathname.
Revised 20 May, 2004
© Copyright Jonathan Turkanis, 2004
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)