home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / ivbase.hp_ / IVBASE.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  3.8 KB  |  72 lines

  1. #ifndef _IVBASE_
  2. #define _IVBASE_
  3. /*******************************************************************************
  4. * FILE NAME: ivbase.hpp                                                        *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IVBase - Empty "virtual base" class to provide generic functions to      *
  9. *              all library classes with virtual functions (e.g., virual dtor). *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   Licensed Materials - Property of IBM                                       *
  13. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  14. *   All Rights Reserved                                                        *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *$Log:   R:/IBMCLASS/IBASE/VCS/IVBASE.HPV  $                                                                         *
  19. //
  20. //   Rev 1.2   25 Oct 1992 16:46:48   nunn
  21. //changed library name to ICLUI
  22.    
  23.       Rev 1.1   13 Oct 1992 09:58:18   law
  24.    Removed virtual inheritance from IBase.
  25.    
  26.       Rev 1.0   12 Oct 1992 12:54:38   law
  27.    Initial revision.
  28. *******************************************************************************/
  29. #ifndef _IBASE_
  30.   #include <ibase.hpp>
  31. #endif
  32.  
  33. class IVBase : public IBase {
  34. /*******************************************************************************
  35. * This class provides basic generic behavior for all the library classes that  *
  36. * have virtual functions.  In addition, it gives derived classes the ability   *
  37. * to exploit the nested type/value names in IBase (i.e, Boolean, true, false). *
  38. *                                                                              *
  39. * Derived classes are expected to override the virtual functions asString and  *
  40. * asDebugInfo.  Note that this will enable automatic support for outputting    *
  41. * derived class objects on ostreams (cout and/or cerr, etc.).                  *
  42. *******************************************************************************/
  43. public:
  44. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  45. | This class provides a virtual destructor to ensure that all derived          |
  46. | classes' destructors are also virtual.                                       |
  47. ------------------------------------------------------------------------------*/
  48. virtual
  49.   ~IVBase ( );
  50.  
  51. /*------------------------------- DIAGNOSTICS ----------------------------------
  52. | A left-shift (<<) operator is defined permitting any library object to be    |
  53. | dumped to an ostream (e.g.,  cout << anObject;).  This hides the equivalent  |
  54. | function that accepts an IBase.  IVBase has the luxury of being able to      |
  55. | fully implement this function by invoking the virtual function asString()    |
  56. | to obtain the data to output to the ostream.                                 |
  57. |                                                                              |
  58. | The related functions asString and asDebugInfo should be reimplemented in    |
  59. | derived classes to return informatin specific to the subclass.               |
  60. ------------------------------------------------------------------------------*/
  61. friend ostream
  62.  &operator << ( ostream      &aStream,
  63.                 const IVBase &anObject );
  64.  
  65. virtual IString
  66.   asString    ( ) const,
  67.   asDebugInfo ( ) const;
  68.  
  69. }; // IVBase
  70.  
  71. #endif /* _IVBASE_ */
  72.