From 794c5861b6834181545361b98adea71bf5f8506a Mon Sep 17 00:00:00 2001 From: Sergey Alexandrov Date: Thu, 16 Jan 2020 20:02:59 +0100 Subject: [PATCH] Revert smart pointer type change and deprecate getMapping() Even though pcl::detail::getMapping() is not officially a public API, it is used outside of PCL (in pcl_ros). Changing the smart pointer type from boost to std broke that code. This commit partially reverses the changes from #3474, unbreaking pcl_ros. It also properly deprecates the function so that other (unknown to us) clients have time to update their code. --- common/include/pcl/point_cloud.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/include/pcl/point_cloud.h b/common/include/pcl/point_cloud.h index 04abea1ea78..ef375200dd3 100644 --- a/common/include/pcl/point_cloud.h +++ b/common/include/pcl/point_cloud.h @@ -49,8 +49,9 @@ #include #include +#include + #include -#include #include #include @@ -136,7 +137,9 @@ namespace pcl namespace detail { - template std::shared_ptr& + template + [[deprecated("use createMapping() instead")]] + boost::shared_ptr& getMapping (pcl::PointCloud& p); } // namespace detail @@ -603,9 +606,9 @@ namespace pcl protected: // This is motivated by ROS integration. Users should not need to access mapping_. - std::shared_ptr mapping_; + [[deprecated("rewrite your code to avoid using this protected field")]] boost::shared_ptr mapping_; - friend std::shared_ptr& detail::getMapping(pcl::PointCloud &p); + friend boost::shared_ptr& detail::getMapping(pcl::PointCloud &p); public: PCL_MAKE_ALIGNED_OPERATOR_NEW @@ -613,7 +616,7 @@ namespace pcl namespace detail { - template std::shared_ptr& + template boost::shared_ptr& getMapping (pcl::PointCloud& p) { return (p.mapping_);