summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/utils/props.hpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/host/include/uhd/utils/props.hpp b/host/include/uhd/utils/props.hpp
index bfbca4273..768655e36 100644
--- a/host/include/uhd/utils/props.hpp
+++ b/host/include/uhd/utils/props.hpp
@@ -29,24 +29,35 @@
namespace uhd{
- //typedef for handling named properties
+ //! The type for a vector of property names
typedef std::vector<std::string> prop_names_t;
- typedef boost::tuple<wax::obj, std::string> named_prop_t;
+
+ /*!
+ * A named prop struct holds a key and a name.
+ * Allows properties to be sub-sectioned by name.
+ */
+ struct UHD_API named_prop_t{
+ wax::obj key;
+ std::string name;
+
+ /*!
+ * Create a new named prop from key and name.
+ * \param key the property key
+ * \param name the string name
+ */
+ named_prop_t(const wax::obj &key, const std::string &name);
+ };
/*!
* Utility function to separate a named property into its components.
* \param key a reference to the prop object
* \param name a reference to the name object
+ * \return a tuple that can be used with boost::tie
*/
- inline UHD_API named_prop_t extract_named_prop(
+ UHD_API boost::tuple<wax::obj, std::string> extract_named_prop(
const wax::obj &key,
const std::string &name = ""
- ){
- if (key.type() == typeid(named_prop_t)){
- return key.as<named_prop_t>();
- }
- return named_prop_t(key, name);
- }
+ );
//! The exception to throw for property errors
struct UHD_API prop_error : virtual std::exception, virtual boost::exception{};