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.

131 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: cdlink.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes: CDlink
  11. //
  12. // History: 16-Oct-91 KevinRo Created
  13. //
  14. //--------------------------------------------------------------------------
  15. #ifndef _CDLINK_HXX_
  16. #define _CDLINK_HXX_
  17. //+----------------------------------------------------------------------
  18. //
  19. // Class: CDLink, dl
  20. //
  21. // Purpose: A double linked list class
  22. //
  23. //----------------------------------------------------------------------
  24. class CDLink {
  25. public:
  26. CDLink();
  27. virtual ~CDLink();
  28. CDLink * Next() const;
  29. void SetNext(CDLink * dlNext);
  30. CDLink * Prev() const;
  31. void SetPrev(CDLink * dlPrev);
  32. EXPORTDEF VOID LinkAfter(CDLink * dlPrev);
  33. EXPORTDEF VOID LinkBefore(CDLink * dlNext);
  34. EXPORTDEF VOID UnLink();
  35. private:
  36. CDLink *_dlNext;
  37. CDLink *_dlPrev;
  38. };
  39. //+----------------------------------------------------------------------
  40. //
  41. // Member: CDLink::CDLink
  42. //
  43. // Purpose: Constructor for CDLink
  44. //
  45. //-----------------------------------------------------------------------
  46. inline CDLink::CDLink()
  47. {
  48. _dlNext = NULL;
  49. _dlPrev = NULL;
  50. }
  51. //+----------------------------------------------------------------------
  52. //
  53. // Member: CDLink::~CDLink
  54. //
  55. // Purpose: Destructor for CDLink
  56. //
  57. //-----------------------------------------------------------------------
  58. inline CDLink::~CDLink()
  59. {
  60. _dlNext = NULL;
  61. _dlPrev = NULL;
  62. }
  63. //+----------------------------------------------------------------------
  64. //
  65. // Member: CDLink::Next
  66. //
  67. // Purpose: Member variable access function
  68. //
  69. // Returns: _dlNext
  70. //
  71. //-----------------------------------------------------------------------
  72. inline CDLink *CDLink::Next() const
  73. {
  74. return _dlNext;
  75. }
  76. //+----------------------------------------------------------------------
  77. //
  78. // Member: CDLink::SetNext
  79. //
  80. // Purpose: Member variable set function
  81. //
  82. // Returns: Nothing
  83. //
  84. //-----------------------------------------------------------------------
  85. inline void CDLink::SetNext(CDLink * dlNext)
  86. {
  87. _dlNext = dlNext;
  88. }
  89. //+----------------------------------------------------------------------
  90. //
  91. // Member: CDLink::Prev
  92. //
  93. // Purpose: Member variable access function
  94. //
  95. // Returns: _dlPrev
  96. //
  97. //-----------------------------------------------------------------------
  98. inline CDLink *CDLink::Prev() const
  99. {
  100. return _dlPrev;
  101. }
  102. //+----------------------------------------------------------------------
  103. //
  104. // Member: CDLink::SetPrev
  105. //
  106. // Purpose: Member variable set function
  107. //
  108. // Returns: Nothing
  109. //
  110. //-----------------------------------------------------------------------
  111. inline void CDLink::SetPrev(CDLink * dlPrev)
  112. {
  113. _dlPrev = dlPrev;
  114. }
  115. #endif