摘要: #include #include using namespace std;#define SHARE_FLAG string#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Flyweight{public... 阅读全文
posted @ 2014-12-12 13:10 stanley19861028 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;#define DO_NOTHING()#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Component{ friend ... 阅读全文
posted @ 2014-12-12 10:29 stanley19861028 阅读(207) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; } class Product{public: virtual void Action()=0;};clas... 阅读全文
posted @ 2014-12-11 11:08 stanley19861028 阅读(102) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class Product{public: virtual ~Product() {} virtual void Action()=0;};class ConcreteProduct : public Product{public... 阅读全文
posted @ 2014-12-11 09:31 stanley19861028 阅读(105) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class ThirdPartImpl{public: void SomeFunction() { coutSomeFunction(); } private: ThirdPartImpl* m_pImpl;};int ma... 阅读全文
posted @ 2014-12-10 14:25 stanley19861028 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class GtkSystem{public: void Init(int argc, char** argv); int EventLoop() { coutEventLoop();}void GuiFacade::Logger... 阅读全文
posted @ 2014-12-10 09:35 stanley19861028 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;#define DESTORY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }#define STATUS int#define BUFSIZE 512class Prot... 阅读全文
posted @ 2014-12-09 13:49 stanley19861028 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;#define DESTROY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class Builder{public: virtual ~Builder() {} virtua... 阅读全文
posted @ 2014-12-09 11:12 stanley19861028 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;#define DESTORY_POINTER(ptr) if (ptr) { delete ptr; ptr = NULL; }class ProductFamilyA{public: virtual ~ProductFamilyA(... 阅读全文
posted @ 2014-12-08 17:13 stanley19861028 阅读(157) 评论(0) 推荐(0) 编辑
摘要: class Product{public: virtual ~Product() {} virtual void DoSomething()=0;};class ProductA : public Product{public: ProductA() {} ~ProductA... 阅读全文
posted @ 2014-12-08 11:55 stanley19861028 阅读(127) 评论(0) 推荐(0) 编辑