summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/block.cc
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2018-08-07 23:38:25 +0200
committerMarcus Müller <marcus@hostalia.de>2018-08-26 18:21:27 +0200
commit79d6f970996aafd160fea4bcb519a54d846f0aa1 (patch)
treef63bd696123dce4f6d05c182c386e86e9bbec1b7 /gnuradio-runtime/lib/block.cc
parent1c5711e867c96f5f61615d440857af7d27e15de4 (diff)
runtime: replace compile-time debugging option by GR_LOG_DEBUG()
Add identifier() calls to flowgraph components to return a string with a human readable string to reuse in both: the std::ostream overload and the logging system.
Diffstat (limited to 'gnuradio-runtime/lib/block.cc')
-rw-r--r--gnuradio-runtime/lib/block.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gnuradio-runtime/lib/block.cc b/gnuradio-runtime/lib/block.cc
index 4c408ab7e..e0cc0b604 100644
--- a/gnuradio-runtime/lib/block.cc
+++ b/gnuradio-runtime/lib/block.cc
@@ -903,10 +903,14 @@ namespace gr {
#endif /* defined(GR_CTRLPORT) && defined(GR_PERFORMANCE_COUNTERS) */
}
+ std::string block::identifier() const {
+ return d_name + "(" + std::to_string(d_unique_id) + ")";
+ }
+
std::ostream&
operator << (std::ostream& os, const block *m)
{
- os << "<block " << m->name() << " (" << m->unique_id() << ")>";
+ os << "<block " << m->identifier() << ">";
return os;
}