From a025de7736ca2ca06bb15a98ce6dc93ad1f85bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Sun, 1 Sep 2019 16:58:23 +0200 Subject: [PATCH] Add access by char --- include/core/state_block/has_state_blocks.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/core/state_block/has_state_blocks.h b/include/core/state_block/has_state_blocks.h index c84d345a9..4d8ab0c5e 100644 --- a/include/core/state_block/has_state_blocks.h +++ b/include/core/state_block/has_state_blocks.h @@ -44,13 +44,22 @@ class HasStateBlocks void unfix(); bool isFixed() const; - protected: + public: StateBlockPtr setStateBlock(const std::string& _sb_type, const StateBlockPtr& _sb); + StateBlockPtr setStateBlock(const char& _sb_type, const StateBlockPtr& _sb) + { + return setStateBlock(std::string(1,_sb_type), _sb); + } StateBlockPtr getStateBlock(const std::string& _sb_type) const; + StateBlockPtr getStateBlock(const char& _sb_type) const {return getStateBlock(std::string(1,_sb_type));} unsigned int removeStateBlock(const std::string& _sb_type) { return state_block_map_.erase(_sb_type); } + unsigned int removeStateBlock(const char& _sb_type) + { + return removeStateBlock(std::string(1,_sb_type)); + } // Emplace derived state blocks (angle, quaternion, etc). template<typename SB, typename ... Args> -- GitLab