00001 #ifndef __BitmapPool__ 00002 #define __BitmapPool__ 00003 00004 #include <list> 00005 #include "Unique.h" 00006 00007 class BitmapPool:public CUnique<BitmapPool> 00008 { 00009 public: 00010 BitmapPool(void); 00011 void Init(int bitmapsize, int poolsize); 00012 ~BitmapPool(void); 00013 protected: 00014 bool* freeslot; 00015 int poolsize; 00016 int bitmapsize; 00017 unsigned char** pool; 00018 std::list <int> freelist; 00019 std::list <int> busylist; 00020 public: 00021 unsigned char * Allocate(void); 00022 bool Deallocate(unsigned char * poolslot); 00023 }; 00024 00025 #endif