summaryrefslogtreecommitdiffstats
path: root/include/usrp_uhd/utils.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-01-26 11:29:14 -0800
committerJosh Blum <josh@joshknows.com>2010-01-26 11:29:14 -0800
commita98e387578a3aceb15e2bcce4a9cc54d78c30dda (patch)
treeb5e34c422c36a16a3f2379698e81af4c00a66ee3 /include/usrp_uhd/utils.hpp
parent998aebf83c2796fdfabc2efd804ca14103adcaaf (diff)
downloaduhd-a98e387578a3aceb15e2bcce4a9cc54d78c30dda.tar.gz
uhd-a98e387578a3aceb15e2bcce4a9cc54d78c30dda.tar.bz2
uhd-a98e387578a3aceb15e2bcce4a9cc54d78c30dda.zip
Switched from indexed properties to named properties.
Added some new properties for getting a list of antenna names, pps sources, ref sources...
Diffstat (limited to 'include/usrp_uhd/utils.hpp')
-rw-r--r--include/usrp_uhd/utils.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/usrp_uhd/utils.hpp b/include/usrp_uhd/utils.hpp
new file mode 100644
index 000000000..6fe5bd4d4
--- /dev/null
+++ b/include/usrp_uhd/utils.hpp
@@ -0,0 +1,30 @@
+//
+// Copyright 2010 Ettus Research LLC
+//
+
+#include <boost/foreach.hpp>
+#include <map>
+#include <vector>
+
+#ifndef INCLUDED_USRP_UHD_UTILS_HPP
+#define INCLUDED_USRP_UHD_UTILS_HPP
+
+namespace usrp_uhd{
+
+template <class Key, class T>
+std::vector<Key> get_map_keys(const std::map<Key, T> &m){
+ std::vector<Key> v;
+ std::pair<Key, T> p;
+ BOOST_FOREACH(p, m){
+ v.push_back(p.first);
+ }
+ return v;
+}
+
+//TODO check name in vector of names
+
+//TODO optionally extract a name from the named_prop_t
+
+} //namespace usrp_uhd
+
+#endif /* INCLUDED_USRP_UHD_UTILS_HPP */