?? bridge.h
字號(hào):
/** * bridge.h * Implemented by Blueprint Technologies, Inc. */#ifndef _bridge_h#define _bridge_h/** * Defines the interface for implementation classes. This * interface doesn't have to correspond exactly to Abstraction's * interface; in fact the two interfaces can be quite different. * Typically the Implementor interface provides only primitive * operations, and Abstraction defines higher-level operations * based on these primitives. */class Implementor{public: virtual void operationImp() = 0;};/** * Implements the Implementor interface and defines its * concrete implementation. */class ConcreteImplementorA: public Implementor{public: virtual void operationImp() { // Do something. };};/** * Implements the Implementor interface and defines its * concrete implementation. */class ConcreteImplementorB: public Implementor{public: virtual void operationImp() { // Do something. };};/** * Defines the abstraction's interface. Maintains a reference * to an object of type Implementor. */class Abstraction{private: Implementor* implementor;public: Abstraction(): implementor(0) { }; virtual void operation() { implementor -> operationImp(); }; void setImplementor( Implementor* implementor ) { this -> implementor = implementor; }; Implementor* getImplementor() { return implementor; };};/** * Extends the interface defined by Abstraction. */class RefinedAbstraction: public Abstraction{public: virtual void operation() { Abstraction::operation(); /** * new behavior here. */ };};#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -