24 explicit FileMapper(
const std::string& filepath,
size_t ofs = 0,
size_t sz = 0);
39 void initialize(
const std::string& filepath,
size_t ofs = 0,
size_t sz = 0);
68 T*
lock(
bool readonly =
false)
70 return static_cast<T*
>(doLock(readonly));
113 void* doLock(
bool readonly);
142 size_t _realOffset{0};
class for file mapping
Definition IFileMapper.h:12
Wrapper for the linux mmap.
Definition lnx/FileMapper.h:14
~FileMapper() override
Destructor.
void initialize() override
Use temporary files to map.
void setView(size_t ofs, size_t sz)
Sets the part of the file to be mapped.
void initialize(const std::string &filepath, size_t ofs=0, size_t sz=0)
Initializes the mapper passing a file instance.
void * getPtr() override
Gets the pointer of the mapped area.
FileMapper(const std::string &filepath, size_t ofs=0, size_t sz=0)
Initializing constructor.
FileMapper()
Default constructor.
bool unmapView() override
Unlocks the pointer locked with mapView().
void createView(size_t size) override
Sets the size of the file to be mapped.
void unlock(bool sync=false)
void reset()
Unlocks the locked file and removes the file reference.
bool mapView() override
Locks a pointer in memory which can be unlocked using unmapView().
T * lock(bool readonly=false)
Locks the set area.
Definition lnx/FileMapper.h:68
const File & getFile()
Definition lnx/FileMapper.h:86
#define _MISC_CLASS
Definition misc/global.h:40