classadapter.h

来自「设计模式C++源码(other)AdapterClass.rar」· C头文件 代码 · 共 52 行

H
52
字号
/** * classadapter.h * Implemented by Blueprint Technologies, Inc. */#ifndef _classadapter_h#define _classadapter_h/** * Defines a domain-specific interface that Client uses. */class Target{public:	virtual void request() = 0;};/** * Defines an existing interface that needs adapting. */class Adaptee{public:	void specificRequest()	{		/**		 * Do something.		 */	};};/** * Adapts the interface of Adaptee to the Target interface. */class Adapter: public Target, public Adaptee{public:	virtual void request()	{		specificRequest();	}};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?