/////////////////////////////////////////////////////////////// // derived1.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 derived2.cpp // /////////////////////////////////////////////////////////////// #define IN_DLL #include #include "protocol.h" using namespace std; class derived1 : public protocol { public: int getInt() { cout << "\n retrieving value " << privData << " in derived1::getInt()"; cout.flush(); return privData; } void putInt(int i) { cout << "\n storing value " << i << " in derived1::putInt()"; cout.flush(); privData = i; } void kill() { cout << "\n calling protocol::kill()"; cout.flush(); delete this; } private: int privData; }; DLL_DECL protocol* protocol::make_d1() { cout << "\n calling protocal::make_d1()"; cout.flush(); return new derived1; }