mirror of
https://github.com/huihut/interview.git
synced 2026-03-13 10:02:55 +08:00
添加设计模式及例子,包括:单例、抽象工厂、适配器、桥接、观察者模式
This commit is contained in:
20
DesignPattern/AdapterPattern/adaptee.h
Normal file
20
DesignPattern/AdapterPattern/adaptee.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// Created by xiemenghui on 2018/7/20.
|
||||
//
|
||||
|
||||
#ifndef DESIGNPATTERN_ADAPTEE_H
|
||||
#define DESIGNPATTERN_ADAPTEE_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// 自带的充电器(两脚扁型)
|
||||
class OwnCharger
|
||||
{
|
||||
public:
|
||||
void ChargeWithFeetFlat()
|
||||
{
|
||||
std::cout << "OwnCharger::ChargeWithFeetFlat\n";
|
||||
}
|
||||
};
|
||||
|
||||
#endif //DESIGNPATTERN_ADAPTEE_H
|
||||
Reference in New Issue
Block a user