SIGN IN SIGN UP
huihut / interview UNCLAIMED

📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.

0 0 18 C++
//
// Created by xiemenghui on 2018/7/20.
//
#include "Factory.h"
#include "concrete_factory.h"
Factory* Factory::CreateFactory(FACTORY_TYPE factory)
{
Factory *pFactory = nullptr;
switch (factory) {
case FACTORY_TYPE::BENZ_FACTORY: // Benz factory
pFactory = new BenzFactory();
break;
case FACTORY_TYPE::BMW_FACTORY: // BMW factory
pFactory = new BmwFactory();
break;
case FACTORY_TYPE::AUDI_FACTORY: // Audi factory
pFactory = new AudiFactory();
break;
default:
break;
}
return pFactory;
}