#include <MemoryMappedFile.h++>

Public Member Functions | |
| MemoryMappedFile (const String &path) | |
| Construct a new MemoryMappedFile for the given path. | |
| ~MemoryMappedFile () throw () | |
| Destructor. | |
| void | open (uint64_t size=0, bool readOnly=false) throw (IOException) |
| Open the file and map it into memory. | |
| void | close () throw () |
| Unmap and close the file. | |
| void | sync (bool async=false) throw (IOException) |
| Synchronize the in-memory state of the file with the file on disk. | |
| byte_t * | getBase () throw () |
| Get a pointer to the base of the mapped memory segment. | |
| const byte_t * | getBase () const throw () |
| Get a pointer to the base of the mapped memory segment. | |
| uint64_t | getSize () const throw () |
| Get the size of the memory mapped segment, in bytes. | |
| MemoryMappedFile | ( | const String & | path | ) |
Construct a new MemoryMappedFile for the given path.
| path | The path of the file to be mapped. |
| ~MemoryMappedFile | ( | ) | throw () |
Destructor.
Unmaps the file.
| void close | ( | ) | throw () |
Unmap and close the file.
| const byte_t* getBase | ( | ) | const throw () [inline] |
Get a pointer to the base of the mapped memory segment.
| byte_t* getBase | ( | ) | throw () [inline] |
Get a pointer to the base of the mapped memory segment.
| uint64_t getSize | ( | ) | const throw () [inline] |
Get the size of the memory mapped segment, in bytes.
| void open | ( | uint64_t | size = 0, |
|
| bool | readOnly = false | |||
| ) | throw (IOException) |
Open the file and map it into memory.
Zero-length files cannot be mapped.
| size | The maximum file size to map; if the file being mapped is larger than this size, the file is truncated to the new size before it is mapped into memory. A value of 0 indicates that the maximum size is the current size of the file. | |
| readOnly | A flag indicating whether the file should be mapped as read-only or read-write. If mapping read-only, the size parameter is ignored, and taken as 0. |
| IOException | If the file to be mapped has a length of 0, or if the file could not be opened or the mapping operation failed. |
| void sync | ( | bool | async = false |
) | throw (IOException) |
Synchronize the in-memory state of the file with the file on disk.
| async | A flag indicating whether the sync operation should occur asynchronously. |
| IOException | If an I/O error occurs. |
1.5.9