Resolve "Do not require the invocation of ::get() in Factory"
Compare changes
Files
15+ 23
− 21
@@ -126,18 +126,20 @@ namespace wolf
@@ -126,18 +126,20 @@ namespace wolf
* Second to know, the Factory class is a <a href="http://stackoverflow.com/questions/1008019/c-singleton-design-pattern#1008289">singleton</a>:
* where, of course, you better make use of the appropriate typedef in place of ````Factory<MyTypeBase, MyTypeInput>````.
@@ -172,7 +174,7 @@ namespace wolf
@@ -172,7 +174,7 @@ namespace wolf
@@ -180,7 +182,7 @@ namespace wolf
@@ -180,7 +182,7 @@ namespace wolf
* const bool registered_camera_intr = FactoryParamsSensor::get().registerCreator("ParamsSensorCamera", createParamsSensorCamera);
* which is a static invocation (i.e., it is placed at global scope outside of the ParamsSensorCamera class).
@@ -191,7 +193,7 @@ namespace wolf
@@ -191,7 +193,7 @@ namespace wolf
* The method unregisterCreator() unregisters the ObjectXxx::create() method. It only needs to be passed the string of the object type.
@@ -201,13 +203,13 @@ namespace wolf
@@ -201,13 +203,13 @@ namespace wolf
* LandmarkBasePtr lmk_ptr = Factory<LandmarkBasePtr, YAML::Node>::get().create("LandmarkPolyline2d", lmk_yaml_node);
@@ -247,7 +249,7 @@ namespace wolf
@@ -247,7 +249,7 @@ namespace wolf
* const bool registered_lmk_polyline_2d = FactoryLandmark::get().registerCreator("LandmarkPolyline2d", LandmarkPolyline2d::create);
@@ -280,9 +282,9 @@ class Factory
@@ -280,9 +282,9 @@ class Factory
@@ -291,7 +293,7 @@ class Factory
@@ -291,7 +293,7 @@ class Factory
@@ -304,11 +306,11 @@ class Factory
@@ -304,11 +306,11 @@ class Factory
inline bool Factory<TypeBase, TypeInput...>::registerCreator(const std::string& _type, CreatorCallback createFn)
std::cout << std::setw(26) << std::left << getClass() << " X-- skipping " << _type << ": already registered." << std::endl;
@@ -316,17 +318,17 @@ inline bool Factory<TypeBase, TypeInput...>::registerCreator(const std::string&
@@ -316,17 +318,17 @@ inline bool Factory<TypeBase, TypeInput...>::registerCreator(const std::string&
inline typename Factory<TypeBase, TypeInput...>::TypeBasePtr Factory<TypeBase, TypeInput...>::create(const std::string& _type, TypeInput... _input)
throw std::runtime_error(getClass() + " : Unknown type \"" + _type + "\". Possibly you tried to use an unregistered creator.");