From 1fe98e8701dd0b790b172762c3629db32956d1fc Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 28 Sep 2019 11:18:57 +0200 Subject: uhd: Replace usage of boost smart pointers with C++11 counterparts This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include . Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct. --- host/lib/property_tree.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'host/lib/property_tree.cpp') diff --git a/host/lib/property_tree.cpp b/host/lib/property_tree.cpp index 6f797bc2e..599f610ad 100644 --- a/host/lib/property_tree.cpp +++ b/host/lib/property_tree.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include @@ -74,7 +74,7 @@ class property_tree_impl : public uhd::property_tree public: property_tree_impl(const fs_path& root = fs_path()) : _root(root) { - _guts = boost::make_shared(); + _guts = std::make_shared(); } sptr subtree(const fs_path& path_) const @@ -134,7 +134,7 @@ public: return node->keys(); } - boost::shared_ptr _pop(const fs_path& path_) + std::shared_ptr _pop(const fs_path& path_) { const fs_path path = _root / path_; boost::mutex::scoped_lock lock(_guts->mutex); @@ -157,7 +157,7 @@ public: return prop; } - void _create(const fs_path& path_, const boost::shared_ptr& prop, + void _create(const fs_path& path_, const std::shared_ptr& prop, std::type_index prop_type) { const fs_path path = _root / path_; @@ -176,7 +176,7 @@ public: node->prop_type_hash = prop_type.hash_code(); } - boost::shared_ptr& _access(const fs_path& path_) const + std::shared_ptr& _access(const fs_path& path_) const { const fs_path path = _root / path_; boost::mutex::scoped_lock lock(_guts->mutex); @@ -192,7 +192,7 @@ public: return node->prop; } - boost::shared_ptr& _access_with_type_check( + std::shared_ptr& _access_with_type_check( const fs_path& path_, std::type_index expected_prop_type) const { const fs_path path = _root / path_; @@ -220,7 +220,7 @@ private: // basic structural node element struct node_type : uhd::dict { - boost::shared_ptr prop; + std::shared_ptr prop; std::size_t prop_type_hash; }; @@ -232,7 +232,7 @@ private: }; // members, the tree and root prefix - boost::shared_ptr _guts; + std::shared_ptr _guts; const fs_path _root; }; -- cgit v1.2.3