FX::FXMemMap Class Reference

#include <FXMemMap.h>

List of all members.


Detailed Description

A Memory Map provides a view of a file as an array of memory; this allows the file itself to be used as backing for the data and very simplified file access results. Moreover, mapped files may be shared by processes, resuling in far less "real" memory being used than would otherwise be the case.

Public Types

enum  {
  NONE, READ, WRITE, EXEC,
  TRUNC
}
enum  { PRIV, SHAR }

Public Member Functions

 FXMemMap ()
void * mapFile (const FXString &filename, long off=0, long len=-1L, FXuint access=READ, FXuint share=PRIV)
void * unmap ()
void sync ()
void * base () const
long length () const
long offset () const
 ~FXMemMap ()

Member Enumeration Documentation

anonymous enum

Memory map access modes.

Enumerator:
READ  Map is inaccessible.
WRITE  Readable.
EXEC  Writable.
TRUNC  Executable (where supported).

anonymous enum

Share mode.

Enumerator:
SHAR  Private.


Constructor & Destructor Documentation

FX::FXMemMap::FXMemMap (  ) 

Construct a memory map.

FX::FXMemMap::~FXMemMap (  ) 

Destroy the map.


Member Function Documentation

void* FX::FXMemMap::mapFile ( const FXString filename,
long  off = 0,
long  len = -1L,
FXuint  access = READ,
FXuint  share = PRIV 
)

Map a view of the file; the offset must be a multiple of the page size.

void* FX::FXMemMap::unmap (  ) 

Unmap the view of the file.

void FX::FXMemMap::sync (  ) 

Synchronize disk.

void* FX::FXMemMap::base (  )  const [inline]

Return pointer to memory area.

long FX::FXMemMap::length (  )  const [inline]

Obtain length of the map.

long FX::FXMemMap::offset (  )  const [inline]

Obtain offset of the map.


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:05:31 2008 for TnFOX by doxygen v1.5.6