/////////////////////////////////////////////////////////////////////////// // derived2.cpp - provides protocol details for derived2 class // // // // this file is not visible to client, who has access only to the // // compiled derived1.dll and protocol header file // // // // Jim Fawcett, CSE 791 - Distributed Objects, Demonstration // /////////////////////////////////////////////////////////////////////////// #include #include #include "protocol.h" using namespace std; class derived2 : public protocol { public: int getInt() { cout << " calling derived2::getInt()\n"; return 0; } void putInt(int) { cout << " calling derived2::putInt()\n"; } string passVal(string s) { s += ": a copy inside derived2"; return s; } string passRef(string &s) { s += ": a reference inside derived2"; return s; } }; protocol* protocol::make_d2() { cout << " calling protocal::make_d2()\n"; return new derived2; }