Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AxPipe::CSegMap Class Reference

A special purpose version of CSeg, to work with Memory Mapped segments. More...

#include <CFileMap.h>

Inheritance diagram for AxPipe::CSegMap:

Inheritance graph
[legend]
Collaboration diagram for AxPipe::CSegMap:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CSegMap (void *pOwner, size_t cb, void *pv, void *pView, longlong llPos, bool fReadOnly=false)
 Construct with Owner, size, buffer pointer, view, file pos and possibly readonly.

virtual ~CSegMap ()
 Unmap the view, if any.

longlong GetPos ()
 Get the corresponding file pointer.

virtual void * RTClassId ()
 Run time polymorphic type information.

bool IsOwner (void *pOwner)
 Check if the provided opaque pointer matches the owner given on construction.


Static Public Member Functions

void * ClassId ()
 Compile time polymorphic type information.


Private Attributes

longlong m_llPos
 The file position in the backing file of the segment.

void * m_pView
 The corresponding mapped view.

void * m_pOwner
 Implement owner-id functions, opaque owner id here.


Detailed Description

A special purpose version of CSeg, to work with Memory Mapped segments.

CSegMap is able to release a view instead of delete'ing upon destruction. It also implements run time typing to distinguish it, as well as an owner mechanism whereby a class can tag and subsequently recognize a segment as on that it 'owns' and thus handles.

The actual mapping of the file is handled outside of this class, but it can, and will, unmap the view.

Todo:
Bring together the MapUserView() functionality into the constructor here, it really makes no sense to have it done outside. It just happended that way due to historic reasons.

Definition at line 57 of file CFileMap.h.


Constructor & Destructor Documentation

AxPipe::CSegMap::CSegMap void *  pOwner,
size_t  cb,
void *  pv,
void *  pView,
longlong  llPos,
bool  fReadOnly = false
 

Construct with Owner, size, buffer pointer, view, file pos and possibly readonly.

Parameters:
pOwner An opaque value identifying the 'owner', probably a 'this' pointer.
cb The size of the provided memory mapped file segment
pv The pointer to the actual data to be used
pView The view pointer, pv may be offset from this due to alignment.
llPos The file pointer of this segment.
fReadOnly True if this is a read-only segment

Definition at line 78 of file CFileMap.cpp.


Member Function Documentation

void * AxPipe::CSegMap::ClassId  )  [static]
 

Compile time polymorphic type information.

See also:
CSeg::ClassId()

Reimplemented from AxPipe::CSeg.

Definition at line 102 of file CFileMap.cpp.

Referenced by RTClassId().

longlong AxPipe::CSegMap::GetPos  ) 
 

Get the corresponding file pointer.

Returns:
A position in the mapped file.

Definition at line 95 of file CFileMap.cpp.

References AxPipe::longlong, and m_llPos.

Referenced by AxPipe::CSinkMemFile::Out().

bool AxPipe::CSegMap::IsOwner void *  pOwner  ) 
 

Check if the provided opaque pointer matches the owner given on construction.

Parameters:
pOwner An opaque pointer valute, probably a 'this' pointer
Returns:
true if the same value was provided as owner on construction.

Definition at line 118 of file CFileMap.cpp.

References m_pOwner.

void * AxPipe::CSegMap::RTClassId  )  [virtual]
 

Run time polymorphic type information.

See also:
CSeg::RTClassId()

Reimplemented from AxPipe::CSeg.

Definition at line 110 of file CFileMap.cpp.

References ClassId().


The documentation for this class was generated from the following files:
Generated on Mon Feb 2 13:19:27 2004 for AxPipe by doxygen 1.3.5