home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / CLASSINC.PAK / VOIDP.H < prev   
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.1 KB  |  52 lines

  1. //----------------------------------------------------------------------------
  2. // Borland Class Library
  3. // Copyright (c) 1993, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   5.6  $
  6. //
  7. //----------------------------------------------------------------------------
  8. #if !defined(CLASSLIB_VOIDP_H)
  9. # define CLASSLIB_VOIDP_H
  10.  
  11. #if !defined( CLASSLIB_DEFS_H )
  12. # include <classlib/defs.h>
  13. #endif
  14.  
  15. #if defined( BI_CLASSLIB_NO_po )
  16. # pragma option -po-
  17. #endif
  18.  
  19. #if defined(BI_NAMESPACE)
  20. namespace ClassLib {
  21. #endif
  22.  
  23. class TVoidPointer
  24. {
  25.  
  26. public:
  27.  
  28.     TVoidPointer( const void *p = 0 ) : Ptr(p) {}
  29.     TVoidPointer( const TVoidPointer& rp ) : Ptr(rp.Ptr) {}
  30.  
  31.     const TVoidPointer& operator = ( const TVoidPointer& vp )
  32.         { Ptr = vp.Ptr; return *this; }
  33.     const TVoidPointer& operator = ( const void *p )
  34.         { Ptr = p; return *this; }
  35.     operator void *() const { return CONST_CAST(void *,Ptr); }
  36.  
  37. private:
  38.  
  39.     const void *Ptr;
  40.  
  41. };
  42.  
  43. #if defined(BI_NAMESPACE)
  44. }   // namespace ClassLib
  45. #endif
  46.  
  47. #if defined( BI_CLASSLIB_NO_po )
  48. # pragma option -po.
  49. #endif
  50.  
  51. #endif  // CLASSLIB_VOIDP_H
  52.