Class mapped_region
boost::interprocess::mapped_region
Synopsis
Description
The mapped_region class represents a portion or region created from a memory_mappable object.
mapped_region
public
construct/copy/destruct
-
template<typename MemoryMappable>
mapped_region(const MemoryMappable & mapping, mode_t mode,
offset_t offset = 0, std::size_t size = 0,
const void * address = 0);
Creates a mapping region of the mapped memory "mapping", starting in offset "offset", and the mapping's size will be "size". The mapping can be opened for read-only "read_only" or read-write "read_write.
-
mapped_region();
Default constructor. Address and size and offset will be 0. Does not throw
-
mapped_region(unspecified other);
Move constructor. *this will be constructed taking ownership of "other"'s region and "other" will be left in default constructor state.
-
mapped_region& operator=(unspecified other);
Move assignment. If *this owns a memory mapped region, it will be destroyed and it will take ownership of "other"'s memory mapped region.
-
~mapped_region();
Destroys the mapped region. Does not throw
mapped_region
public member functions
-
std::size_t get_size() const;
Returns the size of the mapping. Note for windows users: If windows_shared_memory is mapped using 0 as the size, it returns 0 because the size is unknown. Never throws.
-
void * get_address() const;
Returns the base address of the mapping. Never throws.
-
offset_t get_offset() const;
Returns the offset of the mapping from the beginning of the mapped memory. Never throws.
-
mode_t get_mode() const;
Returns the mode of the mapping used to contruct the mapped file. Never throws.
-
bool flush(std::size_t mapping_offset = 0, std::size_t numbytes = 0) ;
Flushes to the disk a byte range within the mapped memory. Never throws
-
void swap(mapped_region & other) ;
Swaps the mapped_region with another mapped region
mapped_region
public static functions
-
static std::size_t get_page_size() ;
Returns the size of the page. This size is the minimum memory that will be used by the system when mapping a memory mappable source.