标签:style blog io ar color os sp on div
#include <iostream> using namespace std; class ThirdPartImpl { public: void SomeFunction() { cout<<"ThirdPartImpl::SomeFunction"<<endl; } }; class Target { public: virtual void SomeRequest()=0; }; class Adapter : public Target { public: Adapter() { m_pImpl = new ThirdPartImpl; } ~Adapter() { delete m_pImpl; } void SomeRequest() { m_pImpl->SomeFunction(); } private: ThirdPartImpl* m_pImpl; }; int main(int argc, char *argv[]) { Target* pTarget = new Adapter; pTarget->SomeRequest(); delete pTarget; pTarget = NULL; return 0; }
标签:style blog io ar color os sp on div
原文地址:http://www.cnblogs.com/stanley198610281217/p/4155363.html