home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / WCLCOM.H < prev    next >
C/C++ Source or Header  |  1996-07-24  |  2KB  |  75 lines

  1. //
  2. //  wclcom.h    Definitions for some common list classes used by
  3. //              the WATCOM Container List Classes
  4. //
  5. //  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  6. //
  7. #ifndef _WCLCOM_H_INCLUDED
  8. #define _WCLCOM_H_INCLUDED
  9.  
  10. #ifndef __cplusplus
  11. #error wclcom.h is for use with C++
  12. #endif
  13.  
  14.  
  15. //
  16. //  The techniques for specifying the list classes are from
  17. //  'The C++ Programming Language', 2nd Edition, Bjarne Stroustrup.
  18. //
  19.  
  20.  
  21.  
  22.  
  23. //
  24. //  The WCSLink class is used as a basis for manipulating a number of
  25. //  different containers.  In an intrusive container, this class provides
  26. //  the base for the user defined class of single linked lists.
  27. //
  28. //  This class is intended to be a base class.  Objects of this type should
  29. //  not be created.
  30. //
  31. //  constructor: set the 'next' link field to 0 (will be reset when inserted
  32. //         into the list).
  33. //  destructor: nothing needs to be explicitly destroyed in WCSLink.
  34. //        It is not virtual, to save the size cost of storing a virtual
  35. //        table pointer in every node.
  36. //
  37.  
  38. class WCSLink {
  39. public:
  40.     WCSLink *       link;
  41.  
  42.     inline WCSLink() : link( 0 ) {};
  43.     inline ~WCSLink() {};
  44. };
  45.  
  46.  
  47.  
  48.  
  49. //
  50. //  The WCDLink class is used as a basis for manipulating a number of
  51. //  different containers.  In an intrusive container, this class provides
  52. //  the base for the user defined class of double linked lists.  The
  53. //  WCSLink class is used as a base for this class.
  54. //
  55. //  This class is intended to be a base class.  Objects of this type should
  56. //  not be created.
  57. //
  58. //  constructor: the 'prev' link field is set up by the WCSLink constructor.
  59. //  destructor: nothing needs to be explicitly destroyed in WCDLink.
  60. //        It is not virtual, to save the size cost of storing a virtual
  61. //        table pointer in every node.
  62. //
  63.  
  64. class WCDLink : public WCSLink {
  65. public:
  66.     WCSLink         prev;
  67.  
  68.  
  69.     inline WCDLink() {};
  70.     inline ~WCDLink() {};
  71. };
  72.  
  73.  
  74. #endif
  75.