From bca2f5a5abf62eb51eb7b6230e8877e17b86d91d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 26 Sep 2010 15:43:39 -0700 Subject: Display context assoc lists --- vrt/lib/expanded_if_context_section.cc | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'vrt/lib') diff --git a/vrt/lib/expanded_if_context_section.cc b/vrt/lib/expanded_if_context_section.cc index acefa5bdb..46c30be23 100644 --- a/vrt/lib/expanded_if_context_section.cc +++ b/vrt/lib/expanded_if_context_section.cc @@ -490,6 +490,28 @@ namespace vrt os << std::endl; } + + static void wr_cntx_list(std::ostream &os, const std::string &name, const std::vector &v) + { + if (v.empty()) + return; + + wr_name(os, " " + name); + for (size_t j = 0; j < v.size(); j++) + os << format("%#x ") % v[j]; + os << std::endl; + } + + static void wr_cntx_assoc_lists(std::ostream &os, const exp_context_assocs &x) + { + os << std::endl; + wr_cntx_list(os, "source", x.source); + wr_cntx_list(os, "system", x.system); + wr_cntx_list(os, "vector", x.vector_comp); + wr_cntx_list(os, "async_chan", x.async_channel); + wr_cntx_list(os, "async_tag", x.async_tag); + } + void expanded_if_context_section::write(std::ostream &os) const @@ -607,11 +629,13 @@ namespace vrt if (cif & CI_GPS_ASCII) if (!u.get_gps_ascii(e->gps_ascii)) return false; - - if (cif & CI_CNTX_ASSOC_LISTS) - if (!u.get_cntx_assoc_lists(e->cntx_assoc_lists)) - return false; #endif + + if (cif & CI_CNTX_ASSOC_LISTS){ + wr_name(os, "cntx_assoc_lists"); + wr_cntx_assoc_lists(os, cntx_assoc_lists); + } + } std::ostream& operator<<(std::ostream &os, const expanded_if_context_section &obj) -- cgit