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

dox/Common/vtkHeap.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkHeap.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00039 #ifndef __vtkHeap_h 00040 #define __vtkHeap_h 00041 00042 #include "vtkObject.h" 00043 00044 //BTX 00045 class VTK_COMMON_EXPORT vtkHeapNode 00046 { 00047 public: 00048 void* Ptr; 00049 vtkHeapNode* Next; 00050 vtkHeapNode():Ptr(0),Next(0) {}; 00051 }; 00052 //ETX 00053 00054 class VTK_COMMON_EXPORT vtkHeap : public vtkObject 00055 { 00056 public: 00057 static vtkHeap *New(); 00058 vtkTypeRevisionMacro(vtkHeap,vtkObject); 00059 void PrintSelf(ostream& os, vtkIndent indent); 00060 00062 void* AllocateMemory(size_t n); 00063 00065 char* StringDup(const char* str); 00066 00068 00069 vtkGetMacro(NumberOfAllocations,int); 00071 00072 protected: 00073 vtkHeap(); 00074 ~vtkHeap(); 00075 00076 void Add(vtkHeapNode* node); 00077 void CleanAll(); 00078 vtkHeapNode* DeleteAndNext(); 00079 00080 vtkHeapNode* First; 00081 vtkHeapNode* Last; 00082 vtkHeapNode* Current; 00083 00084 int NumberOfAllocations; 00085 private: 00086 vtkHeap(const vtkHeap&); // Not implemented. 00087 void operator=(const vtkHeap&); // Not implemented. 00088 }; 00089 00090 #endif