Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CHeapPtrBase Class

This class forms the basis for several smart heap pointer classes.

Important note Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

template < 
class T, 
class Allocator= CCRTAllocator  
> class CHeapPtrBase
T

The object type to be stored on the heap.

Allocator

The memory allocation class to use. By default CRT routines are used to allocate and free memory.

Name

Description

CHeapPtrBase::~CHeapPtrBase

The destructor.

Name

Description

CHeapPtrBase::AllocateBytes

Call this method to allocate memory.

CHeapPtrBase::Attach

Call this method to take ownership of an existing pointer.

CHeapPtrBase::Detach

Call this method to release ownership of a pointer.

CHeapPtrBase::Free

Call this method to delete an object pointed to by a CHeapPtrBase.

CHeapPtrBase::ReallocateBytes

Call this method to reallocate memory.

Name

Description

CHeapPtrBase::operator T*

The cast operator.

CHeapPtrBase::operator &

The & operator.

CHeapPtrBase::operator ->

The pointer-to-member operator.

Name

Description

CHeapPtrBase::m_pData

The pointer data member variable.

This class forms the basis for several smart heap pointer classes. The derived classes, for example, CHeapPtr and CComHeapPtr, add their own constructors and operators. See these classes for implementation examples.

Header: atlcore.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.