2011年5月27日

Chain of Responsibility (C++实现)

摘要: // Chain of Responsibility.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;typedef int Topic;class Handler{public: Handler(Handler* h= 0, Topic t=-1):successor(h),topic(t) { }virtual ~Handler(){}virtual void HandleRequest(Topic t)=0;protected: Handler 阅读全文

posted @ 2011-05-27 18:36 IT@民工 阅读(112) 评论(0) 推荐(0) 编辑

Proxy (C++实现)

摘要: // Proxy.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>using namespace std;class Subject{public:Subject(){}virtual ~Subject(){}virtual void Request()=0;};class RealSubject:public Subject{public:RealSubject(){cout<<"Construction of RealSubject"<<end 阅读全文

posted @ 2011-05-27 08:32 IT@民工 阅读(178) 评论(0) 推荐(0) 编辑

导航