MappedFile Class Reference

#include <MappedFile.h>

Public Member Functions

COMMON_EXPORT std::string pathname ()
COMMON_EXPORT std::string filename ()
COMMON_EXPORT void * base_addr ()
COMMON_EXPORT int getFD ()
COMMON_EXPORT unsigned long size ()
COMMON_EXPORT MappedFileclone ()
COMMON_EXPORT void setSharing (bool s)
COMMON_EXPORT bool canBeShared ()

Static Public Member Functions

static COMMON_EXPORT MappedFilecreateMappedFile (std::string fullpath_)
static COMMON_EXPORT MappedFilecreateMappedFile (void *map_loc, unsigned long size_, const std::string &name)
static COMMON_EXPORT void closeMappedFile (MappedFile *&mf)

Private Member Functions

 MappedFile (std::string fullpath_, bool &ok)
 MappedFile (void *loc, unsigned long size_, const std::string &name, bool &ok)
 ~MappedFile ()
bool clean_up ()
bool check_path (std::string &)
bool open_file ()
bool open_file (void *, unsigned long size_=0)
bool map_file ()
bool unmap_file ()
bool close_file ()

Private Attributes

std::string fullpath
void * map_addr
int fd
bool remote_file
bool did_mmap
bool did_open
bool can_share
unsigned long file_size
int refCount

Static Private Attributes

static dyn_hash_map
< std::string, MappedFile * > 
mapped_files

Detailed Description

Definition at line 38 of file MappedFile.h.


Constructor & Destructor Documentation

MappedFile::MappedFile ( std::string  fullpath_,
bool &  ok 
) [private]

Definition at line 103 of file MappedFile.C.

References check_path(), fullpath, map_file(), and open_file().

Referenced by createMappedFile().

MappedFile::MappedFile ( void *  loc,
unsigned long  size_,
const std::string &  name,
bool &  ok 
) [private]

Definition at line 141 of file MappedFile.C.

References file_size, map_addr, and open_file().

MappedFile::~MappedFile (  )  [private]

Definition at line 210 of file MappedFile.C.

References close_file(), did_mmap, did_open, and unmap_file().


Member Function Documentation

COMMON_EXPORT void* MappedFile::base_addr (  )  [inline]
bool MappedFile::canBeShared (  ) 
bool MappedFile::check_path ( std::string &  filename  )  [private]

Definition at line 221 of file MappedFile.C.

References file_size.

Referenced by MappedFile().

bool MappedFile::clean_up (  )  [private]

Definition at line 194 of file MappedFile.C.

References close_file(), did_mmap, did_open, FILE__, fprintf, fullpath, and unmap_file().

COMMON_EXPORT MappedFile* MappedFile::clone (  )  [inline]

Definition at line 55 of file MappedFile.h.

References refCount.

bool MappedFile::close_file (  )  [private]

Definition at line 414 of file MappedFile.C.

References fd, FILE__, fprintf, and remote_file.

Referenced by clean_up(), and ~MappedFile().

void MappedFile::closeMappedFile ( MappedFile *&  mf  )  [static]
MappedFile * MappedFile::createMappedFile ( void *  map_loc,
unsigned long  size_,
const std::string &  name 
) [static]

Definition at line 128 of file MappedFile.C.

References MappedFile().

MappedFile * MappedFile::createMappedFile ( std::string  fullpath_  )  [static]

Definition at line 37 of file MappedFile.C.

References can_share, fd, map_addr, mapped_files, MappedFile(), refCount, and remote_file.

Referenced by Dyninst::SymtabAPI::Symtab::Symtab().

std::string MappedFile::filename (  ) 
COMMON_EXPORT int MappedFile::getFD (  )  [inline]

Definition at line 52 of file MappedFile.h.

References fd.

Referenced by Dyninst::SymtabAPI::Object::Object().

bool MappedFile::map_file (  )  [private]

Definition at line 313 of file MappedFile.C.

References did_mmap, fd, file_size, and map_addr.

Referenced by MappedFile().

bool MappedFile::open_file ( void *  loc,
unsigned long  size_ = 0 
) [private]

Definition at line 249 of file MappedFile.C.

References did_open, fd, FILE__, file_size, fprintf, and map_addr.

bool MappedFile::open_file (  )  [private]

Definition at line 280 of file MappedFile.C.

References did_open, fd, FILE__, fprintf, fullpath, and INVALID_HANDLE_VALUE.

Referenced by MappedFile().

std::string MappedFile::pathname (  ) 
void MappedFile::setSharing ( bool  s  ) 

Definition at line 445 of file MappedFile.C.

References can_share.

Referenced by Dyninst::SymtabAPI::Symtab::emit().

COMMON_EXPORT unsigned long MappedFile::size (  )  [inline]
bool MappedFile::unmap_file (  )  [private]

Definition at line 391 of file MappedFile.C.

References FILE__, file_size, fprintf, map_addr, and remote_file.

Referenced by clean_up(), and ~MappedFile().


Field Documentation

bool MappedFile::can_share [private]

Definition at line 87 of file MappedFile.h.

Referenced by canBeShared(), createMappedFile(), and setSharing().

bool MappedFile::did_mmap [private]

Definition at line 85 of file MappedFile.h.

Referenced by clean_up(), map_file(), and ~MappedFile().

bool MappedFile::did_open [private]

Definition at line 86 of file MappedFile.h.

Referenced by clean_up(), open_file(), and ~MappedFile().

int MappedFile::fd [private]

Definition at line 81 of file MappedFile.h.

Referenced by close_file(), createMappedFile(), getFD(), map_file(), and open_file().

unsigned long MappedFile::file_size [private]

Definition at line 88 of file MappedFile.h.

Referenced by check_path(), map_file(), MappedFile(), open_file(), size(), and unmap_file().

std::string MappedFile::fullpath [private]

Definition at line 74 of file MappedFile.h.

Referenced by clean_up(), filename(), MappedFile(), open_file(), and pathname().

void* MappedFile::map_addr [private]

Definition at line 75 of file MappedFile.h.

Referenced by base_addr(), createMappedFile(), map_file(), MappedFile(), open_file(), and unmap_file().

dyn_hash_map< std::string, MappedFile * > MappedFile::mapped_files [static, private]

Definition at line 39 of file MappedFile.h.

Referenced by closeMappedFile(), and createMappedFile().

int MappedFile::refCount [private]

Definition at line 89 of file MappedFile.h.

Referenced by clone(), closeMappedFile(), and createMappedFile().

bool MappedFile::remote_file [private]

Definition at line 84 of file MappedFile.h.

Referenced by close_file(), createMappedFile(), and unmap_file().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1