home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP10-8.ZIP / CLASSINC.ZIP / DLSTELEM.H < prev    next >
C/C++ Source or Header  |  1990-09-26  |  2KB  |  103 lines

  1. #ifndef _DLSTELEM_H
  2. #define _DLSTELEM_H
  3.  
  4. //
  5. // This file contains proprietary information of Borland International.
  6. // Copying or reproduction without prior written approval is prohibited.
  7. //
  8. // Copyright (c) 1990
  9. // Borland International
  10. // 1800 Green Hills Road
  11. // Scotts Valley, CA 95066
  12. // (408) 438-8400
  13. //
  14.  
  15. // Contents ----------------------------------------------------------------
  16. //
  17. //      DoubleListElement
  18. //
  19. // Description
  20. //
  21. //      Defines the class DoubleListElement.  Objects of this class may
  22. //      be part of lists which can be traversed in forward and reverse
  23. //      order.
  24. //
  25. // End ---------------------------------------------------------------------
  26.  
  27. // Interface Dependencies ---------------------------------------------------
  28.  
  29. #ifndef _IOSTREAM_H
  30. #include <iostream.h>
  31. #define _IOSTREAM_H
  32. #endif
  33.  
  34. #ifndef __CLSTYPES_H
  35. #include <clstypes.h>
  36. #endif
  37.  
  38. #ifndef __OBJECT_H
  39. #include <object.h>
  40. #endif
  41.  
  42. // End Interface Dependencies ------------------------------------------------
  43.  
  44. // Class //
  45.  
  46. class DoubleListElement
  47. {
  48. public:
  49.             DoubleListElement( Object *o ) { data = o; next = previous = 0; }
  50.             ~DoubleListElement() { delete data; }
  51.  
  52. private:
  53.             DoubleListElement *next;
  54.             DoubleListElement *previous;
  55.             Object            *data;
  56.     friend class DoubleList;
  57.     friend class DoubleListIterator;
  58. };
  59.  
  60. // Description -------------------------------------------------------------
  61. //
  62. //         Defines the abstract class DoubleListElement.
  63. //
  64. // Constructor
  65. //
  66. //         DoubleListElement
  67. //
  68. //         Constructor based on ListElement constructor which makes a
  69. //         list element from an object reference.
  70. //
  71. // Destructor
  72. //
  73. //      ~DoubleListElement
  74. //
  75. //      We delete the data.
  76. //
  77. //
  78. // Private Members
  79. //
  80. //      next
  81. //
  82. //      The next double list element.
  83. //
  84. //      previous
  85. //
  86. //      The previous double list element.
  87. //
  88. //      data
  89. //
  90. //      Pointer to the double list element's data.
  91. //
  92. // Friends
  93. //
  94. //         class DoubleList
  95. //
  96. //         class DoubleListIterator
  97. //
  98. // End ---------------------------------------------------------------------
  99.  
  100.  
  101. #endif // ifndef _DLSTELEM_H //
  102.  
  103.