aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/property_tree.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-09-28 11:18:57 +0200
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:32 -0800
commit1fe98e8701dd0b790b172762c3629db32956d1fc (patch)
tree7719e69633f9639f1dcdcf00ebf7db6c4cd6dda2 /host/lib/property_tree.cpp
parent8541a9b397fb53034c37dd00289aa96def24d410 (diff)
downloaduhd-1fe98e8701dd0b790b172762c3629db32956d1fc.tar.gz
uhd-1fe98e8701dd0b790b172762c3629db32956d1fc.tar.bz2
uhd-1fe98e8701dd0b790b172762c3629db32956d1fc.zip
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 <memory>. 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.
Diffstat (limited to 'host/lib/property_tree.cpp')
-rw-r--r--host/lib/property_tree.cpp16
1 files changed, 8 insertions, 8 deletions
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 <uhd/property_tree.hpp>
#include <uhd/types/dict.hpp>
-#include <boost/make_shared.hpp>
+#include <memory>
#include <boost/thread/mutex.hpp>
#include <iostream>
#include <typeindex>
@@ -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<tree_guts_type>();
+ _guts = std::make_shared<tree_guts_type>();
}
sptr subtree(const fs_path& path_) const
@@ -134,7 +134,7 @@ public:
return node->keys();
}
- boost::shared_ptr<void> _pop(const fs_path& path_)
+ std::shared_ptr<void> _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<void>& prop,
+ void _create(const fs_path& path_, const std::shared_ptr<void>& 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<void>& _access(const fs_path& path_) const
+ std::shared_ptr<void>& _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<void>& _access_with_type_check(
+ std::shared_ptr<void>& _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<std::string, node_type>
{
- boost::shared_ptr<void> prop;
+ std::shared_ptr<void> prop;
std::size_t prop_type_hash;
};
@@ -232,7 +232,7 @@ private:
};
// members, the tree and root prefix
- boost::shared_ptr<tree_guts_type> _guts;
+ std::shared_ptr<tree_guts_type> _guts;
const fs_path _root;
};