Collaboration diagram for Mmapping:

Public Member Functions

 Mmapping (int fd, size_t length, int prot, int flags, off_t offset)
 
 ~Mmapping ()
 
void * map ()
 calls mmap(2); returns usable buffer or nil on failure More...
 
bool unmap ()
 unmaps previously mapped buffer, if any More...
 

Private Attributes

const int fd
 descriptor of the mmapped file More...
 
const size_t length
 user-requested data length, needed for munmap More...
 
const int prot
 mmap(2) "protection" flags More...
 
const int flags
 other mmap(2) flags More...
 
const off_t offset
 user-requested data offset More...
 
off_t delta
 mapped buffer increment to hit user offset More...
 
void * buf
 buffer returned by mmap, needed for munmap More...
 

Detailed Description

Definition at line 36 of file MmappedFile.cc.

Constructor & Destructor Documentation

Mmapping::Mmapping ( int  fd,
size_t  length,
int  prot,
int  flags,
off_t  offset 
)

Definition at line 220 of file MmappedFile.cc.

Mmapping::~Mmapping ( )

Definition at line 226 of file MmappedFile.cc.

References buf, and unmap().

Member Function Documentation

void * Mmapping::map ( )

Definition at line 233 of file MmappedFile.cc.

References buf, debugs, delta, fd, flags, HERE(), length, NULL, offset, prot, and xstrerr().

Referenced by MmappedFile::read().

bool Mmapping::unmap ( )

Definition at line 253 of file MmappedFile.cc.

References buf, debugs, delta, error(), fd, HERE(), length, NULL, and xstrerr().

Referenced by MmappedFile::read(), and ~Mmapping().

Member Data Documentation

void* Mmapping::buf
private

Definition at line 53 of file MmappedFile.cc.

Referenced by map(), unmap(), and ~Mmapping().

off_t Mmapping::delta
private

Definition at line 52 of file MmappedFile.cc.

Referenced by map(), and unmap().

const int Mmapping::fd
private

Definition at line 46 of file MmappedFile.cc.

Referenced by map(), and unmap().

const int Mmapping::flags
private

Definition at line 49 of file MmappedFile.cc.

Referenced by map().

const size_t Mmapping::length
private

Definition at line 47 of file MmappedFile.cc.

Referenced by map(), and unmap().

const off_t Mmapping::offset
private

Definition at line 50 of file MmappedFile.cc.

Referenced by map().

const int Mmapping::prot
private

Definition at line 48 of file MmappedFile.cc.

Referenced by map().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors