A class that wraps a file-mapping that can be used to create mapped regions from the mapped files. More...
#include <file_mapping.hpp>
Public Member Functions | |
file_mapping () | |
Constructs an empty file mapping. More... | |
file_mapping (const char *filename, mode_t mode) | |
Opens a file mapping of file "filename", starting in offset "file_offset", and the mapping's size will be "size". More... | |
file_mapping (BOOST_RV_REF(file_mapping) moved) | |
Moves the ownership of "moved"'s file mapping object to *this. More... | |
file_mapping & | operator= (BOOST_RV_REF(file_mapping) moved) |
Moves the ownership of "moved"'s file mapping to *this. More... | |
void | swap (file_mapping &other) |
Swaps to file_mappings. More... | |
mode_t | get_mode () const |
Returns access mode used in the constructor. More... | |
mapping_handle_t | get_mapping_handle () const |
Obtains the mapping handle to be used with mapped_region. More... | |
~file_mapping () | |
Destroys the file mapping. More... | |
const char * | get_name () const |
Returns the name of the file used in the constructor. More... | |
Static Public Member Functions | |
static bool | remove (const char *filename) |
Removes the file named "filename" even if it's been memory mapped. More... | |
A class that wraps a file-mapping that can be used to create mapped regions from the mapped files.
|
inline |
Constructs an empty file mapping.
Does not throw
|
inline |
Opens a file mapping of file "filename", starting in offset "file_offset", and the mapping's size will be "size".
The mapping can be opened for read-only "read_only" or read-write "read_write" modes. Throws interprocess_exception on error.
References boost::math::concepts::mode(), boost::interprocess::other_error, and boost::interprocess::system_error_code().
|
inline |
Moves the ownership of "moved"'s file mapping object to *this.
After the call, "moved" does not represent any file mapping object. Does not throw
References swap().
|
inline |
Destroys the file mapping.
All mapped regions created from this are still valid. Does not throw
|
inline |
Obtains the mapping handle to be used with mapped_region.
|
inline |
Returns access mode used in the constructor.
|
inline |
Returns the name of the file used in the constructor.
|
inline |
Moves the ownership of "moved"'s file mapping to *this.
After the call, "moved" does not represent any file mapping. Does not throw
References boost::move(), and swap().
|
inlinestatic |
Removes the file named "filename" even if it's been memory mapped.
Returns true on success. The function might fail in some operating systems if the file is being used other processes and no deletion permission was shared.
|
inline |
Swaps to file_mappings.
Does not throw.
References boost::swap.
Referenced by file_mapping(), and operator=().