⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 brige.h

📁 Factory,abstract Factory,Builder,Prototype,Singleton,Adapt,Bridge等20种常见的设计模式(含代码)
💻 H
字号:
/********************************************************************
	created:	2006/07/20
	filename: 	Brige.h
	author:		李创
                http://www.cppblog.com/converse/

	purpose:	Brige模式的演示代码
*********************************************************************/

#ifndef BRIDEG_H
#define BRIDEG_H

class Implementor;

// 维护一个Implementor类的指针
class Abstraction
{
public:
	Abstraction(Implementor* pImplementor);
	virtual ~Abstraction();

	void Operation();

protected:
	Implementor* m_pImplementor;
};

// 为实现Abstraction定义的抽象基类,定义了实现的接口函数
class Implementor
{
public:
	Implementor(){}
	virtual ~Implementor(){}

	virtual void OperationImpl() = 0;
};

// 继承自Implementor,是Implementor的不同实现之一
class ConcreateImplementorA
	: public Implementor
{
public:
	ConcreateImplementorA(){}
	virtual ~ConcreateImplementorA(){}

	virtual void OperationImpl();
};

// 继承自Implementor,是Implementor的不同实现之一
class ConcreateImplementorB
	: public Implementor
{
public:
	ConcreateImplementorB(){}
	virtual ~ConcreateImplementorB(){}

	virtual void OperationImpl();
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -