From 5f1b7aa33ee1df6cda16c8908cbe4a23d30d023f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Wed, 8 Apr 2020 12:59:01 +0200
Subject: [PATCH] new typedef StateBlockMap

---
 include/core/state_block/has_state_blocks.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/core/state_block/has_state_blocks.h b/include/core/state_block/has_state_blocks.h
index d8238da0b..1e965ce8f 100644
--- a/include/core/state_block/has_state_blocks.h
+++ b/include/core/state_block/has_state_blocks.h
@@ -16,6 +16,8 @@
 namespace wolf
 {
 
+typedef std::unordered_map<std::string, StateBlockPtr> StateBlockMap;
+
 
 class HasStateBlocks
 {
@@ -28,7 +30,7 @@ class HasStateBlocks
         void appendToStructure(const std::string& _frame_type){ structure_ += _frame_type; }
         bool isInStructure(const std::string& _sb_type) { return structure_.find(_sb_type) != std::string::npos; }
 
-        const std::unordered_map<std::string, StateBlockPtr>& getStateBlockMap() const;
+        const StateBlockMap& getStateBlockMap() const;
         std::vector<StateBlockPtr> getStateBlockVec() const;
 
         // Some typical shortcuts -- not all should be coded here, see notes below.
@@ -52,7 +54,7 @@ class HasStateBlocks
         bool            setStateBlock(const std::string _sb_type, const StateBlockPtr& _sb);
         bool            setStateBlock(const char _sb_type, const StateBlockPtr& _sb) { return setStateBlock(std::string(1, _sb_type), _sb); }
         bool            stateBlockKey(const StateBlockPtr& _sb, std::string& _key) const;
-        std::unordered_map<std::string, StateBlockPtr>::const_iterator find(const StateBlockPtr& _sb) const;
+        StateBlockMap::const_iterator find(const StateBlockPtr& _sb) const;
 
         // Emplace derived state blocks (angle, quaternion, etc).
         template<typename SB, typename ... Args>
@@ -85,8 +87,8 @@ class HasStateBlocks
 
 
     private:
-        StateStructure                                  structure_; // TBR
-        std::unordered_map<std::string, StateBlockPtr>  state_block_map_;
+        StateStructure  structure_; // TBR
+        StateBlockMap   state_block_map_;
 
 };
 
@@ -111,7 +113,7 @@ inline HasStateBlocks::~HasStateBlocks()
     //
 }
 
-inline const std::unordered_map<std::string, StateBlockPtr>& HasStateBlocks::getStateBlockMap() const
+inline const StateBlockMap& HasStateBlocks::getStateBlockMap() const
 {
     return state_block_map_;
 }
@@ -266,7 +268,7 @@ inline Eigen::VectorXd HasStateBlocks::getState(const StateStructure& _sub_struc
     return state;
 }
 
-inline std::unordered_map<std::string, StateBlockPtr>::const_iterator HasStateBlocks::find(const StateBlockPtr& _sb) const
+inline StateBlockMap::const_iterator HasStateBlocks::find(const StateBlockPtr& _sb) const
 {
     const auto& it = std::find_if(state_block_map_.begin(),
                                   state_block_map_.end(),
-- 
GitLab