| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
MEMORY_MAPPED_FILE Class Reference

`#include <LibSymbolInfo.h>`

## Public Member Functions
| MEMORY_MAPPED_FILE (PSTR pszFileName)
| ~MEMORY_MAPPED_FILE (void)
PVOID | GetBase (void)
DWORD | GetFileSize (void)
BOOL | IsValid (void)
errMMF | GetErrorType ()

## Private Attributes
HANDLE | m_hFile
HANDLE | m_hFileMapping
PVOID | m_pMemoryMappedFileBase
DWORD | m_cbFile
errMMF | m_errCode

## Detailed Description

Definition at line 40 of file LibSymbolInfo.h.

## Constructor & Destructor Documentation

MEMORY_MAPPED_FILE::MEMORY_MAPPED_FILE | ( | PSTR | pszFileName | ) |

Definition at line 197 of file LibSymbolInfo.cpp.

{
//
// Given a filename, the constructor opens a file handle, creates a file
// mapping, and maps the entire file into memory.
//
m_hFile = INVALID_HANDLE_VALUE;
m_hFileMapping = 0;
m_pMemoryMappedFileBase = 0;
m_cbFile = 0;
m_errCode = errMMF_FileOpen; // Initial error code: not found
// First get a file handle
m_hFile = CreateFile(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, (HANDLE)0);
if ( m_hFile == INVALID_HANDLE_VALUE )
{
m_errCode = errMMF_FileOpen;
return;
}
m_cbFile = ::GetFileSize( m_hFile, 0 );
// Now, create a file mapping
m_hFileMapping = CreateFileMapping(m_hFile,NULL, PAGE_READONLY, 0, 0,NULL);
if ( m_hFileMapping == 0 )
{
// Oops. Something went wrong. Clean up.
CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
m_errCode = errMMF_FileMapping;
return;
}
m_pMemoryMappedFileBase = (PCHAR)MapViewOfFile( m_hFileMapping,
FILE_MAP_READ, 0, 0, 0);
if ( m_pMemoryMappedFileBase == 0 )
{
// Oops. Something went wrong. Clean up.
CloseHandle(m_hFileMapping);
m_hFileMapping = 0;
CloseHandle(m_hFile);
m_hFile = INVALID_HANDLE_VALUE;
m_errCode = errMMF_MapView;
return;
}
m_errCode = errMMF_NoError;
}

MEMORY_MAPPED_FILE::~MEMORY_MAPPED_FILE | ( | void |  | ) |

Definition at line 243 of file LibSymbolInfo.cpp.

{
// Clean up everything that was created by the constructor
if ( m_pMemoryMappedFileBase )
UnmapViewOfFile( m_pMemoryMappedFileBase );
if ( m_hFileMapping )
CloseHandle( m_hFileMapping );
if ( m_hFile != INVALID_HANDLE_VALUE )
CloseHandle( m_hFile );
m_errCode = errMMF_FileOpen;
}

## Member Function Documentation

PVOID MEMORY_MAPPED_FILE::GetBase | ( | void |  | ) |
| inline

Definition at line 46 of file LibSymbolInfo.h.

{ return m_pMemoryMappedFileBase; }

errMMF MEMORY_MAPPED_FILE::GetErrorType | ( |  | ) |
| inline

Definition at line 49 of file LibSymbolInfo.h.

{ return m_errCode; }

DWORD MEMORY_MAPPED_FILE::GetFileSize | ( | void |  | ) |
| inline

Definition at line 47 of file LibSymbolInfo.h.

{ return m_cbFile; }

BOOL MEMORY_MAPPED_FILE::IsValid | ( | void |  | ) |
| inline

Definition at line 48 of file LibSymbolInfo.h.

{ return errMMF_NoError == m_errCode; }

## Member Data Documentation

DWORD MEMORY_MAPPED_FILE::m_cbFile
| private

Definition at line 56 of file LibSymbolInfo.h.

errMMF MEMORY_MAPPED_FILE::m_errCode
| private

Definition at line 57 of file LibSymbolInfo.h.

HANDLE MEMORY_MAPPED_FILE::m_hFile
| private

Definition at line 53 of file LibSymbolInfo.h.

HANDLE MEMORY_MAPPED_FILE::m_hFileMapping
| private

Definition at line 54 of file LibSymbolInfo.h.

PVOID MEMORY_MAPPED_FILE::m_pMemoryMappedFileBase
| private

Definition at line 55 of file LibSymbolInfo.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiKernel/src/Util/LibSymbolInfo.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiKernel/src/Util/LibSymbolInfo.cpp