vtkHeap.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00056 #ifndef __vtkHeap_h
00057 #define __vtkHeap_h
00058
00059 #include "vtkObject.h"
00060
00061 class vtkHeapBlock;
00062
00063 class VTK_COMMON_EXPORT vtkHeap : public vtkObject
00064 {
00065 public:
00066 static vtkHeap *New();
00067 vtkTypeRevisionMacro(vtkHeap,vtkObject);
00068 void PrintSelf(ostream& os, vtkIndent indent);
00069
00071 void* AllocateMemory(size_t n);
00072
00074
00076 virtual void SetBlockSize(size_t);
00077 virtual size_t GetBlockSize() { return this->BlockSize;};
00079
00081
00082 vtkGetMacro(NumberOfBlocks,int);
00083 vtkGetMacro(NumberOfAllocations,int);
00085
00089 void Reset();
00090
00092 char* StringDup(const char* str);
00093
00094 protected:
00095 vtkHeap();
00096 ~vtkHeap();
00097
00098 void Add(size_t blockSize);
00099 void CleanAll();
00100 vtkHeapBlock* DeleteAndNext();
00101
00102 size_t BlockSize;
00103 int NumberOfAllocations;
00104 int NumberOfBlocks;
00105 int Alignment;
00106
00107
00108 vtkHeapBlock* First;
00109 vtkHeapBlock* Last;
00110 vtkHeapBlock* Current;
00111
00112 size_t Position;
00113
00114 private:
00115 vtkHeap(const vtkHeap&);
00116 void operator=(const vtkHeap&);
00117 };
00118
00119 #endif