Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::interprocess::file_mapping Class Reference

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_mappingoperator= (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...
 

Detailed Description

A class that wraps a file-mapping that can be used to create mapped regions from the mapped files.

Constructor & Destructor Documentation

boost::interprocess::file_mapping::file_mapping ( )
inline

Constructs an empty file mapping.

Does not throw

boost::interprocess::file_mapping::file_mapping ( const char *  filename,
mode_t  mode 
)
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().

boost::interprocess::file_mapping::file_mapping ( BOOST_RV_REF(file_mapping moved)
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().

boost::interprocess::file_mapping::~file_mapping ( )
inline

Destroys the file mapping.

All mapped regions created from this are still valid. Does not throw

Member Function Documentation

mapping_handle_t boost::interprocess::file_mapping::get_mapping_handle ( ) const
inline

Obtains the mapping handle to be used with mapped_region.

mode_t boost::interprocess::file_mapping::get_mode ( ) const
inline

Returns access mode used in the constructor.

const char * boost::interprocess::file_mapping::get_name ( ) const
inline

Returns the name of the file used in the constructor.

file_mapping& boost::interprocess::file_mapping::operator= ( BOOST_RV_REF(file_mapping moved)
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().

bool boost::interprocess::file_mapping::remove ( const char *  filename)
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.

void boost::interprocess::file_mapping::swap ( file_mapping other)
inline

Swaps to file_mappings.

Does not throw.

References boost::swap.

Referenced by file_mapping(), and operator=().


The documentation for this class was generated from the following file: