diff options
| author | Josh Blum <josh@joshknows.com> | 2010-03-15 17:00:04 +0000 | 
|---|---|---|
| committer | Josh Blum <josh@joshknows.com> | 2010-03-15 17:00:04 +0000 | 
| commit | 1bfb556262d12740c71e68a2a071e6e67ed2b3e7 (patch) | |
| tree | a081bfd3a61ccb42372a627be7b57ce19a3baa0d /host/lib/wax.cpp | |
| parent | 1b965831ae7588c7879d84de4e5fbd78ca614761 (diff) | |
| parent | fc40ff2f1327d01c72c4d7dbc07a14e473251981 (diff) | |
| download | uhd-1bfb556262d12740c71e68a2a071e6e67ed2b3e7.tar.gz uhd-1bfb556262d12740c71e68a2a071e6e67ed2b3e7.tar.bz2 uhd-1bfb556262d12740c71e68a2a071e6e67ed2b3e7.zip | |
Merge branch 'master' of git@ettus.sourcerepo.com:ettus/uhd into u1e_uhd
Conflicts:
	host/apps/CMakeLists.txt
	host/lib/usrp/usrp2/usrp2_impl.cpp
Diffstat (limited to 'host/lib/wax.cpp')
| -rw-r--r-- | host/lib/wax.cpp | 14 | 
1 files changed, 9 insertions, 5 deletions
| diff --git a/host/lib/wax.cpp b/host/lib/wax.cpp index c08398c50..0e2e82a3a 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 _obj_ptr->as<link_args_t>()(); +        }          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){ -        return wax::cast<link_args_t>(_obj_link)(); +    wax::obj & operator()(void) const{ +        return _obj_link.as<link_args_t>()();      } -    const wax::obj & key(void){ +    const wax::obj & key(void) const{          return _key;      }  private: @@ -90,7 +94,7 @@ wax::obj wax::obj::operator[](const obj &key){          obj val = resolve();          //check if its a special link and call          if (val.type() == typeid(link_args_t)){ -            return cast<link_args_t>(val)()[key]; +            return val.as<link_args_t>()()[key];          }          //unknown obj          throw std::runtime_error("cannot use [] on non wax::obj link"); | 
