#include <MmapFile.h>
Inheritance diagram for oasys::MmapFile:
Definition at line 30 of file MmapFile.h.
Public Member Functions | |
MmapFile (const char *logpath) | |
Constructor initializes the object to empty. | |
virtual | ~MmapFile () |
Destructor unmaps and closes the file. | |
void * | map (const char *filename, int prot, int flags, size_t len=0, off_t offset=0) |
Sets up a file-based mmap. | |
bool | unmap () |
Unmaps the current mapping (if any). | |
void * | ptr () |
Accessors. | |
size_t | len () |
Accessors. | |
Private Attributes | |
void * | ptr_ |
The mmap pointer. | |
size_t | len_ |
The length of the mapping. |
oasys::MmapFile::MmapFile | ( | const char * | logpath | ) |
oasys::MmapFile::~MmapFile | ( | ) | [virtual] |
void * oasys::MmapFile::map | ( | const char * | filename, | |
int | prot, | |||
int | flags, | |||
size_t | len = 0 , |
|||
off_t | offset = 0 | |||
) |
Sets up a file-based mmap.
Definition at line 43 of file MmapFile.cc.
References ASSERT, errno, ExamineDump::f, fd, len_, log_err, oasys::Logger::logpath_, ptr_, and oasys::FileUtils::size().
Referenced by main().
bool oasys::MmapFile::unmap | ( | ) |
Unmaps the current mapping (if any).
Definition at line 89 of file MmapFile.cc.
References ASSERT, errno, len_, log_err, and ptr_.
Referenced by ~MmapFile().
void* oasys::MmapFile::ptr | ( | ) | [inline] |
size_t oasys::MmapFile::len | ( | ) | [inline] |
void* oasys::MmapFile::ptr_ [private] |
The mmap pointer.
Definition at line 64 of file MmapFile.h.
Referenced by map(), ptr(), unmap(), and ~MmapFile().
size_t oasys::MmapFile::len_ [private] |