diff --git a/src/node_base.h b/src/node_base.h index 7ccb3bff2f53e13700b51fe2cfdbc9377e601527..1cf31eb69c4cbddaa87b20a208abd5dcd317110a 100644 --- a/src/node_base.h +++ b/src/node_base.h @@ -13,7 +13,7 @@ namespace wolf { * * - A unique ID. The class implements the ID factory. * - * - A unique class name, strictly within this range of possibilities: + * - A unique category name, strictly within this range of possibilities: * - "BASE" -- should not be used * - "PROBLEM" * - "HARDWARE" @@ -27,7 +27,7 @@ namespace wolf { * - "MAP" * - "LANDMARK" * - * - A unique type, which is a subclass of the above. The list here cannot be exhaustive, but a few examples follow: + * - A unique type, which is a subcategory of the above. The list here cannot be exhaustive, but a few examples follow: * - "Camera" * - "LIDAR 2D" * - "Point 3D" @@ -63,17 +63,17 @@ class NodeBase ProblemWPtr problem_ptr_; unsigned int node_id_; ///< Node id. It is unique over the whole Wolf Tree - std::string node_class_; ///< Text label identifying the class of node ("SENSOR", "FEATURE", etc) - std::string node_type_; ///< Text label identifying the type or subclass of node ("Pin Hole", "Point 2D", etc) + std::string node_category_; ///< Text label identifying the category of node ("SENSOR", "FEATURE", etc) + std::string node_type_; ///< Text label identifying the type or subcategory of node ("Pin Hole", "Point 2D", etc) std::string node_name_; ///< Text label identifying each specific object ("left camera", "LIDAR 1", "PointGrey", "Andrew", etc) public: - NodeBase(const std::string& _class, const std::string& _type = "Undefined", const std::string& _name = ""); + NodeBase(const std::string& _category, const std::string& _type = "Undefined", const std::string& _name = ""); virtual ~NodeBase() = default; unsigned int nodeId() const; - std::string getClass() const; + std::string getCategory() const; std::string getType() const; std::string getName() const; @@ -90,10 +90,10 @@ class NodeBase namespace wolf{ -inline NodeBase::NodeBase(const std::string& _class, const std::string& _type, const std::string& _name) : +inline NodeBase::NodeBase(const std::string& _category, const std::string& _type, const std::string& _name) : problem_ptr_(), // nullptr node_id_(++node_id_count_), - node_class_(_class), + node_category_(_category), node_type_(_type), node_name_(_name) { @@ -105,9 +105,9 @@ inline unsigned int NodeBase::nodeId() const return node_id_; } -inline std::string NodeBase::getClass() const +inline std::string NodeBase::getCategory() const { - return node_class_; + return node_category_; } inline std::string NodeBase::getType() const diff --git a/src/serialization/cereal/serialization_node_base.h b/src/serialization/cereal/serialization_node_base.h index 5cf94d7c93db5389976d5e82a1bc39de83faab30..dbf3292d5df155dd34c24e5ce2816137e2b7fd95 100644 --- a/src/serialization/cereal/serialization_node_base.h +++ b/src/serialization/cereal/serialization_node_base.h @@ -14,7 +14,7 @@ struct NodeBase::Serializer { template <class Archive> static void serialize(Archive& ar, NodeBase& o, std::uint32_t const /*version*/) { - ar( cereal::make_nvp("node_class_", o.node_class_) ); + ar( cereal::make_nvp("node_class_", o.node_category_) ); ar( cereal::make_nvp("node_type_", o.node_type_) ); ar( cereal::make_nvp("node_name_", o.node_name_) ); ar( cereal::make_nvp("node_id_", o.node_id_) ); @@ -29,7 +29,7 @@ struct NodeBase::Serializer { static void load_and_construct( Archive& ar, cereal::construct<wolf::NodeBase>& construct, std::uint32_t const /*version*/ ) { - decltype(std::declval<wolf::NodeBase>().getClass()) nb_class; + decltype(std::declval<wolf::NodeBase>().getCategory()) nb_class; decltype(std::declval<wolf::NodeBase>().getType()) nb_type; decltype(std::declval<wolf::NodeBase>().getName()) nb_name; diff --git a/src/test/serialization/cereal/gtest_serialization_node_base.cpp b/src/test/serialization/cereal/gtest_serialization_node_base.cpp index b0a51b833d2645dadf751660616b61f17144a1f7..8b6140fe70f6afe484249361a516b59d8b5dcf7b 100644 --- a/src/test/serialization/cereal/gtest_serialization_node_base.cpp +++ b/src/test/serialization/cereal/gtest_serialization_node_base.cpp @@ -27,9 +27,9 @@ public: const std::string path_to_io = "/tmp/"; - decltype(std::declval<wolf::NodeBase>().getClass()) nb_class = "Foo"; - decltype(std::declval<wolf::NodeBase>().getClass()) nb_type = "Bar"; - decltype(std::declval<wolf::NodeBase>().getClass()) nb_name = "Dummy"; + decltype(std::declval<wolf::NodeBase>().getCategory()) nb_class = "Foo"; + decltype(std::declval<wolf::NodeBase>().getCategory()) nb_type = "Bar"; + decltype(std::declval<wolf::NodeBase>().getCategory()) nb_name = "Dummy"; decltype(std::declval<wolf::NodeBase>().nodeId()) id; @@ -60,7 +60,7 @@ TEST_F(WolfTestCerealSerializationNodeBase, CerealSerializationNodeBaseXML) ASSERT_NO_THROW( xml_archive( nb ) ); - ASSERT_EQ(nb.getClass(), nb_class); + ASSERT_EQ(nb.getCategory(), nb_class); ASSERT_EQ(nb.getType(), nb_type); ASSERT_EQ(nb.getName(), nb_name); ASSERT_EQ(nb.nodeId(), id); @@ -92,7 +92,7 @@ TEST_F(WolfTestCerealSerializationNodeBase, CerealSerializationNodeBasePtrXML) ASSERT_NO_THROW( xml_archive( nb ) ); - ASSERT_EQ(nb->getClass(), nb_class); + ASSERT_EQ(nb->getCategory(), nb_class); ASSERT_EQ(nb->getType(), nb_type); ASSERT_EQ(nb->getName(), nb_name); ASSERT_EQ(nb->nodeId(), id); @@ -128,7 +128,7 @@ TEST_F(WolfTestCerealSerializationNodeBase, CerealSerializationNodeBaseJSON) ASSERT_NO_THROW( json_archive( nb ) ); - ASSERT_EQ(nb.getClass(), nb_class); + ASSERT_EQ(nb.getCategory(), nb_class); ASSERT_EQ(nb.getType(), nb_type); ASSERT_EQ(nb.getName(), nb_name); ASSERT_EQ(nb.nodeId(), id); @@ -159,7 +159,7 @@ TEST_F(WolfTestCerealSerializationNodeBase, CerealSerializationNodeBasePtrJSON) ASSERT_NO_THROW( json_archive( nb ) ); - ASSERT_EQ(nb->getClass(), nb_class); + ASSERT_EQ(nb->getCategory(), nb_class); ASSERT_EQ(nb->getType(), nb_type); ASSERT_EQ(nb->getName(), nb_name); ASSERT_EQ(nb->nodeId(), id); @@ -195,7 +195,7 @@ TEST_F(WolfTestCerealSerializationNodeBase, CerealSerializationNodeBaseBinary) ASSERT_NO_THROW( bin_archive( nb ) ); - ASSERT_EQ(nb.getClass(), nb_class); + ASSERT_EQ(nb.getCategory(), nb_class); ASSERT_EQ(nb.getType(), nb_type); ASSERT_EQ(nb.getName(), nb_name); ASSERT_EQ(nb.nodeId(), id); @@ -226,7 +226,7 @@ TEST_F(WolfTestCerealSerializationNodeBase, CerealSerializationNodeBasePtrBinary ASSERT_NO_THROW( bin_archive( nb ) ); - ASSERT_EQ(nb->getClass(), nb_class); + ASSERT_EQ(nb->getCategory(), nb_class); ASSERT_EQ(nb->getType(), nb_type); ASSERT_EQ(nb->getName(), nb_name); ASSERT_EQ(nb->nodeId(), id);