summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-15 16:00:07 -0700
committerJosh Blum <josh@joshknows.com>2010-03-15 16:00:07 -0700
commite4997af8453980922b469e5d3b66a7b26910dad3 (patch)
treef19255b35f70670f7674334299453189b2c2a880 /host/include
parent7590f187d0414fd05e23828488166bc4bc88df26 (diff)
downloaduhd-e4997af8453980922b469e5d3b66a7b26910dad3.tar.gz
uhd-e4997af8453980922b469e5d3b66a7b26910dad3.tar.bz2
uhd-e4997af8453980922b469e5d3b66a7b26910dad3.zip
Ability to burn mac addr and ip addr to usrp2 (over ip/udp for now).
Added firmware support and usrp2 burner host app.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/wax.hpp14
1 files changed, 12 insertions, 2 deletions
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<type>()
+ *
+ * \return an object of the desired type
+ * \throw wax::bad_cast when the cast fails
+ */
+ template<class T> T as(void) const{
+ return boost::any_cast<T>(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<class T> 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<class T> T cast(const obj &val){
- return boost::any_cast<T>(val.resolve());
+ return val.as<T>();
}
} //namespace wax