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. --- lib/usrp/mboard/test.cpp | 14 ++++---------- lib/usrp/usrp.cpp | 7 ++----- 2 files changed, 6 insertions(+), 15 deletions(-) (limited to 'lib/usrp') diff --git a/lib/usrp/mboard/test.cpp b/lib/usrp/mboard/test.cpp index a12560e9a..321ec0855 100644 --- a/lib/usrp/mboard/test.cpp +++ b/lib/usrp/mboard/test.cpp @@ -47,11 +47,8 @@ public: ~shell_dboard(void){} private: void get(const wax::type &key_, wax::type &val){ - //extract the index if key is a named prop - wax::type key = key_; std::string name = ""; - if (key.type() == typeid(named_prop_t)){ - boost::tie(key, name) = wax::cast(key); - } + wax::type key; std::string name; + tie(key, name) = extract_named_prop(key_); //handle the get request conditioned on the key switch(wax::cast(key)){ @@ -113,11 +110,8 @@ test::~test(void){ } void test::get(const wax::type &key_, wax::type &val){ - //extract the index if key is a named prop - wax::type key = key_; std::string name = ""; - if (key.type() == typeid(named_prop_t)){ - boost::tie(key, name) = wax::cast(key); - } + wax::type key; std::string name; + tie(key, name) = extract_named_prop(key_); //handle the get request conditioned on the key switch(wax::cast(key)){ diff --git a/lib/usrp/usrp.cpp b/lib/usrp/usrp.cpp index 02446c8d1..24ac2bccc 100644 --- a/lib/usrp/usrp.cpp +++ b/lib/usrp/usrp.cpp @@ -42,11 +42,8 @@ usrp::~usrp(void){ } void usrp::get(const wax::type &key_, wax::type &val){ - //extract the index if key is a named prop - wax::type key = key_; std::string name = ""; - if (key.type() == typeid(named_prop_t)){ - boost::tie(key, name) = wax::cast(key); - } + wax::type key; std::string name; + tie(key, name) = extract_named_prop(key_); //handle the get request conditioned on the key switch(wax::cast(key)){ -- cgit v1.2.3