aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
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/include
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/include')
-rw-r--r--host/include/uhd/property_tree.hpp8
-rw-r--r--host/include/uhd/property_tree.ipp6
2 files changed, 3 insertions, 11 deletions
diff --git a/host/include/uhd/property_tree.hpp b/host/include/uhd/property_tree.hpp
index b6acb791f..ebec6a9f8 100644
--- a/host/include/uhd/property_tree.hpp
+++ b/host/include/uhd/property_tree.hpp
@@ -13,7 +13,6 @@
#include <functional>
#include <memory>
#include <string>
-#include <typeindex>
#include <vector>
namespace uhd {
@@ -253,15 +252,10 @@ private:
//! Internal create property with wild-card type
virtual void _create(const fs_path& path,
- const std::shared_ptr<void>& prop,
- std::type_index prop_type) = 0;
+ const std::shared_ptr<void>& prop) = 0;
//! Internal access property with wild-card type
virtual std::shared_ptr<void>& _access(const fs_path& path) const = 0;
-
- //! Internal access property with wild-card type but with type verification
- virtual std::shared_ptr<void>& _access_with_type_check(
- const fs_path& path, std::type_index expected_prop_type) const = 0;
};
} // namespace uhd
diff --git a/host/include/uhd/property_tree.ipp b/host/include/uhd/property_tree.ipp
index 0fc871091..d0e127c5d 100644
--- a/host/include/uhd/property_tree.ipp
+++ b/host/include/uhd/property_tree.ipp
@@ -9,7 +9,6 @@
#pragma once
#include <uhd/exception.hpp>
-#include <typeindex>
#include <vector>
#include <memory>
@@ -181,8 +180,7 @@ template <typename T>
property<T>& property_tree::create(const fs_path& path, coerce_mode_t coerce_mode)
{
this->_create(path,
- typename std::shared_ptr<property<T> >(new property_impl<T>(coerce_mode)),
- std::type_index(typeid(T)));
+ typename std::shared_ptr<property<T> >(new property_impl<T>(coerce_mode)));
return this->access<T>(path);
}
@@ -190,7 +188,7 @@ template <typename T>
property<T>& property_tree::access(const fs_path& path)
{
return *std::static_pointer_cast<property<T> >(
- this->_access_with_type_check(path, std::type_index(typeid(T))));
+ this->_access(path));
}
template <typename T>