diff options
Diffstat (limited to 'host/lib/experts')
| -rw-r--r-- | host/lib/experts/expert_container.cpp | 7 | ||||
| -rw-r--r-- | host/lib/experts/expert_nodes.hpp | 27 | 
2 files changed, 32 insertions, 2 deletions
| diff --git a/host/lib/experts/expert_container.cpp b/host/lib/experts/expert_container.cpp index dc98ee4ed..edfc2ebe3 100644 --- a/host/lib/experts/expert_container.cpp +++ b/host/lib/experts/expert_container.cpp @@ -449,14 +449,17 @@ private:              //Only resolve if the starting node has passed              if (start_node_encountered) {                  dag_vertex_t& node = _get_vertex(*node_iter); +                std::string node_val;                  if (force or node.is_dirty()) {                      node.resolve();                      if (node.get_class() == CLASS_WORKER) {                          resolved_workers.push_back(&node);                      } -                    EX_LOG(1, str(boost::format("resolved node %s (%s)") % node.get_name() % (node.is_dirty()?"dirty":"clean"))); +                    EX_LOG(1, str(boost::format("resolved node %s (%s) [%s]") % +                                    node.get_name() % (node.is_dirty()?"dirty":"clean") % node.to_string()));                  } else { -                    EX_LOG(1, str(boost::format("skipped node %s (%s)") % node.get_name() % (node.is_dirty()?"dirty":"clean"))); +                    EX_LOG(1, str(boost::format("skipped node %s (%s) [%s]") % +                                    node.get_name() % (node.is_dirty()?"dirty":"clean") % node.to_string()));                  }              } diff --git a/host/lib/experts/expert_nodes.hpp b/host/lib/experts/expert_nodes.hpp index c89f4f3a8..dc5cc934b 100644 --- a/host/lib/experts/expert_nodes.hpp +++ b/host/lib/experts/expert_nodes.hpp @@ -59,6 +59,8 @@ namespace uhd { namespace experts {          virtual const std::string& get_dtype() const = 0; +        virtual std::string to_string() const = 0; +          // Graph resolution specific          virtual bool is_dirty() const = 0;          virtual void mark_clean() = 0; @@ -81,6 +83,23 @@ namespace uhd { namespace experts {          const std::string   _name;      }; +    class data_node_printer { +    public: +        //Generic implementation +        template<typename data_t> +        static std::string print(const data_t& val) { +            std::ostringstream os; +            os << val; +            return os.str(); +        } + +        static std::string print(const boost::uint8_t& val) { +            std::ostringstream os; +            os << int(val); +            return os.str(); +        } +    }; +      /*!---------------------------------------------------------       * class data_node_t       * @@ -120,6 +139,10 @@ namespace uhd { namespace experts {              return dtype;          } +        virtual std::string to_string() const { +            return data_node_printer::print(get()); +        } +          inline node_author_t get_author() const {              return _author;          } @@ -431,6 +454,10 @@ namespace uhd { namespace experts {              return dtype;          } +        virtual std::string to_string() const { +            return "<worker>"; +        } +          // Workers don't have callbacks so implement stubs          virtual void set_write_callback(const callback_func_t&) {}          virtual bool has_write_callback() const { return false; } | 
