EnginePtr EngineFactory::create(const std::string& type, const Config& cfg) { if (type == "threephase") { return EnginePtr(new ThreephaseEngine(cfg)); } throw std::invalid_argument("Cannot intantiate Engine of type " + type); }
/** Singleton management */ EnginePtr create() { GPGPU_ASSERT(theEngine.isNull(), "GPGPU engine was already created"); theEngine = EnginePtr(new GLEngine()); return theEngine; }