aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-09-30 16:35:51 +0200
committerMartin Braun <martin.braun@ettus.com>2019-09-30 16:35:51 +0200
commitd8b75ca5324204bfb3d7cdb1a03831d9ecd97e73 (patch)
tree356de930d47ce54833566a87ce826551c5ee3e61 /host/lib
parentabedbfe5481650a3f5200ab2ba48f6668096761e (diff)
downloaduhd-d8b75ca5324204bfb3d7cdb1a03831d9ecd97e73.tar.gz
uhd-d8b75ca5324204bfb3d7cdb1a03831d9ecd97e73.tar.bz2
uhd-d8b75ca5324204bfb3d7cdb1a03831d9ecd97e73.zip
Revert "uhd: Check property type at access; error if mismatch"
This reverts commit 94592641f0647563bc4d2163805d5284a6796273. The commit itself was OK, but it changed the requirements such that UHD could only be compiled with C++11.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/property_tree.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/host/lib/property_tree.cpp b/host/lib/property_tree.cpp
index 6f797bc2e..85868b27c 100644
--- a/host/lib/property_tree.cpp
+++ b/host/lib/property_tree.cpp
@@ -11,7 +11,6 @@
#include <boost/make_shared.hpp>
#include <boost/thread/mutex.hpp>
#include <iostream>
-#include <typeindex>
using namespace uhd;
@@ -157,8 +156,7 @@ public:
return prop;
}
- void _create(const fs_path& path_, const boost::shared_ptr<void>& prop,
- std::type_index prop_type)
+ void _create(const fs_path& path_, const boost::shared_ptr<void>& prop)
{
const fs_path path = _root / path_;
boost::mutex::scoped_lock lock(_guts->mutex);
@@ -173,7 +171,6 @@ public:
throw uhd::runtime_error(
"Cannot create! Property already exists at: " + path);
node->prop = prop;
- node->prop_type_hash = prop_type.hash_code();
}
boost::shared_ptr<void>& _access(const fs_path& path_) const
@@ -192,25 +189,6 @@ public:
return node->prop;
}
- boost::shared_ptr<void>& _access_with_type_check(
- const fs_path& path_, std::type_index expected_prop_type) const
- {
- const fs_path path = _root / path_;
- boost::mutex::scoped_lock lock(_guts->mutex);
-
- node_type* node = &_guts->root;
- for (const std::string& name : path_tokenizer(path)) {
- if (not node->has_key(name))
- throw_path_not_found(path);
- node = &(*node)[name];
- }
- if (node->prop.get() == NULL)
- throw uhd::runtime_error("Cannot access! Property uninitialized at: " + path);
- if (node->prop_type_hash != expected_prop_type.hash_code())
- throw uhd::runtime_error("Cannot access! Property types do not match at: " + path);
- return node->prop;
- }
-
private:
void throw_path_not_found(const fs_path& path) const
{
@@ -221,7 +199,6 @@ private:
struct node_type : uhd::dict<std::string, node_type>
{
boost::shared_ptr<void> prop;
- std::size_t prop_type_hash;
};
// tree guts which may be referenced in a subtree