class
MemoryMapper
Contents
Constructors, destructors, conversion operators
- MemoryMapper(const File& file, fint mode)
- MemoryMapper(MemoryMapper&& other) noexcept
- ~MemoryMapper()
- MemoryMapper(const MemoryMapper& other) deleted
Public functions
- auto operator=(const MemoryMapper& other) -> MemoryMapper deleted
- auto operator=(MemoryMapper&& other) -> MemoryMapper& noexcept
- void Map(uint64 pos, fsize size)
- void Unmap()
- void Close()
- auto GetFile() const -> const File& noexcept
- auto operator*() -> void*
Function documentation
bpf:: io:: MemoryMapper:: MemoryMapper(const File& file,
fint mode)
Parameters | |
---|---|
file | file to open |
mode | file mode |
Exceptions | |
IOException | in case of system error |
Creates a new MemoryMapper from the given file and mode
bpf:: io:: MemoryMapper:: MemoryMapper(MemoryMapper&& other) noexcept
Move constructor
bpf:: io:: MemoryMapper:: MemoryMapper(const MemoryMapper& other) deleted
Cannot copy a MemoryMapper
MemoryMapper bpf:: io:: MemoryMapper:: operator=(const MemoryMapper& other) deleted
Cannot copy a MemoryMapper
MemoryMapper& bpf:: io:: MemoryMapper:: operator=(MemoryMapper&& other) noexcept
Move assignment operator
void bpf:: io:: MemoryMapper:: Map(uint64 pos,
fsize size)
Parameters | |
---|---|
pos | position in bytes in the file to start mapping |
size | the size in bytes to map |
Exceptions | |
IOException | in case of system error or if the size is greater than the size of the mapped file |
Map or re-map the file in virtual memory
void bpf:: io:: MemoryMapper:: Unmap()
Unmaps any previous mappings of the file
void bpf:: io:: MemoryMapper:: Close()
Closes this MemoryMapper
void* bpf:: io:: MemoryMapper:: operator*()
Returns | raw pointer to the mapped file memory |
---|
Returns a pointer to the mapped file memory