From cd42f1c9d373639880503ee97c041d1f0dcd974f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 27 Oct 2012 19:36:47 -0700 Subject: added support for the real PMC type (stub removed) need to create conversions still... --- .gitmodules | 3 +++ PMC | 1 + include/gnuradio/gr_tags.h | 3 ++- include/gnuradio/tags.hpp | 9 +++------ lib/CMakeLists.txt | 13 +++++++++++++ lib/gr_block.cpp | 9 +++++---- 6 files changed, 27 insertions(+), 11 deletions(-) create mode 160000 PMC diff --git a/.gitmodules b/.gitmodules index ed5ffe7..98a7640 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "Apology"] path = Apology url = https://github.com/guruofquality/Apology.git +[submodule "PMC"] + path = PMC + url = https://github.com/guruofquality/PMC.git diff --git a/PMC b/PMC new file mode 160000 index 0000000..cdff870 --- /dev/null +++ b/PMC @@ -0,0 +1 @@ +Subproject commit cdff8704f16ba4b4ce8532020d16cd831d259a88 diff --git a/include/gnuradio/gr_tags.h b/include/gnuradio/gr_tags.h index cb268da..ca45170 100644 --- a/include/gnuradio/gr_tags.h +++ b/include/gnuradio/gr_tags.h @@ -17,7 +17,8 @@ #ifndef INCLUDED_GR_TAGS_H #define INCLUDED_GR_TAGS_H -#include +#include +#include struct GRAS_API gr_tag_t { diff --git a/include/gnuradio/tags.hpp b/include/gnuradio/tags.hpp index c8eafba..bc83709 100644 --- a/include/gnuradio/tags.hpp +++ b/include/gnuradio/tags.hpp @@ -19,11 +19,8 @@ #include #include - -//TODO -- this is a stub for the PMC libray -#include -typedef pmt::pmt_t PMC; -typedef pmt::pmt_t PMCC; +#include +#include namespace gnuradio { @@ -37,7 +34,7 @@ struct GRAS_API Tag : boost::less_than_comparable Tag(const uint64_t &offset, const PMCC &key, const PMCC &value, const PMCC &srcid = PMCC()); //! the absolute item count associated with this tag - uint64_t offset; + boost::uint64_t offset; //! A symbolic name identifying the type of tag PMCC key; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index cfc957f..c9ba245 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -15,6 +15,19 @@ list(APPEND gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/register_messages.cpp #exports messages, must be first ) +######################################################################## +# Setup PMC Deps +######################################################################## +include_directories(${GRAS_SOURCE_DIR}/PMC/include) + +list(APPEND GNURADIO_CORE_INCLUDE_DIRS ${GRAS_SOURCE_DIR}/PMC/include) +GR_SET_GLOBAL(GNURADIO_CORE_INCLUDE_DIRS ${GNURADIO_CORE_INCLUDE_DIRS}) + +list(APPEND GNURADIO_CORE_SWIG_INCLUDE_DIRS ${GRAS_SOURCE_DIR}/PMC/include) +GR_SET_GLOBAL(GNURADIO_CORE_SWIG_INCLUDE_DIRS ${GNURADIO_CORE_SWIG_INCLUDE_DIRS}) + +add_subdirectory(${GRAS_SOURCE_DIR}/PMC ${CMAKE_BINARY_DIR}/PMC) + ######################################################################## # Setup Theron Deps ######################################################################## diff --git a/lib/gr_block.cpp b/lib/gr_block.cpp index 32d9a0c..f8c1d0d 100644 --- a/lib/gr_block.cpp +++ b/lib/gr_block.cpp @@ -150,19 +150,20 @@ bool gr_block::is_set_max_noutput_items(void) const } //TODO Tag2gr_tag and gr_tag2Tag need PMC to/from PMT logic +//currently PMC holds the pmt_t, this is temporary static gr_tag_t Tag2gr_tag(const gnuradio::Tag &tag) { gr_tag_t t; t.offset = tag.offset; - t.key = tag.key; - t.value = tag.value; - t.srcid = tag.srcid; + t.key = tag.key? tag.key.cast() : pmt::pmt_t(); + t.value = tag.value? tag.value.cast() : pmt::pmt_t(); + t.srcid = tag.srcid? tag.srcid.cast() : pmt::pmt_t(); return t; } static gnuradio::Tag gr_tag2Tag(const gr_tag_t &tag) { - return gnuradio::Tag(tag.offset, tag.key, tag.value, tag.srcid); + return gnuradio::Tag(tag.offset, PMC::make(tag.key), PMC::make(tag.value), PMC::make(tag.srcid)); } void gr_block::add_item_tag( -- cgit