Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkHeap Class Reference

replacement for malloc/free and new/delete. More...

#include <vtkHeap.h>

Inheritance diagram for vtkHeap:

Inheritance graph
[legend]
Collaboration diagram for vtkHeap:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void * AllocateMemory (size_t n)
char * vtkStrDup (const char *str)
virtual int GetNumberOfAllocations ()

Static Public Methods

vtkHeap * New ()
int IsTypeOf (const char *type)
vtkHeap * SafeDownCast (vtkObject *o)

Protected Methods

 vtkHeap ()
 ~vtkHeap ()
void Add (vtkHeapNode *node)
void CleanAll ()
vtkHeapNodeDeleteAndNext ()

Protected Attributes

vtkHeapNodeFirst
vtkHeapNodeLast
vtkHeapNodeCurrent
int NumberOfAllocations

Detailed Description

replacement for malloc/free and new/delete.

Date:
2002/01/02 20:39:38
Revision:
1.5.2.1
Thanks:
Tom Citriniti who implemented and contributed this class
This class is a replacement for malloc/free and new/delete for software that has inherent memory leak problems. For example, external software such as the PLY library (vtkPLY) and VRML importer (vtkVRMLImporter) are often written with lots of malloc() calls but without the corresponding free() invocations. This class allows the replacement of malloc() with the method AllocateMemory(). Memory is then deleted with an invocation of CleanUp().

Warning:
Do not use this method as a replacement for system memory allocation. This class should be used only as a last resort if memory leaks cannot be tracked down and eliminated by conventional means.
See also:
vtkVRMLImporter vtkPLY

Definition at line 80 of file vtkHeap.h.


Constructor & Destructor Documentation

vtkHeap::vtkHeap   [protected]
 

vtkHeap::~vtkHeap   [protected]
 


Member Function Documentation

vtkHeap* vtkHeap::New   [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual const char* vtkHeap::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

int vtkHeap::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkHeap::IsA const char *    type [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

vtkHeap* vtkHeap::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

void vtkHeap::PrintSelf ostream &    os,
vtkIndent    indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

void* vtkHeap::AllocateMemory size_t    n
 

Allocate the memory requested.

char* vtkHeap::vtkStrDup const char *    str
 

Convenience method performs string duplication.

virtual int vtkHeap::GetNumberOfAllocations   [virtual]
 

Get the number of allocations thus far.

void vtkHeap::Add vtkHeapNode   node [protected]
 

void vtkHeap::CleanAll   [protected]
 

vtkHeapNode* vtkHeap::DeleteAndNext   [protected]
 


Member Data Documentation

vtkHeapNode* vtkHeap::First [protected]
 

Definition at line 106 of file vtkHeap.h.

vtkHeapNode* vtkHeap::Last [protected]
 

Definition at line 107 of file vtkHeap.h.

vtkHeapNode* vtkHeap::Current [protected]
 

Definition at line 108 of file vtkHeap.h.

int vtkHeap::NumberOfAllocations [protected]
 

Definition at line 110 of file vtkHeap.h.


The documentation for this class was generated from the following file:
Generated on Thu Mar 28 14:29:50 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001