aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/wax.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-11 18:37:34 -0800
committerJosh Blum <josh@joshknows.com>2010-03-11 18:37:34 -0800
commitdaed43a8a873ad5cc16ac8a3eb6db5a8fe126fa5 (patch)
tree72286b6649af0bf99e84edca08b584cb2e6af6ae /host/lib/wax.cpp
parent9c0fb5e15da3c8ccbc1c8537671703411b210fcf (diff)
downloaduhd-daed43a8a873ad5cc16ac8a3eb6db5a8fe126fa5.tar.gz
uhd-daed43a8a873ad5cc16ac8a3eb6db5a8fe126fa5.tar.bz2
uhd-daed43a8a873ad5cc16ac8a3eb6db5a8fe126fa5.zip
Cleaned up the gain handler (thing that gets and sets wildcard gains)
and made use of it in the dboard manager so it intercepts the sets and gets. While doing this, fixed something with nested links in wax obj. Added some useful macros and templates to the utils.
Diffstat (limited to 'host/lib/wax.cpp')
-rw-r--r--host/lib/wax.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/host/lib/wax.cpp b/host/lib/wax.cpp
index c08398c50..0348d9a66 100644
--- a/host/lib/wax.cpp
+++ b/host/lib/wax.cpp
@@ -36,7 +36,11 @@ public:
link_args_t(const wax::obj *obj_ptr) : _obj_ptr(obj_ptr){
/* NOP */
}
- wax::obj & operator()(void){
+ wax::obj & operator()(void) const{
+ //recursively resolve link args to get at original pointer
+ if (_obj_ptr->type() == typeid(link_args_t)){
+ return wax::cast<link_args_t>(*_obj_ptr)();
+ }
return *const_cast<wax::obj *>(_obj_ptr);
}
private:
@@ -56,10 +60,10 @@ public:
proxy_args_t(const wax::obj *obj_ptr, const wax::obj &key) : _key(key){
_obj_link = obj_ptr->get_link();
}
- wax::obj & operator()(void){
+ wax::obj & operator()(void) const{
return wax::cast<link_args_t>(_obj_link)();
}
- const wax::obj & key(void){
+ const wax::obj & key(void) const{
return _key;
}
private: