eq::base::MemoryMap Class Reference

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

#include <memoryMap.h>

Inheritance diagram for eq::base::MemoryMap:

Inheritance graph
[legend]
Collaboration diagram for eq::base::MemoryMap:

Collaboration graph
[legend]

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 31 of file memoryMap.h.


Constructor & Destructor Documentation

eq::base::MemoryMap::MemoryMap (  ) 

Construct a new memory map.

Definition at line 33 of file memoryMap.cpp.

eq::base::MemoryMap::~MemoryMap (  ) 

Destruct the memory map.

Unmaps the file, if it is still mapped.

See also:
unmap()

Definition at line 43 of file memoryMap.cpp.

References unmap().

Here is the call graph for this function:


Member Function Documentation

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

Parameters:
fileName The filename of the file to map.
Returns:
the pointer to the mapped file, or 0 upon error.

Definition at line 49 of file memoryMap.cpp.

References EQWARN.

Referenced by eq::Image::readImage().

Here is the caller graph for this function:

void eq::base::MemoryMap::unmap (  ) 

Unmap the file.

Definition at line 114 of file memoryMap.cpp.

References EQWARN.

Referenced by ~MemoryMap().

Here is the caller graph for this function:

const void* eq::base::MemoryMap::getAddress (  )  const [inline]

Returns:
the pointer to the memory map.

Definition at line 60 of file memoryMap.h.

Referenced by eq::Image::readImage().

Here is the caller graph for this function:

size_t eq::base::MemoryMap::getSize (  )  const [inline]

Returns:
the size of the memory map.

Definition at line 63 of file memoryMap.h.

Referenced by eq::Image::readImage().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:44 2009 for Equalizer 0.9 by  doxygen 1.5.8