mirror of
https://github.com/huihut/interview.git
synced 2025-12-18 21:14:38 +03:00
添加设计模式及例子,包括:单例、抽象工厂、适配器、桥接、观察者模式
This commit is contained in:
21
DesignPattern/AdapterPattern/AdapterMain.h
Normal file
21
DesignPattern/AdapterPattern/AdapterMain.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by xiemenghui on 2018/7/20.
|
||||
//
|
||||
|
||||
#ifndef DESIGNPATTERN_ADAPTERMAIN_H
|
||||
#define DESIGNPATTERN_ADAPTERMAIN_H
|
||||
|
||||
#include "adapter.h"
|
||||
|
||||
void AdapterMain()
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IRussiaSocket * pAdapter = new PowerAdapter();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>
|
||||
pAdapter->Charge();
|
||||
|
||||
SAFE_DELETE(pAdapter);
|
||||
}
|
||||
|
||||
#endif //DESIGNPATTERN_ADAPTERMAIN_H
|
||||
Reference in New Issue
Block a user