home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 1.ddi / CLASSINC.ZIP / DLSTELEM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-13  |  2.0 KB  |  94 lines

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