From e4997af8453980922b469e5d3b66a7b26910dad3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 15 Mar 2010 16:00:07 -0700 Subject: Ability to burn mac addr and ip addr to usrp2 (over ip/udp for now). Added firmware support and usrp2 burner host app. --- host/include/uhd/wax.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/wax.hpp b/host/include/uhd/wax.hpp index 1d5054351..4fd54ba14 100644 --- a/host/include/uhd/wax.hpp +++ b/host/include/uhd/wax.hpp @@ -124,6 +124,17 @@ namespace wax{ */ const std::type_info & type(void) const; + /*! + * Cast this obj into the desired type. + * Usage myobj.as() + * + * \return an object of the desired type + * \throw wax::bad_cast when the cast fails + */ + template T as(void) const{ + return boost::any_cast(resolve()); + } + private: //private interface (override in subclasses) virtual void get(const obj &, obj &); @@ -137,7 +148,6 @@ namespace wax{ * \return a boost any type with contents */ boost::any resolve(void) const; - template friend T cast(const obj &); //private contents of this obj boost::any _contents; @@ -159,7 +169,7 @@ namespace wax{ * \throw wax::bad_cast when the cast fails */ template T cast(const obj &val){ - return boost::any_cast(val.resolve()); + return val.as(); } } //namespace wax -- cgit v1.2.3