随笔分类 -  设计模式

摘要:#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)
摘要:#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 阅读(129) 评论(0) 推荐(0)
摘要:#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 阅读(152) 评论(0) 推荐(0)
摘要:#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)