Common/vtkHeap.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00051 #ifndef __vtkHeap_h
00052 #define __vtkHeap_h
00053
00054 #include "vtkObject.h"
00055
00056
00057 class VTK_COMMON_EXPORT vtkHeapNode
00058 {
00059 public:
00060 void* Ptr;
00061 vtkHeapNode* Next;
00062 vtkHeapNode():Ptr(0),Next(0) {};
00063 };
00064
00065
00066 class VTK_COMMON_EXPORT vtkHeap : public vtkObject
00067 {
00068 public:
00069 static vtkHeap *New();
00070 vtkTypeRevisionMacro(vtkHeap,vtkObject);
00071 void PrintSelf(ostream& os, vtkIndent indent);
00072
00074 void* AllocateMemory(size_t n);
00075
00077 char* StringDup(const char* str);
00078
00080
00081 vtkGetMacro(NumberOfAllocations,int);
00083
00084 protected:
00085 vtkHeap();
00086 ~vtkHeap();
00087
00088 void Add(vtkHeapNode* node);
00089 void CleanAll();
00090 vtkHeapNode* DeleteAndNext();
00091
00092 vtkHeapNode* First;
00093 vtkHeapNode* Last;
00094 vtkHeapNode* Current;
00095
00096 int NumberOfAllocations;
00097 private:
00098 vtkHeap(const vtkHeap&);
00099 void operator=(const vtkHeap&);
00100 };
00101
00102 #endif