随笔分类 -  C++

摘要:#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)
摘要:#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)
摘要:#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)
摘要:#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)
摘要:#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 阅读(160) 评论(0) 推荐(0)
摘要:#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 阅读(171) 评论(0) 推荐(0)
摘要:#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 阅读(138) 评论(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 阅读(214) 评论(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 阅读(107) 评论(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 阅读(108) 评论(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 阅读(121) 评论(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 阅读(126) 评论(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 阅读(151) 评论(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 阅读(163) 评论(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 阅读(159) 评论(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 阅读(132) 评论(0) 推荐(0)
摘要:#include #include using namespace std;class Product{public: virtual ~Product() {} virtual int Interface()=0;};class ConcreteProductA : public Pr... 阅读全文
posted @ 2014-12-06 06:49 stanley19861028 阅读(203) 评论(0) 推荐(0)
摘要:class Singleton{public: ~Singleton(); static Singleton* GetInstance();private: Singleton(); static Singleton* m_pInstance; static pthre... 阅读全文
posted @ 2014-12-05 10:16 stanley19861028 阅读(125) 评论(0) 推荐(0)