21 static std::map<std::string, std::unique_ptr<IMemoryOptimizerStrategyFactory>>& GetStrategyFactories()
23 static std::map<std::string, std::unique_ptr<IMemoryOptimizerStrategyFactory>> strategies;
25 if (strategies.size() == 0)
27 strategies[
"ConstantMemoryStrategy"] = std::make_unique<StrategyFactory<ConstantMemoryStrategy>>();
28 strategies[
"SingleAxisPriorityList"] = std::make_unique<StrategyFactory<SingleAxisPriorityList>>();
29 strategies[
"StrategyValidator"] = std::make_unique<StrategyFactory<StrategyValidator>>();
38 const auto& strategyFactoryMap = GetStrategyFactories();
39 auto strategyFactory = strategyFactoryMap.find(strategyName);
40 if (strategyFactory != GetStrategyFactories().end())
42 return strategyFactory->second->CreateMemoryOptimizerStrategy();
49 const auto& strategyFactoryMap = GetStrategyFactories();
50 std::vector<std::string> strategyNames;
51 for (
const auto& strategyFactory : strategyFactoryMap)
53 strategyNames.emplace_back(strategyFactory.first);