CHeapPtrBase Class
TOC
Collapse the table of content
Expand the table of content

CHeapPtrBase Class

 

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

System_CAPS_importantImportant

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::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.

Requirements

Header: atlcore.h

Show:
© 2016 Microsoft