home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tlx501.zip / TEMPLATE / POINTER.CPP < prev    next >
C/C++ Source or Header  |  1996-01-05  |  2KB  |  65 lines

  1. /****************************************************************************
  2.     $Id: pointer.cpp 501.0 1995/03/07 12:26:58 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 TLCountedPtr<T>.
  10.  
  11.     $Log: pointer.cpp $
  12.     Revision 501.0  1995/03/07 12:26:58  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.6  1995/01/31 16:30:44  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.5  1994/09/28  14:40:53  ron
  18.     Removed Macintosh-style #include references
  19.  
  20.     Revision 1.4  1994/09/27  20:27:16  ron
  21.     Changed path separator from / to \
  22.  
  23.     Revision 1.3  1994/09/26  15:31:35  ron
  24.     Renamed TLPointer<T> to TLCountedPtr<T>
  25.  
  26.     Revision 1.2  1994/09/06  14:15:50  ron
  27.     Adapted to change from TLRef to TLRefCount
  28.  
  29.     Revision 1.1  1994/08/16  18:15:26  ron
  30.     Initial revision
  31.  
  32. ****************************************************************************/
  33.  
  34. #ifndef _TLX_POINTER_CPP
  35. #define _TLX_POINTER_CPP
  36.  
  37. //----- Project headers
  38.  
  39. #ifndef _TLX_REFPTR_H
  40. #include <tlx\501\refcnt.h>
  41. #endif
  42.  
  43. /*-------------------------------------------------------------------------*/
  44.     template<class T> TLCountedPtr<T>::TLCountedPtr()
  45.  
  46. /*  Default constructor. Relies on the default constructor inherited
  47.     from class TLRefPtr. We need to provide it, though, because the
  48.     compiler will not generate a default constructor in the presence
  49.     of other explicitly declared constructors.
  50. ---------------------------------------------------------------------------*/
  51. : TLRefPtr()    // Superfluous really
  52. {
  53. }
  54.  
  55. /*-------------------------------------------------------------------------*/
  56.     template<class T> TLCountedPtr<T>::TLCountedPtr(T *aPtr)
  57.  
  58. /*  Constructor that provides conversion from ordinary T pointers.
  59. ---------------------------------------------------------------------------*/
  60. : TLRefPtr(aPtr)
  61. {
  62. }
  63.  
  64. #endif    // _TLX_POINTER_CPP
  65.