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.

68 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dlistlck.inl
  6. Abstract:
  7. Double linked list with lock template class.
  8. Author:
  9. Weihai Chen (WeihaiC) 04/15/98
  10. Revision History:
  11. --*/
  12. #ifndef _DLISTLCK_H
  13. #define _DLISTLCK_H
  14. #include "dlist.hxx"
  15. template <class T, class KEYTYPE> class TDoubleListLock
  16. {
  17. public:
  18. TDoubleListLock( void );
  19. virtual ~TDoubleListLock( void );
  20. BOOL InsertItem ( T);
  21. BOOL AppendItem ( T);
  22. BOOL DeleteItem ( T);
  23. BOOL InsertNode (TDoubleNode <T, KEYTYPE> *);
  24. BOOL AppendNode (TDoubleNode <T, KEYTYPE> *);
  25. BOOL DeleteNode (TDoubleNode <T, KEYTYPE> *);
  26. TDoubleNode<T, KEYTYPE>* GetHead (void);
  27. BOOL GetTotalNode (PDWORD pdwCount);
  28. operator TCriticalSection & () {return m_CritSec;}
  29. BOOL bValid() {return m_bValid;};
  30. protected:
  31. BOOL m_bValid;
  32. TDoubleList<T, KEYTYPE> *m_pList;
  33. TCriticalSection m_CritSec;
  34. };
  35. template <class T, class KEYTYPE> class TSrchDoubleListLock
  36. : public TSrchDoubleList<T, KEYTYPE>
  37. {
  38. public:
  39. TSrchDoubleListLock( void ) {};
  40. virtual ~TSrchDoubleListLock( void ) {};
  41. virtual T FindItemFromItem (T );
  42. virtual T FindItemFromKey (KEYTYPE );
  43. TDoubleNode<T, KEYTYPE> * FindNodeFromItem (T item);
  44. TDoubleNode<T, KEYTYPE> * FindNodeFromKey (KEYTYPE key);
  45. };
  46. #include "dlistlck.inl"
  47. #endif