Update Ghoul repository to have the factory return unique_ptrs

Adjust accordingly
This commit is contained in:
Alexander Bock
2017-03-01 22:03:48 -05:00
parent 2b07cf8c05
commit 2f2fa3b031
26 changed files with 69 additions and 52 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ documentation::Documentation PlanetGeometry::Documentation() {
};
}
PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary)
std::unique_ptr<PlanetGeometry> PlanetGeometry::createFromDictionary(const ghoul::Dictionary& dictionary)
{
documentation::testSpecificationAndThrow(
Documentation(),
@@ -64,7 +64,7 @@ PlanetGeometry* PlanetGeometry::createFromDictionary(const ghoul::Dictionary& di
std::string geometryType = dictionary.value<std::string>(KeyType);
auto factory = FactoryManager::ref().factory<PlanetGeometry>();
PlanetGeometry* result = factory->create(geometryType, dictionary);
std::unique_ptr<PlanetGeometry> result = factory->create(geometryType, dictionary);
if (result == nullptr) {
throw ghoul::RuntimeError(
"Failed to create a PlanetGeometry object of type '" + geometryType + "'"