From 053306f2934e6ac61f03783c36eeff6b2c5ffe0f Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 23 Jul 2019 10:12:41 -0700 Subject: rfnoc: actions: Add dictionary to all actions This can be used to set arbitrary key/value pairs on the action object. Easier to use than serialization, but doesn't require custom types, either. --- host/include/uhd/rfnoc/actions.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/actions.hpp b/host/include/uhd/rfnoc/actions.hpp index bc681360b..b713bbed3 100644 --- a/host/include/uhd/rfnoc/actions.hpp +++ b/host/include/uhd/rfnoc/actions.hpp @@ -8,6 +8,7 @@ #define INCLUDED_LIBUHD_RFNOC_ACTIONS_HPP #include +#include #include #include #include @@ -36,12 +37,16 @@ public: //! An arbitrary payload. It is up to consumers and producers to // (de-)serialize it. std::vector payload; + //! A dictionary of key-value pairs. May be used as desired. + uhd::device_addr_t args; //! Factory function - static sptr make(const std::string& key=""); + static sptr make(const std::string& key = "", + const uhd::device_addr_t& args = uhd::device_addr_t("")); protected: - action_info(const std::string& key); + action_info( + const std::string& key, const uhd::device_addr_t& args = uhd::device_addr_t("")); }; struct UHD_API stream_cmd_action_info : public action_info -- cgit v1.2.3