home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tlx501.zip / SRC / SLINK.CPP < prev    next >
C/C++ Source or Header  |  1996-07-08  |  3KB  |  108 lines

  1. /****************************************************************************
  2.     $Id: slink.cpp 501.0 1995/03/07 12:26:22 RON Exp $
  3.  
  4.     Copyright (c) 1991-95 Tarma Software Research. All rights reserved.
  5.  
  6.     Project:    Tarma Library for C++ V5.0
  7.     Author:    Ron van der Wal
  8.  
  9.     Implementation of class TLSLink. This class represents an element in the
  10.     various list structures. Its member functions are geared towards linear
  11.     list implementations, so a circular list implementation must take some
  12.     extra care.
  13.  
  14.     $Log: slink.cpp $
  15.     Revision 501.0  1995/03/07 12:26:22  RON
  16.     Updated for TLX 5.01
  17.     Revision 1.8  1995/01/31 16:30:24  RON
  18.     Update for release 012
  19.     Added partial support for SunPro C++ compiler
  20.     Revision 1.7  1995/01/06  15:58:20  ron
  21.     Corrected Revision keyword
  22.  
  23.     Revision 1.6  1994/11/16  15:43:05  ron
  24.     Added module info; rearranged #include directives
  25.  
  26.     Revision 1.5  1994/09/28  14:46:25  ron
  27.     Removed Macintosh-style #include references
  28.  
  29.     Revision 1.4  1994/09/28  14:21:48  ron
  30.     Changed an incorrect assumption which caused an assertion failure
  31.     in Append()
  32.  
  33.     Revision 1.3  1994/09/27  20:23:01  ron
  34.     Changed path separator from / to \
  35.  
  36.     Revision 1.2  1994/09/26  15:47:32  ron
  37.     Changed include file references
  38.  
  39.     Revision 1.1  1994/08/16  18:13:13  ron
  40.     Initial revision
  41.  
  42. ****************************************************************************/
  43.  
  44. #include <tlx\501\_build.h>
  45.  
  46. TLX_MODULE_INFO("$Revision: 501.0 $");
  47.  
  48. #include <tlx\501\slists.h>        // Class declaration
  49.  
  50. /*-------------------------------------------------------------------------*/
  51.     TLSLink::TLSLink()
  52.  
  53. /*  Default constructor. Sets link field to 0.
  54. ---------------------------------------------------------------------------*/
  55. : mNext(0)
  56. {
  57. }
  58.  
  59. /*-------------------------------------------------------------------------*/
  60.     TLSLink::TLSLink(const TLSLink &)
  61.  
  62. /*  Copy constructor. Does not copy the link field, but sets it to 0.
  63. ---------------------------------------------------------------------------*/
  64. : mNext(0)
  65. {
  66. }
  67.  
  68. /*-------------------------------------------------------------------------*/
  69.     TLSLink::~TLSLink()
  70.  
  71. /*  Destructor. In the debugging version, it checks that it is unlinked.
  72. ---------------------------------------------------------------------------*/
  73. {
  74.     TLX_ASSERT_NULL(mNext);
  75. }
  76.  
  77. /*-------------------------------------------------------------------------*/
  78.     void TLSLink::Append(TLSLink *aLink)
  79.  
  80. /*  Inserts 'aLink' after the current TLSLink. The current TLSLink must not
  81.     be part of a chain. It is an error to pass a 0 pointer.
  82. ---------------------------------------------------------------------------*/
  83. {
  84.     TLX_ASSERT_PTR(aLink);
  85.     TLX_ASSERT_NULL(mNext);
  86.  
  87.     mNext = aLink;
  88. }
  89.  
  90. /*-------------------------------------------------------------------------*/
  91.     TLSLink &TLSLink::operator =(const TLSLink &)
  92.  
  93. /*  Overloading of the assignment operator. Does not copy the link fields.
  94. ---------------------------------------------------------------------------*/
  95. {
  96.     return *this;
  97. }
  98.  
  99. /*-------------------------------------------------------------------------*/
  100.     void TLSLink::Unlink()
  101.  
  102. /*  Removes the current TLSLink from the list of which it is part.
  103. ---------------------------------------------------------------------------*/
  104. {
  105.     mNext = 0;
  106. }
  107.  
  108.