00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00039
#ifndef __vtkHeap_h
00040
#define __vtkHeap_h
00041
00042
#include "vtkObject.h"
00043
00044
00045 class VTK_COMMON_EXPORT vtkHeapNode
00046 {
00047
public:
00048 void* Ptr;
00049 vtkHeapNode* Next;
00050 vtkHeapNode():Ptr(0),Next(0) {};
00051 };
00052
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&);
00087
void operator=(
const vtkHeap&);
00088 };
00089
00090
#endif