The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CSmartHeapPointer Class Reference
[Smart Pointer]

Collaboration diagram for CSmartHeapPointer:

List of all members.


Detailed Description

A smart pointer to memory using the HeapAlloc() API. Calls HeapFree() on any memory that the CSmartHeapPointer owns when it goes out of scope to aid in scope based designs.


Public Member Functions

 CSmartHeapPointer ()
 Create a CSmartHeapPointer that currently owns no memory.
 CSmartHeapPointer (void *pHeapMemory)
 Create a CSmartHeapPointer that owns the supplied memory which must have been allocated from the process heap.
 CSmartHeapPointer (void *pHeapMemory, HANDLE hHeap)
 Create a CSmartHeapPointer that owns the supplied memory which must have been allocated from supplied process heap.
 CSmartHeapPointer (const CSmartHeapPointer &rhs)
 ~CSmartHeapPointer ()
CSmartHeapPointeroperator= (const CSmartHeapPointer &rhs)
CSmartHeapPointeroperator= (void *pHeapMemory)
void * Get () const
 Obtain access to any memory that is owned by the pointer.
void * Detach ()
 Give up ownership and return any memory that is owned.
 operator void * () const
 Provide access to any memory that is owned by the pointer.
bool IsValid () const
 Returns true if the CSmartHeapPointer currently owns some memory.


Constructor & Destructor Documentation

Create a CSmartHeapPointer that currently owns no memory.

CSmartHeapPointer ( void *  pHeapMemory  )  [explicit]

Create a CSmartHeapPointer that owns the supplied memory which must have been allocated from the process heap.

CSmartHeapPointer ( void *  pHeapMemory,
HANDLE  hHeap 
)

Create a CSmartHeapPointer that owns the supplied memory which must have been allocated from supplied process heap.

CSmartHeapPointer ( const CSmartHeapPointer rhs  ) 


Member Function Documentation

CSmartHeapPointer& operator= ( const CSmartHeapPointer rhs  ) 

CSmartHeapPointer & operator= ( void *  pHeapMemory  ) 

void * Get (  )  const

Obtain access to any memory that is owned by the pointer.

HANDLE Detach (  ) 

Give up ownership and return any memory that is owned.

operator void * (  )  const

Provide access to any memory that is owned by the pointer.

bool IsValid (  )  const

Returns true if the CSmartHeapPointer currently owns some memory.


Generated on Sun Sep 12 19:11:49 2021 for The Server Framework - v7.4 by doxygen 1.5.3