diff options
author | Jacob Gilbert <mrjacobagilbert@gmail.com> | 2020-05-02 08:38:05 -0600 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-05-05 13:12:28 -0400 |
commit | 941c6c895a5724c142cfb0a32220885062373d57 (patch) | |
tree | 2570272007f0cc061a41bd1fed04cb7c7d11fa86 /gnuradio-runtime/lib/pmt/pmt_int.h | |
parent | 09b0db2b9852c9e9ab7606622d78d9bf83f584ef (diff) |
pmt: stop treating all pairs like they are dicts
create a new derived class for pmt dicts so they can be distinguished without complicated try/catch logic, updated QA with a few additional checks. also added an is_pdu() method which returns true if the pmt is a pair of a dict-type PMT and a uniform-vector type, otherwise false
Diffstat (limited to 'gnuradio-runtime/lib/pmt/pmt_int.h')
-rw-r--r-- | gnuradio-runtime/lib/pmt/pmt_int.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/pmt/pmt_int.h b/gnuradio-runtime/lib/pmt/pmt_int.h index c7dcb81193..cabd44e8c2 100644 --- a/gnuradio-runtime/lib/pmt/pmt_int.h +++ b/gnuradio-runtime/lib/pmt/pmt_int.h @@ -128,6 +128,15 @@ public: void set_cdr(pmt_t cdr) { d_cdr = cdr; } }; +class pmt_dict : public pmt_pair +{ +public: + pmt_dict(const pmt_t& car, const pmt_t& cdr); + //~pmt_dict(){}; + + bool is_dict() const { return true; } +}; + class pmt_vector : public pmt_base { std::vector<pmt_t> d_v; |