diff options
Diffstat (limited to 'lib/usrp')
-rw-r--r-- | lib/usrp/mboard/test.cpp | 14 | ||||
-rw-r--r-- | lib/usrp/usrp.cpp | 7 |
2 files changed, 6 insertions, 15 deletions
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<named_prop_t>(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<dboard_prop_t>(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<named_prop_t>(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<mboard_prop_t>(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<named_prop_t>(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<device_prop_t>(key)){ |