diff --git a/include/core/common/factory.h b/include/core/common/factory.h index 34c214bd674157eefe04433b3406918ae8e0cba0..d97810fe3f6fb83f14ee2e802ea8f07b2049485f 100644 --- a/include/core/common/factory.h +++ b/include/core/common/factory.h @@ -88,7 +88,7 @@ namespace wolf * \code * typedef Factory<ParamsSensorBase, std::string> FactoryParamsSensor; * typedef Factory<ParamsProcessorBase, std::string> FactoryParamsProcessor; - * typedef Factory<LandmarkBase, YAML::Node> LandmarkFactory; + * typedef Factory<LandmarkBase, YAML::Node> FactoryLandmark; * \endcode * * Second to know, the Factory class is a <a href="http://stackoverflow.com/questions/1008019/c-singleton-design-pattern#1008289">singleton</a>: it can only exist once in your application. @@ -103,7 +103,7 @@ namespace wolf * You can then call the methods you like, e.g. to create a landmark, you use: * * \code - * LandmarkFactory::get().create(...); // see below for creating objects ... + * FactoryLandmark::get().create(...); // see below for creating objects ... * \endcode * * #### Write creator methods (in your derived object classes) @@ -137,7 +137,7 @@ namespace wolf * that knows how to create your specific object, e.g.: * * \code - * LandmarkFactory::get().registerCreator("POLYLINE 2d", LandmarkPolyline2d::create); + * FactoryLandmark::get().registerCreator("POLYLINE 2d", LandmarkPolyline2d::create); * \endcode * * #### Automatic registration @@ -172,7 +172,7 @@ namespace wolf * or even better, make use of the convenient typedefs: * * \code - * LandmarkBasePtr lmk_ptr = LandmarkFactory::get().create("POLYLINE 2d", lmk_yaml_node); + * LandmarkBasePtr lmk_ptr = FactoryLandmark::get().create("POLYLINE 2d", lmk_yaml_node); * \endcode * * ### Examples @@ -212,7 +212,7 @@ namespace wolf * // Register landmark creator (put the register code inside an unnamed namespace): * namespace * { - * const bool registered_lmk_polyline_2d = LandmarkFactory::get().registerCreator("POLYLINE 2d", LandmarkPolyline2d::create); + * const bool registered_lmk_polyline_2d = FactoryLandmark::get().registerCreator("POLYLINE 2d", LandmarkPolyline2d::create); * } * * \endcode @@ -220,7 +220,7 @@ namespace wolf * ### More information * - FactoryParamsSensor: typedef of this template to create intrinsic structs deriving from ParamsSensorBase directly from YAML files. * - FactoryParamsProcessor: typedef of this template to create processor params structs deriving from ParamsProcessorBase directly from YAML files. - * - LandmarkFactory: typedef of this template to create landmarks deriving from LandmarkBase directly from YAML nodes. + * - FactoryLandmark: typedef of this template to create landmarks deriving from LandmarkBase directly from YAML nodes. * - Problem::loadMap() : to load a maps directly from YAML files. * - You can also check the code in the example file ````src/examples/test_map_yaml.cpp````. * @@ -317,11 +317,11 @@ namespace wolf // Landmarks from YAML class LandmarkBase; typedef Factory<LandmarkBase, - const YAML::Node&> LandmarkFactory; + const YAML::Node&> FactoryLandmark; template<> -inline std::string LandmarkFactory::getClass() +inline std::string FactoryLandmark::getClass() { - return "LandmarkFactory"; + return "FactoryLandmark"; } diff --git a/src/landmark/landmark_base.cpp b/src/landmark/landmark_base.cpp index bc57f27294e6a0b05d67cbcf44725dd2b819f63b..88626f26614c699802c891d5d2b399469641d662 100644 --- a/src/landmark/landmark_base.cpp +++ b/src/landmark/landmark_base.cpp @@ -182,7 +182,7 @@ LandmarkBasePtr LandmarkBase::create(const YAML::Node& _node) // Register landmark creator namespace { -const bool WOLF_UNUSED registered_lmk_base = LandmarkFactory::get().registerCreator("LandmarkBase", LandmarkBase::create); +const bool WOLF_UNUSED registered_lmk_base = FactoryLandmark::get().registerCreator("LandmarkBase", LandmarkBase::create); } } // namespace wolf diff --git a/src/map/map_base.cpp b/src/map/map_base.cpp index 3a3d32f8ac073ba88160995f69af8e1c150426bb..e75e1147addab9c221bc80f28aa6d56bfeda8568 100644 --- a/src/map/map_base.cpp +++ b/src/map/map_base.cpp @@ -49,7 +49,7 @@ void MapBase::load(const std::string& _map_file_dot_yaml) for (unsigned int i = 0; i < nlandmarks; i++) { YAML::Node lmk_node = map["landmarks"][i]; - LandmarkBasePtr lmk_ptr = LandmarkFactory::get().create(lmk_node["type"].as<std::string>(), lmk_node); + LandmarkBasePtr lmk_ptr = FactoryLandmark::get().create(lmk_node["type"].as<std::string>(), lmk_node); lmk_ptr->link(shared_from_this()); }