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.

65 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dnode.h
  6. Abstract:
  7. Node template class for double link list.
  8. Author:
  9. Weihai Chen (WeihaiC) 05/12/99
  10. Revision History:
  11. Weihai Chen (WeihaiC) 03/08/00 Rename to T*
  12. --*/
  13. #ifndef _DNODE_H
  14. #define _DNODE_H
  15. //////////////////////////////////////////////////////////////////////
  16. //
  17. // dnode.h: template for the DoubleList Node class.
  18. //
  19. //////////////////////////////////////////////////////////////////////
  20. template <class T, class KEYTYPE> class TDoubleNode
  21. {
  22. public:
  23. TDoubleNode (void);
  24. TDoubleNode (T);
  25. TDoubleNode (T, TDoubleNode<T, KEYTYPE> *, TDoubleNode<T, KEYTYPE> *);
  26. virtual ~TDoubleNode (void);
  27. void SetNext (TDoubleNode<T, KEYTYPE> *);
  28. void SetPrev (TDoubleNode<T, KEYTYPE> *);
  29. TDoubleNode<T, KEYTYPE> * GetNext ();
  30. TDoubleNode<T, KEYTYPE> * GetPrev ();
  31. BOOL IsSameItem (T&);
  32. BOOL IsSameKey (KEYTYPE&);
  33. T GetData (void);
  34. void SetData (T pData);
  35. private:
  36. T m_Data;
  37. TDoubleNode<T, KEYTYPE> *m_pPrev;
  38. TDoubleNode<T, KEYTYPE> *m_pNext;
  39. };
  40. #include "dnode.inl"
  41. #endif