Skip to content
Snippets Groups Projects
Commit 522d98ea authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Replace map --> unordered_map

parent 38083867
No related branches found
No related tags found
1 merge request!341Resolve "HasStateBlocks::addStateBlock() needs to register SB's"
This commit is part of merge request !341. Comments created here will be created in the context of that merge request.
...@@ -26,7 +26,7 @@ class HasStateBlocks ...@@ -26,7 +26,7 @@ class HasStateBlocks
void appendToStructure(const std::string& _frame_type){ structure_ += _frame_type; } 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; } bool isInStructure(const std::string& _sb_type) { return structure_.find(_sb_type) != std::string::npos; }
const std::map<std::string, StateBlockPtr>& getStateBlockMap() const; const std::unordered_map<std::string, StateBlockPtr>& getStateBlockMap() const;
std::vector<StateBlockPtr> getStateBlockVec() const; std::vector<StateBlockPtr> getStateBlockVec() const;
// Some typical shortcuts -- not all should be coded here, see notes below. // Some typical shortcuts -- not all should be coded here, see notes below.
...@@ -64,15 +64,15 @@ class HasStateBlocks ...@@ -64,15 +64,15 @@ class HasStateBlocks
void removeStateBlocks(ProblemPtr _problem); void removeStateBlocks(ProblemPtr _problem);
// States // States
virtual void setState(const Eigen::VectorXd& _state, const bool _notify = true); virtual void setState(const Eigen::VectorXd& _state, const bool _notify = true);
Eigen::VectorXd getState() const; Eigen::VectorXd getState() const;
void getState(Eigen::VectorXd& _state) const; void getState(Eigen::VectorXd& _state) const;
unsigned int getSize() const; unsigned int getSize() const;
unsigned int getLocalSize() const; unsigned int getLocalSize() const;
private: private:
std::string structure_; std::string structure_;
std::map<std::string, StateBlockPtr> state_block_map_; std::unordered_map<std::string, StateBlockPtr> state_block_map_;
}; };
...@@ -97,7 +97,7 @@ inline HasStateBlocks::~HasStateBlocks() ...@@ -97,7 +97,7 @@ inline HasStateBlocks::~HasStateBlocks()
// //
} }
inline const std::map<std::string, StateBlockPtr>& HasStateBlocks::getStateBlockMap() const inline const std::unordered_map<std::string, StateBlockPtr>& HasStateBlocks::getStateBlockMap() const
{ {
return state_block_map_; return state_block_map_;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment