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 / LSTELEM.H < prev    next >
C/C++ Source or Header  |  1990-09-26  |  2KB  |  92 lines

  1. #ifndef __LSTELEM_H
  2. #define __LSTELEM_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 Scotts Valley Dr.
  11. // Scotts Valley, CA 95066
  12. // (408) 438-8400
  13. //
  14.  
  15. // Contents ----------------------------------------------------------------
  16. //
  17. //      ListElement
  18. //
  19. // Description
  20. //
  21. //      Defines the class ListElement.  ListElements are used in objects
  22. //      which link other objects together and nowhere else.
  23. //
  24. // End ---------------------------------------------------------------------
  25.  
  26. // Interface Dependencies ---------------------------------------------------
  27.  
  28. #ifndef __IOSTREAM_H
  29. #include <iostream.h>
  30. #define __IOSTREAM_H
  31. #endif
  32.  
  33. #ifndef __CLSTYPES_H
  34. #include "clstypes.h"
  35. #endif
  36.  
  37. #ifndef __OBJECT_H
  38. #include "object.h"
  39. #endif
  40.  
  41. // End Interface Dependencies ------------------------------------------------
  42.  
  43. // Class //
  44.  
  45. class ListElement
  46. {
  47. public:
  48.             ListElement( Object *o ) { data = o; next = 0; }
  49.             ~ListElement() { delete data; }
  50.  
  51. private:
  52.             ListElement *next;
  53.             Object      *data;
  54.     friend class List;
  55.     friend class ListIterator;
  56. };
  57.  
  58. // Description -------------------------------------------------------------
  59. //
  60. //     Defines the abstract class ListElement. 
  61. //
  62. //     ListElement objects, i.e. objects instantiated of classes derived from
  63. //     ListElement, are used in sequences where insertions and deletions
  64. //     are defined.
  65. //
  66. // Public Members
  67. //
  68. //  none
  69. //
  70. // Private Members
  71. //
  72. //     next
  73. //
  74. //     Pointer to the next list element.
  75. //
  76. //     data
  77. //
  78. //     Pointer to the list element's data.
  79. //
  80. // Friends
  81. //
  82. //     class List
  83. //
  84. //     The class which uses class ListElement, class List, is declared
  85. //     as a friend.
  86. //
  87. // End ---------------------------------------------------------------------
  88.  
  89.  
  90. #endif // ifndef __LSTELEM_H //
  91.  
  92.