home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IVBASE.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
4KB
|
78 lines
#ifndef _IVBASE_
#define _IVBASE_
/*******************************************************************************
* FILE NAME: ivbase.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IVBase - Empty "virtual base" class to provide generic functions to *
* all library classes with virtual functions (e.g., virual dtor). *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _IBASE_
#include <ibase.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class ostream;
class IString;
class IVBase : public IBase {
/*******************************************************************************
* The IVBase class provides basic generic behavior for all the library *
* classes that have virtual functions. In addition, it allows derived *
* classes to exploit the nested type and value names in the IBase class, such *
* as Boolean, true, and false. *
* *
* Derived classes are expected to override the virtual functions asString and *
* asDebugInfo. This will enable automatic support for the output of derived *
* class objects on ostreams, such as cout, cerr, or both. *
*******************************************************************************/
public:
/*------------------------ Destructor ------------------------------------------
| This class provides a virtual destructor to ensure that all derived |
| classes' destructors are also virtual. |
------------------------------------------------------------------------------*/
virtual
~IVBase ( );
/*------------------------------- Diagnostics ----------------------------------
| The following functions are defined for diagostic purposes: |
| |
| operator << - A left-shift operator that permits any library object to be |
| dumped to an ostream, such as: |
| |
| cout << anObject; |
| |
| asString - Obtains the standard version of an object's contents. |
| asDebugInfo - Obtains the diagnostic version of an object's contents. |
------------------------------------------------------------------------------*/
friend ostream
&operator << ( ostream &aStream,
const IVBase &anObject );
virtual IString
asString ( ) const,
asDebugInfo ( ) const;
}; // IVBase
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _IVBASE_ */