From 4b23b6102c182e4f5a8612e16752d34465bf190c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 6 Jun 2019 18:47:05 -0700 Subject: rfnoc: noc_block_base: Store property tree reference from make_args --- host/include/uhd/rfnoc/noc_block_base.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/noc_block_base.hpp b/host/include/uhd/rfnoc/noc_block_base.hpp index fb26f6089..e951ffc72 100644 --- a/host/include/uhd/rfnoc/noc_block_base.hpp +++ b/host/include/uhd/rfnoc/noc_block_base.hpp @@ -8,6 +8,7 @@ #define INCLUDED_LIBUHD_NOC_BLOCK_BASE_HPP #include +#include #include #include #include @@ -105,6 +106,12 @@ public: */ uhd::device_addr_t get_block_args() const { return _block_args; } + //! Return a reference to this block's subtree + uhd::property_tree::sptr& get_tree() const { return _tree; } + + //! Return a reference to this block's subtree (non-const version) + uhd::property_tree::sptr& get_tree() { return _tree; } + protected: noc_block_base(make_args_ptr make_args); @@ -192,6 +199,12 @@ private: //! Arguments that were passed into this block const uhd::device_addr_t _block_args; + //! Reference to this block's subtree + // + // It is mutable because _tree->access<>(..).get() is not const, but we + // need to do just that in some const contexts + mutable uhd::property_tree::sptr _tree; + }; // class noc_block_base }} /* namespace uhd::rfnoc */ -- cgit v1.2.3