summaryrefslogtreecommitdiffstats
path: root/include/usrp_uhd/props.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/usrp_uhd/props.hpp')
-rw-r--r--include/usrp_uhd/props.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/usrp_uhd/props.hpp b/include/usrp_uhd/props.hpp
index 426554a53..b74493961 100644
--- a/include/usrp_uhd/props.hpp
+++ b/include/usrp_uhd/props.hpp
@@ -62,6 +62,18 @@ namespace usrp_uhd{
typedef boost::tuple<wax::type, std::string> named_prop_t;
/*!
+ * Utility function to separate a named property into its components.
+ * \param key a reference to the prop object
+ * \param name a reference to the name object
+ */
+ inline named_prop_t extract_named_prop(const wax::type &key, const std::string &name = ""){
+ if (key.type() == typeid(named_prop_t)){
+ return wax::cast<named_prop_t>(key);
+ }
+ return named_prop_t(key, name);
+ }
+
+ /*!
* Possible device properties:
* In general, a device will have a single mboard.
* In certain mimo applications, multiple boards