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

CMemoryTracker Class Reference

This class is keeps track of the number of pointers in use so that memory leaks can be detected. More...

Inheritance diagram for CMemoryTracker:

Inheritance graph
[legend]
Collaboration diagram for CMemoryTracker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CMemoryTracker ()
 The CMemoryTracker constructor sets the number of active pointers to zero.
 ~CMemoryTracker ()
 The CMemoryTracker destructor currently does nothing.
virtual void * Request (unsigned long length)
 The Request function returns a pointer to new dynamically allocated memory.
virtual void Free (void *ptr)
 The free function releases a dynamically allocated block of memory.
unsigned long GetNumberOfPointers () const
 The GetNumberOfPointers function returns the number of active (unreleased) pointers.
void FreeAll ()
 The CMemoryTracker FreeAll function currently does nothing DEPRICIATED, DO NOT USE.

Protected Attributes

PointerArray listofpointer
 A list of pointers that are currently in use, depreciated, DO NOT USE.
unsigned long numpointers
 The current number of pointer that are in use.

Detailed Description

This class is keeps track of the number of pointers in use so that memory leaks can be detected.

Currently this is the only memory manager class in use.

See also:
IMemory

CDefaultMemoryManager


Member Function Documentation

void CMemoryTracker::Free void *  ptr  )  [virtual]
 

The free function releases a dynamically allocated block of memory.

The count of active pointers is decreased by one upon a free operation. Using memory after a free operation is an error.

Parameters:
ptr the pointer to the memory to be freed.

Implements IMemory.

unsigned long CMemoryTracker::GetNumberOfPointers  )  const
 

The GetNumberOfPointers function returns the number of active (unreleased) pointers.

Returns:
the number of pointers.

void * CMemoryTracker::Request unsigned long  length  )  [virtual]
 

The Request function returns a pointer to new dynamically allocated memory.

The function also increases the count of active pointers by one.

Parameters:
length the size of the requested memory in bytes.
Returns:
the pointer to the new memory.

Implements IMemory.


The documentation for this class was generated from the following files:
Generated on Sat Apr 16 16:31:09 2005 for Centum API by  doxygen 1.4.2