00001 00005 class DpListItemInst(Type) 00006 00007 { 00008 friend class DpList(Type,Itemtype); 00009 friend class StringList; 00010 00011 #ifdef LIST_NEW_DELETE 00012 static MemoryPool pool; 00013 #endif 00014 00015 private: 00016 Type obj; 00017 DpListItemInst(Type)* next; 00018 DpListItemInst(Type)* prev; 00019 00020 DpListItemInst(Type)(Type& obj_, 00021 DpListItemInst(Type)* nitem, 00022 DpListItemInst(Type)* pitem) 00023 { 00024 obj = obj_; 00025 next = nitem; 00026 prev = pitem; 00027 } 00028 00029 ~DpListItemInst(Type) () {} 00030 00031 Type& object() { return obj; } 00032 00033 #ifdef LIST_NEW_DELETE 00034 void* operator new (size_t t) { return pool.alloc((int)t); } 00035 void operator delete (void* v) { pool.free(v); } 00036 #endif 00037 }; 00038 00039