aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/property_tree.cpp
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2021-01-06 11:18:14 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-01-08 11:23:17 -0600
commitf22e3c2d475f4579d9fdd0cd533c509a52a47ad1 (patch)
treef0a5356ac4597455b095e01467ef7e791ec1511e /host/lib/property_tree.cpp
parent9f3ec1c5ab3cc4b5ced2048a8666dd66b743cc99 (diff)
downloaduhd-f22e3c2d475f4579d9fdd0cd533c509a52a47ad1.tar.gz
uhd-f22e3c2d475f4579d9fdd0cd533c509a52a47ad1.tar.bz2
uhd-f22e3c2d475f4579d9fdd0cd533c509a52a47ad1.zip
uhd: revert "Check property type at access..."
This change reverts cb9329a681552e6ac6277d16e1627afcbb23e637. The type checking is causing some conversion issues on clang/macos. The type_index checking doesn't work correctly across shared libraries and should not be relied on to verify type, since it can vary from compiler to compiler. Signed-off-by: Steven Koo <steven.koo@ni.com>
Diffstat (limited to 'host/lib/property_tree.cpp')
-rw-r--r--host/lib/property_tree.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/host/lib/property_tree.cpp b/host/lib/property_tree.cpp
index ba9670913..405c2ac6b 100644
--- a/host/lib/property_tree.cpp
+++ b/host/lib/property_tree.cpp
@@ -11,7 +11,6 @@
#include <boost/thread/mutex.hpp>
#include <iostream>
#include <memory>
-#include <typeindex>
using namespace uhd;
@@ -158,8 +157,7 @@ public:
}
void _create(const fs_path& path_,
- const std::shared_ptr<void>& prop,
- std::type_index prop_type)
+ const std::shared_ptr<void>& prop)
{
const fs_path path = _root / path_;
boost::mutex::scoped_lock lock(_guts->mutex);
@@ -174,7 +172,6 @@ public:
throw uhd::runtime_error(
"Cannot create! Property already exists at: " + path);
node->prop = prop;
- node->prop_type_hash = prop_type.hash_code();
}
std::shared_ptr<void>& _access(const fs_path& path_) const
@@ -193,26 +190,6 @@ public:
return node->prop;
}
- 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_;
- 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
{
@@ -223,7 +200,6 @@ private:
struct node_type : uhd::dict<std::string, node_type>
{
std::shared_ptr<void> prop;
- std::size_t prop_type_hash;
};
// tree guts which may be referenced in a subtree