summaryrefslogtreecommitdiff
path: root/vrt/lib/expanded_header.cc
diff options
context:
space:
mode:
authorEric Blossom2010-09-26 00:31:39 -0700
committerEric Blossom2010-09-27 14:56:43 -0700
commita1ae11b45a5236d44fd63bfc3f46ed77c0dce6be (patch)
treeadfc50e3aaf2cb66a04c267e8d2599fc962abb5a /vrt/lib/expanded_header.cc
parent3339d8dc40a90986f33ea095baa0a861fed32bb6 (diff)
downloadgnuradio-a1ae11b45a5236d44fd63bfc3f46ed77c0dce6be.tar.gz
gnuradio-a1ae11b45a5236d44fd63bfc3f46ed77c0dce6be.tar.bz2
gnuradio-a1ae11b45a5236d44fd63bfc3f46ed77c0dce6be.zip
Formatted output of IF context packets
Diffstat (limited to 'vrt/lib/expanded_header.cc')
-rw-r--r--vrt/lib/expanded_header.cc45
1 files changed, 35 insertions, 10 deletions
diff --git a/vrt/lib/expanded_header.cc b/vrt/lib/expanded_header.cc
index 1fddac8cb..85a27f830 100644
--- a/vrt/lib/expanded_header.cc
+++ b/vrt/lib/expanded_header.cc
@@ -151,20 +151,45 @@ namespace vrt {
return "<unknown pkt type>";
}
+ static void wr_name(std::ostream &os, const std::string &x)
+ {
+ os << format(" %-19s ") % (x + ":");
+ }
+
+ static void wr_uint32(std::ostream &os, uint32_t x)
+ {
+ os << format("%#10x") % x;
+ os << std::endl;
+ }
+
void
expanded_header::write(std::ostream &port) const
{
port << format("%s:\n") % pkt_type_name(this);
- if (1)
- port << format(" header: 0x%08x\n") % header;
- if (stream_id_p())
- port << format(" stream_id: %#10x\n") % stream_id;
- if (class_id_p())
- port << format(" class_id: 0x%016llx\n") % class_id;
- if (integer_secs_p())
- port << format(" int secs: %10d\n") % integer_secs;
- if (fractional_secs_p())
- port << format(" frac secs: %10d\n") % fractional_secs;
+ if (1){
+ wr_name(port, "header");
+ wr_uint32(port, header);
+ }
+
+ if (stream_id_p()){
+ wr_name(port, "stream_id");
+ wr_uint32(port, stream_id);
+ }
+
+ if (class_id_p()){
+ wr_name(port, "class_id");
+ port << format("0x%016llx\n") % class_id;
+ }
+
+ if (integer_secs_p()){
+ wr_name(port, "int secs");
+ port << format("%10d\n") % integer_secs;
+ }
+
+ if (fractional_secs_p()){
+ wr_name(port, "frac secs");
+ port << format("%10d\n") % fractional_secs;
+ }
}
std::ostream& operator<<(std::ostream &os, const expanded_header &obj)