会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
stanley19861028
博客园
首页
新随笔
联系
订阅
管理
2014年12月23日
Interpreter
摘要: #include #include #include using namespace std;stack g_stack;class Context{public: void SetExpression(string sExpr) { m_sExpr = sExpr; } string ...
阅读全文
posted @ 2014-12-23 09:57 stanley19861028
阅读(332)
评论(0)
推荐(0)
2014年12月22日
Iterator
摘要: #include using namespace std;template class Iterator{public: T& Value() { return *m_pValue; } Iterator& operator=(const Iterator& other) { ...
阅读全文
posted @ 2014-12-22 14:12 stanley19861028
阅读(121)
评论(0)
推荐(0)
2014年12月19日
Memento
摘要: #include #include using namespace std;class Memento{public: Memento(string sState) { m_sState = sState; } string GetState() { return m_sStat...
阅读全文
posted @ 2014-12-19 12:20 stanley19861028
阅读(139)
评论(0)
推荐(0)
Mediator
摘要: #include using namespace std;class ObjectA{public: void Whoami() { coutWhoami(); m_pObjectB->Whoami(); } void Interact2() { m_pObjectB->Whoami()...
阅读全文
posted @ 2014-12-19 09:29 stanley19861028
阅读(142)
评论(0)
推荐(0)
2014年12月18日
Visitor
摘要: #include #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Element;class Visitor{public: virtual ...
阅读全文
posted @ 2014-12-18 16:54 stanley19861028
阅读(151)
评论(0)
推荐(0)
2014年12月17日
Command
摘要: #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Receiver{public: void Action1() { coutAction1()...
阅读全文
posted @ 2014-12-17 12:02 stanley19861028
阅读(125)
评论(0)
推荐(0)
2014年12月16日
ChainOfResponsibility
摘要: #include using namespace std;class Chain{public: bool Handle() { return false; }};class Level1 : public Chain{public: bool Handle() { ...
阅读全文
posted @ 2014-12-16 16:42 stanley19861028
阅读(99)
评论(0)
推荐(0)
State
摘要: #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Context;class DbState{public: DbState(Context* ...
阅读全文
posted @ 2014-12-16 12:03 stanley19861028
阅读(158)
评论(0)
推荐(0)
2014年12月15日
Observer
摘要: #include #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Observer{public: virtual void Update(s...
阅读全文
posted @ 2014-12-15 11:52 stanley19861028
阅读(170)
评论(0)
推荐(0)
Template_Method
摘要: #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class TemplateMethod{public: void AlgorithmA() { Step...
阅读全文
posted @ 2014-12-15 09:55 stanley19861028
阅读(175)
评论(0)
推荐(0)
下一页
公告