From 0f7f2a58b6495be09da72850969dd7f719940874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Mon, 15 Jun 2020 13:24:49 +0200 Subject: [PATCH] Make getStructure(), getFrameStructure and getStateStructure more uniform --- include/core/problem/problem.h | 2 +- include/core/processor/is_motion.h | 4 ++-- src/problem/problem.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h index f64f62905..63512663b 100644 --- a/include/core/problem/problem.h +++ b/include/core/problem/problem.h @@ -83,7 +83,7 @@ class Problem : public std::enable_shared_from_this<Problem> // Properties ----------------------------------------- public: SizeEigen getDim() const; - StateStructure getFrameStructure() const; + const StateStructure& getFrameStructure() const; protected: void appendToStructure(const StateStructure& _structure); diff --git a/include/core/processor/is_motion.h b/include/core/processor/is_motion.h index 09d7bc68d..08e500822 100644 --- a/include/core/processor/is_motion.h +++ b/include/core/processor/is_motion.h @@ -29,8 +29,8 @@ class IsMotion virtual VectorComposite getState(const StateStructure& _structure = "") const = 0; virtual VectorComposite getState(const TimeStamp& _ts, const StateStructure& _structure = "") const = 0; - std::string getStateStructure(){return state_structure_;}; - void setStateStructure(std::string _state_structure){state_structure_ = _state_structure;}; + const StateStructure& getStateStructure ( ) { return state_structure_; }; + void setStateStructure(std::string _state_structure) { state_structure_ = _state_structure; }; void addToProblem(ProblemPtr _prb_ptr, IsMotionPtr _motion_ptr); protected: diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index 4f1b16ee5..b75b2eb0a 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -543,7 +543,8 @@ SizeEigen Problem::getDim() const { return dim_; } -StateStructure Problem::getFrameStructure() const + +const StateStructure& Problem::getFrameStructure() const { return frame_structure_; } -- GitLab