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.

75 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. sitem.inl
  6. Abstract:
  7. Item template class.
  8. Author:
  9. Weihai Chen (WeihaiC) 06/29/98
  10. Revision History:
  11. --*/
  12. template <class T>
  13. CSingleItem<T>::CSingleItem(void)
  14. : m_Data(NULL), m_Next(NULL)
  15. {
  16. }
  17. template <class T>
  18. CSingleItem<T>::CSingleItem(T item)
  19. : m_Data(item), m_Next(NULL)
  20. {
  21. }
  22. template <class T>
  23. CSingleItem<T>::CSingleItem(T item, CSingleItem<T>* next)
  24. : m_Data(item), m_Next(next)
  25. {
  26. }
  27. template <class T>
  28. CSingleItem<T>::~CSingleItem(void)
  29. {
  30. if (m_Data) {
  31. delete (m_Data);
  32. }
  33. }
  34. template <class T>
  35. void CSingleItem<T>::SetNext (CSingleItem<T> *item)
  36. {
  37. m_Next = item;
  38. }
  39. template <class T>
  40. CSingleItem<T> * CSingleItem<T>::GetNext (void )
  41. {
  42. return m_Next;
  43. }
  44. template <class T>
  45. T CSingleItem<T>::GetData (void )
  46. {
  47. return m_Data;
  48. }
  49. template <class T>
  50. BOOL CSingleItem<T>::IsSame (T &item)
  51. {
  52. return m_Data->Compare (item) == 0;
  53. }