Lunchbox  1.6.0
Public Member Functions
lunchbox::MemoryMap Class Reference

Helper to map a file to a memory address (mmap) More...

#include <memoryMap.h>

+ Inheritance diagram for lunchbox::MemoryMap:
+ Collaboration diagram for lunchbox::MemoryMap:

List of all members.

Public Member Functions

 MemoryMap ()
 Construct a new memory map.
 ~MemoryMap ()
 Destruct the memory map.
const void * map (const std::string &fileName)
 Map a file to a memory address.
void unmap ()
 Unmap the file.
const void * getAddress () const
size_t getSize () const

Detailed Description

Helper to map a file to a memory address (mmap)

Definition at line 29 of file memoryMap.h.


Constructor & Destructor Documentation

Construct a new memory map.

Version:
1.0

Destruct the memory map.

Unmaps the file, if it is still mapped.

See also:
unmap()
Version:
1.0

Member Function Documentation

const void* lunchbox::MemoryMap::getAddress ( ) const [inline]
Returns:
the pointer to the memory map.
Version:
1.0

Definition at line 60 of file memoryMap.h.

size_t lunchbox::MemoryMap::getSize ( ) const [inline]
Returns:
the size of the memory map.
Version:
1.0

Definition at line 63 of file memoryMap.h.

const void* lunchbox::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.

Parameters:
fileNameThe filename of the file to map.
Returns:
the pointer to the mapped file, or 0 upon error.
Version:
1.0

Unmap the file.

Version:
1.0

The documentation for this class was generated from the following file: