/////////////////////////////////////////////////////////////// // derived2.cpp - provides part of protocol implementation // // ver 1.1 // // // // The declarations in this file are not visible to client, // // who has access only to the protocol header file and // // dynamic-link library resulting from building this file // // along with derived1.cpp // /////////////////////////////////////////////////////////////// #define IN_DLL #include #include "protocol.h" using namespace std; class derived2 : public protocol { public: int getInt() { cout << "\n retrieving value " << privData << " in derived2::getInt()"; cout.flush(); return privData; } void putInt(int i) { cout << "\n storing value " << i << " in derived2::putInt()"; cout.flush(); privData = i; } void kill() { cout << "\n calling protocol::kill()"; cout.flush(); delete this; } private: int privData; }; DLL_DECL protocol* protocol::make_d2() { cout << "\n calling protocal::make_d2()"; cout.flush(); return new derived2; }