Base Framework
|
#include <base/io/MappedFile.h>
Inherits Object.
Public Member Functions | |
MappedFile (const File &file, const FileRegion ®ion, bool writeable=false) | |
MappedFile (const MappedFile ©) noexcept | |
MappedFile & | operator= (const MappedFile &assign) noexcept |
uint8 * | getBytes () const noexcept |
const FileRegion & | getRegion () const noexcept |
void | synchronize () |
void | remap (const FileRegion ®ion) |
Static Public Member Functions | |
static unsigned int | getGranularity () noexcept |
File region mapper.
This class is used to map a specified file region into the address space of the process.
MappedFile::MappedFile | ( | const File & | file, |
const FileRegion & | region, | ||
bool | writeable = false |
||
) |
Initializes a file mapping.
file | The file to be mapped into memory. |
region | The file region to be mapped. The offset of the region must honour the granularity returned by getGranularity. |
writeable | Specifies that write access is required. Default is false. |
|
inlinenoexcept |
Initializes mapping from other mapping.
|
inlinenoexcept |
Returns the mapped bytes. Do not use the mapping outside the requested mapping range.
|
staticnoexcept |
Returns the required granularity of the file region offset.
|
inlinenoexcept |
Returns the mapped file region.
|
noexcept |
Assignment of mapping by mapping.
|
inline |
Maps the specified file region.
region | The file region to be mapped. |
|
inline |
Flushes the mapping.