diff --git a/include/core/capture/capture_base.h b/include/core/capture/capture_base.h index ccde83ed32c34c64bd4ca0d3e0c3e211b6ec0719..1c2f80ab61ba3ab597506a4f9a3e690a290d5cc9 100644 --- a/include/core/capture/capture_base.h +++ b/include/core/capture/capture_base.h @@ -88,8 +88,8 @@ class CaptureBase : public NodeBase, public HasStateBlocks, public std::enable_s void setFrame(const FrameBasePtr _frm_ptr); public: - const FeatureBaseConstPtrList& getFeatureList() const; - const FeatureBasePtrList& getFeatureList(); + FeatureBaseConstPtrList getFeatureList() const; + FeatureBasePtrList getFeatureList(); FactorBaseConstPtrList getFactorList() const; FactorBasePtrList getFactorList(); @@ -107,8 +107,8 @@ class CaptureBase : public NodeBase, public HasStateBlocks, public std::enable_s public: unsigned int getHits() const; - const FactorBaseConstPtrList& getConstrainedByList() const; - const FactorBasePtrList& getConstrainedByList(); + FactorBaseConstPtrList getConstrainedByList() const; + FactorBasePtrList getConstrainedByList(); bool isConstrainedBy(const FactorBaseConstPtr &_factor) const; // State blocks @@ -222,12 +222,12 @@ inline void CaptureBase::setFrame(const FrameBasePtr _frm_ptr) frame_ptr_ = _frm_ptr; } -inline const FeatureBaseConstPtrList& CaptureBase::getFeatureList() const +inline FeatureBaseConstPtrList CaptureBase::getFeatureList() const { return feature_const_list_; } -inline const FeatureBasePtrList& CaptureBase::getFeatureList() +inline FeatureBasePtrList CaptureBase::getFeatureList() { return feature_list_; } @@ -237,12 +237,12 @@ inline unsigned int CaptureBase::getHits() const return constrained_by_list_.size(); } -inline const FactorBaseConstPtrList& CaptureBase::getConstrainedByList() const +inline FactorBaseConstPtrList CaptureBase::getConstrainedByList() const { return constrained_by_const_list_; } -inline const FactorBasePtrList& CaptureBase::getConstrainedByList() +inline FactorBasePtrList CaptureBase::getConstrainedByList() { return constrained_by_list_; } diff --git a/include/core/feature/feature_base.h b/include/core/feature/feature_base.h index 76154db503d77a7356ed4103304ea45ee5f6f10c..3e7d29310f42b80f81396041026638236783a448 100644 --- a/include/core/feature/feature_base.h +++ b/include/core/feature/feature_base.h @@ -124,14 +124,14 @@ class FeatureBase : public NodeBase, public std::enable_shared_from_this<Feature CaptureBaseConstPtr getCapture() const; CaptureBasePtr getCapture(); - const FactorBaseConstPtrList& getFactorList() const; - const FactorBasePtrList& getFactorList(); + FactorBaseConstPtrList getFactorList() const; + FactorBasePtrList getFactorList(); void getFactorList(FactorBaseConstPtrList & _fac_list) const; void getFactorList(FactorBasePtrList & _fac_list); unsigned int getHits() const; - const FactorBaseConstPtrList& getConstrainedByList() const; - const FactorBasePtrList& getConstrainedByList(); + FactorBaseConstPtrList getConstrainedByList() const; + FactorBasePtrList getConstrainedByList(); bool isConstrainedBy(const FactorBaseConstPtr &_factor) const; void link(CaptureBasePtr cap_ptr); @@ -183,12 +183,22 @@ inline unsigned int FeatureBase::getHits() const return constrained_by_list_.size(); } -inline const FactorBaseConstPtrList& FeatureBase::getConstrainedByList() const +inline FactorBaseConstPtrList FeatureBase::getFactorList() const +{ + return factor_const_list_; +} + +inline FactorBasePtrList FeatureBase::getFactorList() +{ + return factor_list_; +} + +inline FactorBaseConstPtrList FeatureBase::getConstrainedByList() const { return constrained_by_const_list_; } -inline const FactorBasePtrList& FeatureBase::getConstrainedByList() +inline FactorBasePtrList FeatureBase::getConstrainedByList() { return constrained_by_list_; } diff --git a/include/core/frame/frame_base.h b/include/core/frame/frame_base.h index a228317ff8a9203a3584e703220b74e77a19f728..9050ea3203fa3084aa6b4fa36eccb1f789f867d0 100644 --- a/include/core/frame/frame_base.h +++ b/include/core/frame/frame_base.h @@ -127,16 +127,16 @@ class FrameBase : public NodeBase, public HasStateBlocks, public std::enable_sha FrameBasePtr getPreviousFrame(); FrameBasePtr getNextFrame(); - const CaptureBaseConstPtrList& getCaptureList() const; - const CaptureBasePtrList& getCaptureList(); + CaptureBaseConstPtrList getCaptureList() const; + CaptureBasePtrList getCaptureList(); FactorBaseConstPtrList getFactorList() const; FactorBasePtrList getFactorList(); void getFactorList(FactorBaseConstPtrList& _fac_list) const; void getFactorList(FactorBasePtrList& _fac_list); - const FactorBaseConstPtrList& getConstrainedByList() const; - const FactorBasePtrList& getConstrainedByList(); + FactorBaseConstPtrList getConstrainedByList() const; + FactorBasePtrList getConstrainedByList(); bool isConstrainedBy(const FactorBaseConstPtr& _factor) const; template <class C> @@ -254,12 +254,12 @@ inline TrajectoryBasePtr FrameBase::getTrajectory() return trajectory_ptr_.lock(); } -inline const CaptureBaseConstPtrList& FrameBase::getCaptureList() const +inline CaptureBaseConstPtrList FrameBase::getCaptureList() const { return capture_const_list_; } -inline const CaptureBasePtrList& FrameBase::getCaptureList() +inline CaptureBasePtrList FrameBase::getCaptureList() { return capture_list_; } @@ -269,12 +269,12 @@ inline unsigned int FrameBase::getHits() const return constrained_by_list_.size(); } -inline const FactorBaseConstPtrList& FrameBase::getConstrainedByList() const +inline FactorBaseConstPtrList FrameBase::getConstrainedByList() const { return constrained_by_const_list_; } -inline const FactorBasePtrList& FrameBase::getConstrainedByList() +inline FactorBasePtrList FrameBase::getConstrainedByList() { return constrained_by_list_; } diff --git a/include/core/hardware/hardware_base.h b/include/core/hardware/hardware_base.h index 3dc69962ca482aa29dbf30de9097132e98dcbcb1..88d72e2211b8fa7ccc993d658a6ad8509fbbbf43 100644 --- a/include/core/hardware/hardware_base.h +++ b/include/core/hardware/hardware_base.h @@ -47,8 +47,8 @@ class HardwareBase : public NodeBase, public std::enable_shared_from_this<Hardwa HardwareBase(); ~HardwareBase() override; - const SensorBaseConstPtrList& getSensorList() const; - const SensorBasePtrList& getSensorList(); + SensorBaseConstPtrList getSensorList() const; + SensorBasePtrList getSensorList(); virtual void printHeader(int depth, // bool constr_by, // @@ -76,12 +76,12 @@ class HardwareBase : public NodeBase, public std::enable_shared_from_this<Hardwa namespace wolf { -inline const SensorBaseConstPtrList& HardwareBase::getSensorList() const +inline SensorBaseConstPtrList HardwareBase::getSensorList() const { return sensor_const_list_; } -inline const SensorBasePtrList& HardwareBase::getSensorList() +inline SensorBasePtrList HardwareBase::getSensorList() { return sensor_list_; } diff --git a/include/core/landmark/landmark_base.h b/include/core/landmark/landmark_base.h index bd8056f45b6cbff177d567044b24425b5008c2d9..34aefb07e97459bfd67b04c6822075469d900270 100644 --- a/include/core/landmark/landmark_base.h +++ b/include/core/landmark/landmark_base.h @@ -93,8 +93,8 @@ class LandmarkBase : public NodeBase, public HasStateBlocks, public std::enable_ void setDescriptor(const Eigen::VectorXd& _descriptor); unsigned int getHits() const; - const FactorBaseConstPtrList& getConstrainedByList() const; - const FactorBasePtrList& getConstrainedByList(); + FactorBaseConstPtrList getConstrainedByList() const; + FactorBasePtrList getConstrainedByList(); bool isConstrainedBy(const FactorBaseConstPtr &_factor) const; MapBaseConstPtr getMap() const; @@ -182,12 +182,12 @@ inline unsigned int LandmarkBase::getHits() const return constrained_by_list_.size(); } -inline const FactorBaseConstPtrList& LandmarkBase::getConstrainedByList() const +inline FactorBaseConstPtrList LandmarkBase::getConstrainedByList() const { return constrained_by_const_list_; } -inline const FactorBasePtrList& LandmarkBase::getConstrainedByList() +inline FactorBasePtrList LandmarkBase::getConstrainedByList() { return constrained_by_list_; } diff --git a/include/core/map/map_base.h b/include/core/map/map_base.h index 9c32c1411bf4b236d74b39bfd957be15fa7fad4a..ae680c3e726430cd10eb03da148a4ece54b61610 100644 --- a/include/core/map/map_base.h +++ b/include/core/map/map_base.h @@ -112,8 +112,8 @@ class MapBase : public NodeBase, public std::enable_shared_from_this<MapBase> virtual void removeLandmark(LandmarkBasePtr _landmark_ptr); public: - const LandmarkBaseConstPtrList& getLandmarkList() const; - const LandmarkBasePtrList& getLandmarkList(); + LandmarkBaseConstPtrList getLandmarkList() const; + LandmarkBasePtrList getLandmarkList(); void load(const std::string& _map_file_yaml); void save(const std::string& _map_file_yaml, const std::string& _map_name = "Map automatically saved by Wolf"); @@ -138,12 +138,12 @@ class MapBase : public NodeBase, public std::enable_shared_from_this<MapBase> std::string dateTimeNow(); }; -inline const LandmarkBaseConstPtrList& MapBase::getLandmarkList() const +inline LandmarkBaseConstPtrList MapBase::getLandmarkList() const { return landmark_const_list_; } -inline const LandmarkBasePtrList& MapBase::getLandmarkList() +inline LandmarkBasePtrList MapBase::getLandmarkList() { return landmark_list_; } diff --git a/include/core/sensor/sensor_base.h b/include/core/sensor/sensor_base.h index 33b1cafbd298bbd7bdff31d182ecec47169f5325..2ab79c9ee19c6122a0521afd0e7f5a456fd255a5 100644 --- a/include/core/sensor/sensor_base.h +++ b/include/core/sensor/sensor_base.h @@ -184,8 +184,8 @@ class SensorBase : public NodeBase, public HasStateBlocks, public std::enable_sh void removeProcessor(ProcessorBasePtr _proc_ptr); public: - const ProcessorBaseConstPtrList& getProcessorList() const; - const ProcessorBasePtrList& getProcessorList(); + ProcessorBaseConstPtrList getProcessorList() const; + ProcessorBasePtrList getProcessorList(); CaptureBaseConstPtr getLastCapture() const; CaptureBasePtr getLastCapture(); @@ -315,12 +315,12 @@ inline unsigned int SensorBase::id() const return sensor_id_; } -inline const ProcessorBaseConstPtrList& SensorBase::getProcessorList() const +inline ProcessorBaseConstPtrList SensorBase::getProcessorList() const { return processor_const_list_; } -inline const ProcessorBasePtrList& SensorBase::getProcessorList() +inline ProcessorBasePtrList SensorBase::getProcessorList() { return processor_list_; } diff --git a/include/core/trajectory/trajectory_base.h b/include/core/trajectory/trajectory_base.h index 5c1cf57997a9a6dac1c21467335913b3063a22b9..ffdcfe3231e0636c7a1d2af4949ee54383a83c8e 100644 --- a/include/core/trajectory/trajectory_base.h +++ b/include/core/trajectory/trajectory_base.h @@ -53,8 +53,8 @@ class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<Traj ~TrajectoryBase() override; // Frames - const FrameConstPtrMap& getFrameMap() const; - const FramePtrMap& getFrameMap(); + FrameConstPtrMap getFrameMap() const; + FramePtrMap getFrameMap(); FrameBaseConstPtr getLastFrame() const; FrameBasePtr getLastFrame(); FrameBaseConstPtr getFirstFrame() const; @@ -88,12 +88,12 @@ class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<Traj void getFactorList(FactorBasePtrList & _fac_list); }; -inline const FrameConstPtrMap& TrajectoryBase::getFrameMap() const +inline FrameConstPtrMap TrajectoryBase::getFrameMap() const { return frame_const_map_; } -inline const FramePtrMap& TrajectoryBase::getFrameMap() +inline FramePtrMap TrajectoryBase::getFrameMap() { return frame_map_; } diff --git a/src/feature/feature_base.cpp b/src/feature/feature_base.cpp index f81cff7025750f7c0beedb0b73a78227cf8e5c65..09971a9f9764c852d70afb7ed6e9b15464bb8035 100644 --- a/src/feature/feature_base.cpp +++ b/src/feature/feature_base.cpp @@ -134,16 +134,6 @@ bool FeatureBase::isConstrainedBy(const FactorBaseConstPtr &_factor) const _factor) != constrained_by_const_list_.end(); } -const FactorBaseConstPtrList& FeatureBase::getFactorList() const -{ - return factor_const_list_; -} - -const FactorBasePtrList& FeatureBase::getFactorList() -{ - return factor_list_; -} - void FeatureBase::getFactorList(FactorBaseConstPtrList & _fac_list) const { _fac_list.insert(_fac_list.end(), factor_const_list_.begin(), factor_const_list_.end());