home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / code / kdbf / bdbobjec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-19  |  1018 b   |  43 lines

  1. /*********************************************************************
  2. **
  3. **                          BDBOBJECT.H
  4. **
  5. ** This file contains the definitions of the interface for the BDbObject
  6. ** class. This Abstract class is the root of all Database Framework
  7. ** classes and defines basic routines for object identification and 
  8. ** printing.    
  9. **
  10. *********************************************************************/
  11.  
  12. // DBF - (C) Copyright 1994 by Borland International
  13.  
  14. #ifndef BDBOBJECT_H
  15. #define BDBOBJECT_H
  16.  
  17. #include "envdef.h"
  18. #include <iostream.h>
  19.  
  20. class BDbObject {
  21.  
  22. public:
  23.  
  24.   // Pure virtual function that returns the name of the class.
  25.  
  26.   virtual char *nameOf() const = 0;
  27.  
  28.   // Pure virtual function that defines a basic printing routine. 
  29.  
  30.   virtual void printOn( ostream& os) = 0;
  31.  
  32.   friend ostream& operator << ( ostream&, const BDbObject& );
  33. };
  34.  
  35. inline ostream& operator << ( ostream& out, BDbObject& obj )
  36. {
  37.     obj.printOn(out);
  38.     return out;
  39. }
  40.  
  41. #endif
  42.  
  43.