diff options
author | Eric Blossom | 2009-08-18 17:39:02 -0700 |
---|---|---|
committer | Eric Blossom | 2009-08-18 17:39:02 -0700 |
commit | 0f90ae17548c89a9ccde112948a6b57b54c2a01c (patch) | |
tree | 5bf6274372f126489b5625973187138e578c9d3d /gruel/src/lib/pmt/pmt.cc | |
parent | 30108b8cff313607bef51fda8d600cb4826a259e (diff) | |
download | gnuradio-0f90ae17548c89a9ccde112948a6b57b54c2a01c.tar.gz gnuradio-0f90ae17548c89a9ccde112948a6b57b54c2a01c.tar.bz2 gnuradio-0f90ae17548c89a9ccde112948a6b57b54c2a01c.zip |
Add pmt type that wraps a gruel::msg_accepter.
QA code doesn't link because pmt depends on msg and vice versa
Diffstat (limited to 'gruel/src/lib/pmt/pmt.cc')
-rw-r--r-- | gruel/src/lib/pmt/pmt.cc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gruel/src/lib/pmt/pmt.cc b/gruel/src/lib/pmt/pmt.cc index f0e3c30a2..5301529b2 100644 --- a/gruel/src/lib/pmt/pmt.cc +++ b/gruel/src/lib/pmt/pmt.cc @@ -26,8 +26,9 @@ #include <vector> #include <gruel/pmt.h> #include "pmt_int.h" -#include <stdio.h> +#include <gruel/msg_accepter.h> #include <gruel/pmt_pool.h> +#include <stdio.h> #include <string.h> namespace pmt { @@ -882,6 +883,36 @@ pmt_any_set(pmt_t obj, const boost::any &any) } //////////////////////////////////////////////////////////////////////////// +// msg_accepter -- built from "any" +//////////////////////////////////////////////////////////////////////////// + +bool +pmt_is_msg_accepter(const pmt_t &obj) +{ + if (!pmt_is_any(obj)) + return false; + + boost::any r = pmt_any_ref(obj); + return boost::any_cast<gruel::msg_accepter_sptr>(&r) != 0; +} + +//! make a msg_accepter +pmt_t +pmt_make_msg_accepter(gruel::msg_accepter_sptr ma) +{ + return pmt_make_any(ma); +} + +//! Return underlying msg_accepter +gruel::msg_accepter_sptr +pmt_msg_accepter_ref(const pmt_t &obj) +{ + return boost::any_cast<gruel::msg_accepter_sptr>(pmt_any_ref(obj)); +} + + + +//////////////////////////////////////////////////////////////////////////// // General Functions //////////////////////////////////////////////////////////////////////////// |