own_tree: make ordered map, we need it sorted anyway 89/246189/1
authorAdrian Szyndela <adrian.s@samsung.com>
Wed, 14 Oct 2020 06:07:10 +0000 (08:07 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Mon, 26 Oct 2020 15:36:56 +0000 (16:36 +0100)
Change-Id: Iaac12479580b1502bc459387b64b7dda12ce9bef

src/internal/own_tree.cpp
src/internal/own_tree.hpp

index 5cc7ead..5eecc06 100644 (file)
@@ -17,7 +17,7 @@
 #include <boost/tokenizer.hpp>
 #include <deque>
 #include <iostream>
-#include <unordered_map>
+#include <map>
 
 /**
  * \file
@@ -106,6 +106,6 @@ const DecisionItem &TreeNode::getOwnDecisionItem() const {
        return __own_decision_item;
 }
 
-const std::unordered_map<std::string, std::shared_ptr<TreeNode>> &TreeNode::getChildren() const {
+const std::map<std::string, std::shared_ptr<TreeNode>> &TreeNode::getChildren() const {
        return __children;
 }
index 54038d1..b65be39 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "policy.hpp"
 #include <memory>
-#include <unordered_map>
+#include <map>
 #include <deque>
 
 namespace ldp_xml_parser
@@ -39,14 +39,14 @@ namespace ldp_xml_parser
                const std::string &getToken() const;
                const DecisionItem &getOwnPrefixDecisionItem() const;
                const DecisionItem &getOwnDecisionItem() const;
-               const std::unordered_map<std::string, std::shared_ptr<TreeNode>> &getChildren() const;
+               const std::map<std::string, std::shared_ptr<TreeNode>> &getChildren() const;
        private:
                DecisionItem prefixBasedDecision() const;
 
                std::string __token;    // element of dot-separated name
                DecisionItem __own_prefix_decision_item;
                DecisionItem __own_decision_item;
-               std::unordered_map<std::string, std::shared_ptr<TreeNode>> __children;
+               std::map<std::string, std::shared_ptr<TreeNode>> __children;
                friend class OwnershipTree;
        };