home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ssvpar.zip / SSREF.HPP < prev    next >
Text File  |  1994-11-13  |  2KB  |  50 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.                Copyright (c) 1994 SandStone Software Inc.
  4.                           All rights reserved
  5.  
  6. ----------------------------------------------------------------------------*/
  7. #if !defined( SSREF)
  8. #  define SSREF
  9. #  include<ssglobal.h>
  10.  
  11. #  define SSRefMsgCount "SSRef0001e: Reference count less than zero"
  12.  
  13.    class SSRefCount
  14.       {
  15.       public:
  16.          SSConstr             SSRefCount( void);
  17.  
  18.          virtual void         refInc( void);
  19.          virtual void         refFree( void) = 0;
  20.          virtual void         refDec( SSBooleanValue = SSTrue);
  21.  
  22.       protected:
  23.          SSSigned32           olCount;
  24.       };
  25.  
  26.    template< class T> class SSRef
  27.       {
  28.       public:
  29.          SSInline SSConstr             SSRef( T*);
  30.          SSInline SSConstr             SSRef( T&);
  31.          SSInline SSConstr             SSRef( void);
  32.          SSInline SSConstr             SSRef( SSRef< T>&);
  33.  
  34.          SSInline SSRef< T>&           operator=( T*);
  35.          SSInline SSRef< T>&           operator=( T&);
  36.          SSInline T&                   operator*( void);
  37.          SSInline T*                   operator->( void);
  38.          SSInline                      operator T*( void);
  39.          SSInline SSRef< T>&           operator=( SSRef< T>&);
  40.  
  41.          SSInline SSDestr              SSRef( void);
  42.  
  43.       protected:
  44.          T*                            opType;
  45.       };
  46.  
  47. #  include<ssref.inl>
  48.  
  49. #endif
  50.