#include "stdafx.h"
#include <iostream>
class Adaptee
{
public:
void Request()
{
std::cout << "实际要使用的类方法!" << std::endl;
}
};
class Target
{
public:
virtual ~Target(){}
virtual void Operator() = 0;
};
class Adapter :public Target
{
private:
Adaptee* m_Adaptee = new Adaptee();
public:
virtual void Operator()
{
m_Adaptee->Request();
}
};// AdapterPattern.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Adapter.h"
int _tmain(int argc, _TCHAR* argv[])
{
Target* target = new Adapter();
target->Operator();
getchar();
return 0;
}
Java 并发专题 : Executor详细介绍 打造基于Executor的Web服务器,布布扣,bubuko.com
Java 并发专题 : Executor详细介绍 打造基于Executor的Web服务器
原文:http://blog.csdn.net/lmj623565791/article/details/26938985