Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class file_mapping

boost::interprocess::file_mapping

Synopsis

// In header: <boost/interprocess/file_mapping.hpp>


class file_mapping {
public:
  // construct/copy/destruct
  () ;
  (, );
  (, );
  (file_mapping &&) ;
  file_mapping & (file_mapping &&) ;
  ~();

  // public member functions
   (file_mapping &) ;
   () ;
   () ;
   () ;

  // public static functions
   ();
   ();
};

Description

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

file_mapping public construct/copy/destruct

  1. () ;

    Constructs an empty file mapping. Does not throw

  2. ( filename,  mode);

    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.

  3. ( filename,  mode);

    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.

    Note: This function is only available on operating systems with native wchar_t APIs (e.g. Windows).

  4. (file_mapping && moved) ;

    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

  5. file_mapping & (file_mapping && moved) ;

    Moves the ownership of "moved"'s file mapping to *this. After the call, "moved" does not represent any file mapping. Does not throw

  6. ~();

    Destroys the file mapping. All mapped regions created from this are still valid. Does not throw

file_mapping public member functions

  1.  (file_mapping & other) ;

    Swaps to file_mappings. Does not throw.

  2.  () ;

    Returns access mode used in the constructor

  3.  () ;

    Obtains the mapping handle to be used with mapped_region

  4.  () ;

    Returns the name of the file used in the constructor.

file_mapping public static functions

  1.  ( filename);

    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.

  2.  ( filename);

    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.

    Note: This function is only available on operating systems with native wchar_t APIs (e.g. Windows).


PrevUpHomeNext