home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C22 / Vendor.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  835 b   |  51 lines

  1. //: C22:Vendor.cpp {O}
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Implementation of VENDOR.H
  7. // This is compiled and unavailable to you
  8. #include "Vendor.h"
  9. #include <fstream>
  10. using namespace std;
  11.  
  12. extern ofstream out; // For trace info
  13.  
  14. void Vendor::v() const {
  15.   out << "Vendor::v()\n";
  16. }
  17.  
  18. void Vendor::f() const {
  19.   out << "Vendor::f()\n";
  20. }
  21.  
  22. Vendor::~Vendor() {
  23.   out << "~Vendor()\n";
  24. }
  25.  
  26. void Vendor1::v() const {
  27.   out << "Vendor1::v()\n";
  28. }
  29.  
  30. void Vendor1::f() const {
  31.   out << "Vendor1::f()\n";
  32. }
  33.  
  34. Vendor1::~Vendor1() {
  35.   out << "~Vendor1()\n";
  36. }
  37.  
  38. void A(const Vendor& V) {
  39.   // ...
  40.   V.v();
  41.   V.f();
  42.   //..
  43. }
  44.  
  45. void B(const Vendor& V) {
  46.   // ...
  47.   V.v();
  48.   V.f();
  49.   //..
  50. } ///:~
  51.