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

  1. /****************************************************************************
  2.     $Id: safeptr.cpp 501.0 1995/03/07 12:27:00 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 TLSafePointer<T>.
  10.  
  11.     $Log: safeptr.cpp $
  12.     Revision 501.0  1995/03/07 12:27:00  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.6  1995/01/31 16:30:48  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.5  1994/09/28  14:41:46  ron
  18.     Removed Macintosh-style #include references
  19.  
  20.     Revision 1.4  1994/09/27  20:27:31  ron
  21.     Changed path separator from / to \
  22.  
  23.     Revision 1.3  1994/09/26  15:34:08  ron
  24.     Changed include file references
  25.  
  26.     Revision 1.2  1994/09/06  14:16:07  ron
  27.     adapted to change from TLRef to TLRefCount
  28.  
  29.     Revision 1.1  1994/08/16  18:15:31  ron
  30.     Initial revision
  31.  
  32. ****************************************************************************/
  33.  
  34. #ifndef _TLX_SAFEPTR_CPP
  35. #define _TLX_SAFEPTR_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> TLSafePointer<T>::TLSafePointer()
  45.  
  46. /*  Default constructor. Relies on the default constructor inherited
  47.     from class TLRefHnd. 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. : TLRefHnd()    // Superfluous really
  52. {
  53. }
  54.  
  55. /*-------------------------------------------------------------------------*/
  56.     template<class T> TLSafePointer<T>::TLSafePointer(T *aPtr)
  57.  
  58. /*  Constructor that provides conversion from ordinary T pointers.
  59. ---------------------------------------------------------------------------*/
  60. : TLRefHnd(aPtr)
  61. {
  62. }
  63.  
  64. #endif    // _TLX_SAFEPTR_CPP
  65.