summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2012-10-27 19:36:47 -0700
committerJosh Blum2012-10-27 19:36:47 -0700
commitcd42f1c9d373639880503ee97c041d1f0dcd974f (patch)
treec507f7db4e077d6d7c741ca3238e6c8f0dc87f63
parent2a1966462484cf1cb25ea7802cc0d9a8e80096c9 (diff)
downloadsandhi-cd42f1c9d373639880503ee97c041d1f0dcd974f.tar.gz
sandhi-cd42f1c9d373639880503ee97c041d1f0dcd974f.tar.bz2
sandhi-cd42f1c9d373639880503ee97c041d1f0dcd974f.zip
added support for the real PMC type (stub removed)
need to create conversions still...
-rw-r--r--.gitmodules3
m---------PMC0
-rw-r--r--include/gnuradio/gr_tags.h3
-rw-r--r--include/gnuradio/tags.hpp9
-rw-r--r--lib/CMakeLists.txt13
-rw-r--r--lib/gr_block.cpp9
6 files changed, 26 insertions, 11 deletions
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
+Subproject cdff8704f16ba4b4ce8532020d16cd831d259a8
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 <gnuradio/tags.hpp>
+#include <gnuradio/gras.hpp>
+#include <gruel/pmt.h>
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 <gnuradio/gras.hpp>
#include <boost/operators.hpp>
-
-//TODO -- this is a stub for the PMC libray
-#include <gruel/pmt.h>
-typedef pmt::pmt_t PMC;
-typedef pmt::pmt_t PMCC;
+#include <PMC/PMC.hpp>
+#include <boost/cstdint.hpp>
namespace gnuradio
{
@@ -37,7 +34,7 @@ struct GRAS_API Tag : boost::less_than_comparable<Tag>
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
@@ -16,6 +16,19 @@ list(APPEND gnuradio_core_sources
)
########################################################################
+# 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
########################################################################
set(THERON_SOURCE_DIR ${GRAS_SOURCE_DIR}/Theron)
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>() : pmt::pmt_t();
+ t.value = tag.value? tag.value.cast<pmt::pmt_t>() : pmt::pmt_t();
+ t.srcid = tag.srcid? tag.srcid.cast<pmt::pmt_t>() : 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(