From d5d9da3114bf069c05a8dcb7fca32ccd70405512 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 28 Jan 2010 19:54:55 -0800 Subject: Added gain handler class to manage wildcard gain settings. Gets overall gains and sets overall gains when used. Wild card gain will be a gain with an empty string name. --- include/usrp_uhd/props.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/usrp_uhd/props.hpp') 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 @@ -61,6 +61,18 @@ namespace usrp_uhd{ typedef std::vector prop_names_t; typedef boost::tuple 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(key); + } + return named_prop_t(key, name); + } + /*! * Possible device properties: * In general, a device will have a single mboard. -- cgit v1.2.3