home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IVBASE.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  4KB  |  78 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. *******************************************************************************/
  19. #ifndef _IBASE_
  20.   #include <ibase.hpp>
  21. #endif
  22.  
  23. /*----------------------------------------------------------------------------*/
  24. /* Align classes on four byte boundary.                                       */
  25. /*----------------------------------------------------------------------------*/
  26. #pragma pack(4)
  27.  
  28. class ostream;
  29.  
  30. class IString;
  31.  
  32. class IVBase : public IBase {
  33. /*******************************************************************************
  34. * The IVBase class provides basic generic behavior for all the library         *
  35. * classes that have virtual functions.  In addition, it allows derived         *
  36. * classes to exploit the nested type and value names in the IBase class, such  *
  37. * as Boolean, true, and false.                                                 *
  38. *                                                                              *
  39. * Derived classes are expected to override the virtual functions asString and  *
  40. * asDebugInfo.  This will enable automatic support for the output of derived   *
  41. * class objects on ostreams, such as cout, cerr, or both.                      *
  42. *******************************************************************************/
  43. public:
  44. /*------------------------ Destructor ------------------------------------------
  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. | The following functions are defined for diagostic purposes:                  |
  53. |                                                                              |
  54. |   operator << - A left-shift operator that permits any library object to be  |
  55. |                 dumped to an ostream, such as:                               |
  56. |                                                                              |
  57. |                   cout << anObject;                                          |
  58. |                                                                              |
  59. |   asString    - Obtains the standard version of an object's contents.        |
  60. |   asDebugInfo - Obtains the diagnostic version of an object's contents.      |
  61. ------------------------------------------------------------------------------*/
  62. friend ostream
  63.  &operator << ( ostream      &aStream,
  64.                 const IVBase &anObject );
  65.  
  66. virtual IString
  67.   asString    ( ) const,
  68.   asDebugInfo ( ) const;
  69.  
  70. }; // IVBase
  71.  
  72. /*----------------------------------------------------------------------------*/
  73. /* Resume compiler default packing.                                           */
  74. /*----------------------------------------------------------------------------*/
  75. #pragma pack()
  76.  
  77. #endif /* _IVBASE_ */
  78.