| 78 | } |
| 79 | |
| 80 | IObject* FactoryManager::createObject(std::string_view _category, std::string_view _type) |
| 81 | { |
| 82 | MapRegisterFactoryItem::iterator category = mRegisterFactoryItems.find(_category); |
| 83 | if (category == mRegisterFactoryItems.end()) |
| 84 | { |
| 85 | return nullptr; |
| 86 | } |
| 87 | |
| 88 | std::string_view typeName = BackwardCompatibility::getFactoryRename(_category, _type); |
| 89 | MapFactoryItem::iterator type = category->second.find(typeName); |
| 90 | if (type == category->second.end()) |
| 91 | { |
| 92 | return nullptr; |
| 93 | } |
| 94 | if (type->second.empty()) |
| 95 | { |
| 96 | return nullptr; |
| 97 | } |
| 98 | |
| 99 | IObject* result = nullptr; |
| 100 | type->second(result); |
| 101 | return result; |
| 102 | } |
| 103 | |
| 104 | void FactoryManager::destroyObject(IObject* _object) |
| 105 | { |
no test coverage detected