Equalizer
1.2.1
|
Helper to map a file to a memory address (mmap) More...
#include <memoryMap.h>
Public Member Functions | |
COBASE_API | MemoryMap () |
Construct a new memory map. | |
COBASE_API | ~MemoryMap () |
Destruct the memory map. | |
COBASE_API const void * | map (const std::string &fileName) |
Map a file to a memory address. | |
COBASE_API void | unmap () |
Unmap the file. | |
const void * | getAddress () const |
size_t | getSize () const |
Helper to map a file to a memory address (mmap)
Definition at line 31 of file memoryMap.h.
COBASE_API co::base::MemoryMap::MemoryMap | ( | ) |
Construct a new memory map.
COBASE_API co::base::MemoryMap::~MemoryMap | ( | ) |
const void* co::base::MemoryMap::getAddress | ( | ) | const [inline] |
size_t co::base::MemoryMap::getSize | ( | ) | const [inline] |
COBASE_API const void* co::base::MemoryMap::map | ( | const std::string & | fileName | ) |
Map a file to a memory address.
Currently the file is only mapped read-only. The file is automatically unmapped when the memory map is deleted.
fileName | The filename of the file to map. |
COBASE_API void co::base::MemoryMap::unmap | ( | ) |
Unmap the file.