?? context.h
字號:
//Context.h
#ifndef _CONTEXT_H_
#define _CONTEXT_H_
class Strategy;
/*這個類是Strategy模式的關鍵,也是Strategy模式和Template模式的根本
區別所在。 *Strategy通過“組合”(委托)方式實現算法(實現)的異構,
而Template模式則采取的是繼承的方式 *這兩個模式的區別也是繼承和組合
兩種實現接口重用的方式的區別 */
class Context
{
public:
Context(Strategy* stg);
~Context();
void DoAction();
protected:
private:
Strategy* _stg;
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -