testbridge.cpp

来自「设计模式C++源码(other)Bridge.rar」· C++ 代码 · 共 35 行

CPP
35
字号
/** * testbridge.cpp */#include "bridge.h"void main(){	Abstraction* object = new Abstraction();	Implementor* implA = new ConcreteImplementorA();	Implementor* implB = new ConcreteImplementorB();	/**	 * Give the implmentor to the abstraction.	 */	object -> setImplementor( implA );	object -> operation();	/**	 * Change the implementor during runtime.	 */	object -> setImplementor( implB );	object -> operation();	/**	 * Clean-up.	 */	delete implA;	delete implB;	delete object;}

⌨️ 快捷键说明

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