AFIO
v2.00 late alpha
|
Provides a typed mapped view of a section_handle
suitable for feeding to STL algorithms or the Ranges TS by wrapping a map_handle
into a span<T>
.
More...
#include "mapped_span.hpp"
Public Types | |
using | extent_type = typename section_handle::extent_type |
The extent type. | |
using | size_type = typename section_handle::size_type |
The size type. | |
Public Member Functions | |
constexpr | mapped_span () |
Default constructor. | |
mapped_span (size_type length, section_handle::flag _flag=section_handle::flag::readwrite) | |
mapped_span (section_handle &sh, size_type length=(size_type) -1, extent_type byteoffset=0, section_handle::flag _flag=section_handle::flag::readwrite) | |
mapped_span (map_handle &mh, size_type length=(size_type) -1, extent_type byteoffset=0) | |
mapped_span (mapped_file_handle &mfh, size_type length=(size_type) -1, extent_type byteoffset=0) | |
Provides a typed mapped view of a section_handle
suitable for feeding to STL algorithms or the Ranges TS by wrapping a map_handle
into a span<T>
.
Optionally can issue a blocking write barrier on destruction of the mapped view by setting the flag section_handle::flag::barrier_on_close
, thus forcing any changes to data referred to by the view to storage before the destructor returns.
|
inlineexplicit |
Create a view of new memory.
length | The number of items to map. |
_flag | The flags to pass to map_handle::map() . |
|
inlineexplicit |
Construct a mapped view of the given section handle.
sh | The section handle to use as the data source for creating the map. |
length | The number of items to map, use -1 to mean the length of the section handle divided by sizeof(T) . |
byteoffset | The byte offset into the section handle, this does not need to be a multiple of the page size. |
_flag | The flags to pass to map_handle::map() . |
|
inlineexplicit |
Construct a mapped view of the given map handle.
mh | The map handle to use. |
length | The number of items to map, use -1 to mean the length of the map handle divided by sizeof(T) . |
byteoffset | The byte offset into the map handle, this does not need to be a multiple of the page size. |
|
inlineexplicit |
Construct a mapped view of the given mapped file handle.
mfh | The mapped file handle to use as the data source for creating the map. |
length | The number of items to map, use -1 to mean the length of the section handle divided by sizeof(T) . |
byteoffset | The byte offset into the mapped file handle, this does not need to be a multiple of the page size. |