Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

  1. //============================================================================
  2. //
  3. // Header file for generic linked list class
  4. //
  5. //============================================================================
  6. #ifndef LIST_H
  7. #define LIST_H
  8. class CList;
  9. typedef class CItem FAR * LPItem;
  10. class CItem
  11. {
  12. friend class CList;
  13. private:
  14. LPItem FAR * lppListHead;
  15. LPItem lpPrevItem;
  16. LPItem lpNextItem;
  17. protected:
  18. LPVOID lpObj;
  19. LPCSTR lpName;
  20. int iRefCnt;
  21. public:
  22. CItem(LPVOID lpObj,LPItem FAR * lppHeadItem, LPCSTR lpName);
  23. ~CItem();
  24. };
  25. class CList
  26. {
  27. protected:
  28. LPItem lpItem;
  29. LPItem lpListHead;
  30. LPItem FindItem(LPVOID lpObj);
  31. public:
  32. CList(){lpListHead=NULL;}
  33. ~CList();
  34. void AddItemWithName(LPVOID lpObj, LPCSTR lpName){new CItem(lpObj,&lpListHead,lpName);}
  35. void DelItem(LPVOID lpObj){LPItem lpItem=FindItem(lpObj);delete lpItem;}
  36. LPVOID FindItemHandleWithName( LPCSTR lpName, LPVOID lpMem );
  37. BOOL IsEmpty(){return lpListHead==NULL;}
  38. };
  39. typedef CList FAR * LPList;
  40. #endif