CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MemoryMappedFile Class Reference

#include <mmap_file.h>

Inheritance diagram for MemoryMappedFile:
Collaboration diagram for MemoryMappedFile:

Public Member Functions

 MemoryMappedFile (const std::string &file_path)
 
 ~MemoryMappedFile ()
 
bool Map ()
 
void Unmap ()
 
unsigned char * buffer () const
 
size_t size () const
 
const std::string & file_path () const
 
bool IsMapped () const
 

Private Attributes

const std::string file_path_
 
int file_descriptor_
 
unsigned char * mapped_file_
 
size_t mapped_size_
 
bool mapped_
 

Additional Inherited Members

- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Detailed Description

This file is part of the CernVM File System. Wraps the functionality of mmap() to create a read-only memory mapped file.

Note: You need to call Map() to actually map the provided file path to memory

Definition at line 23 of file mmap_file.h.

Constructor & Destructor Documentation

MemoryMappedFile::MemoryMappedFile ( const std::string &  file_path)
explicit

Definition at line 31 of file mmap_file.cc.

MemoryMappedFile::~MemoryMappedFile ( )

Definition at line 38 of file mmap_file.cc.

Here is the call graph for this function:

Member Function Documentation

unsigned char* MemoryMappedFile::buffer ( ) const
inline

Definition at line 31 of file mmap_file.h.

Referenced by FileBackedBuffer::Data().

Here is the caller graph for this function:

const std::string& MemoryMappedFile::file_path ( ) const
inline

Definition at line 33 of file mmap_file.h.

bool MemoryMappedFile::IsMapped ( ) const
inline

Definition at line 35 of file mmap_file.h.

Referenced by ~MemoryMappedFile().

Here is the caller graph for this function:

bool MemoryMappedFile::Map ( )

Definition at line 44 of file mmap_file.cc.

Referenced by FileBackedBuffer::Commit().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t MemoryMappedFile::size ( ) const
inline

Definition at line 32 of file mmap_file.h.

void MemoryMappedFile::Unmap ( )

Definition at line 90 of file mmap_file.cc.

Referenced by FileBackedBuffer::~FileBackedBuffer(), and ~MemoryMappedFile().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

int MemoryMappedFile::file_descriptor_
private

Definition at line 39 of file mmap_file.h.

Referenced by Map(), and Unmap().

const std::string MemoryMappedFile::file_path_
private

Definition at line 38 of file mmap_file.h.

Referenced by Map(), and Unmap().

bool MemoryMappedFile::mapped_
private

Definition at line 42 of file mmap_file.h.

Referenced by Map(), and Unmap().

unsigned char* MemoryMappedFile::mapped_file_
private

Definition at line 40 of file mmap_file.h.

Referenced by Map(), and Unmap().

size_t MemoryMappedFile::mapped_size_
private

Definition at line 41 of file mmap_file.h.

Referenced by Map(), and Unmap().


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