From 36c3596197a484d9905b52fa2873a0cb51818a1b Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 21 Jun 2013 22:01:40 +0200 Subject: [PATCH] delete string_to_blob block --- grc/CMakeLists.txt | 1 - grc/foo_string_to_blob.xml | 19 ---------- include/foo/CMakeLists.txt | 1 - include/foo/string_to_blob.h | 38 -------------------- lib/CMakeLists.txt | 1 - lib/string_to_blob_impl.cc | 69 ------------------------------------ swig/foo_swig.i | 6 ++-- 7 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 grc/foo_string_to_blob.xml delete mode 100644 include/foo/string_to_blob.h delete mode 100644 lib/string_to_blob_impl.cc diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt index 431b864..da7bdf9 100644 --- a/grc/CMakeLists.txt +++ b/grc/CMakeLists.txt @@ -22,7 +22,6 @@ install(FILES foo_packet_dropper.xml foo_packet_pad.xml foo_periodic_msg_source.xml - foo_string_to_blob.xml foo_wireshark_connector.xml DESTINATION share/gnuradio/grc/blocks ) diff --git a/grc/foo_string_to_blob.xml b/grc/foo_string_to_blob.xml deleted file mode 100644 index 23dd522..0000000 --- a/grc/foo_string_to_blob.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - String to Blob - foo_string_to_blob - Foo - import foo - foo.string_to_blob() - - - in - message - - - - out - message - - diff --git a/include/foo/CMakeLists.txt b/include/foo/CMakeLists.txt index 8fba7e1..166431e 100644 --- a/include/foo/CMakeLists.txt +++ b/include/foo/CMakeLists.txt @@ -26,7 +26,6 @@ install(FILES packet_dropper.h packet_pad.h periodic_msg_source.h - string_to_blob.h wireshark_connector.h DESTINATION include/foo ) diff --git a/include/foo/string_to_blob.h b/include/foo/string_to_blob.h deleted file mode 100644 index f246d32..0000000 --- a/include/foo/string_to_blob.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013 Bastian Bloessl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef INCLUDED_FOO_STRING_TO_BLOB_H -#define INCLUDED_FOO_STRING_TO_BLOB_H - -#include -#include - -namespace gr { -namespace foo { - -class FOO_API string_to_blob : virtual public gr::block -{ -public: - - typedef boost::shared_ptr sptr; - static sptr make(); - -}; - -} // namespace foo -} // namespace gr - -#endif /* INCLUDED_FOO_STRING_TO_BLOB_H */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 7583511..6d57f98 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -30,7 +30,6 @@ list(APPEND foo_sources packet_dropper_impl.cc packet_pad_impl.cc periodic_msg_source_impl.cc - string_to_blob_impl.cc wireshark_connector_impl.cc ) diff --git a/lib/string_to_blob_impl.cc b/lib/string_to_blob_impl.cc deleted file mode 100644 index 7a5c786..0000000 --- a/lib/string_to_blob_impl.cc +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2013 Bastian Bloessl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include - -#include -#include -#include - -using namespace gr::foo; - -class string_to_blob_impl : public string_to_blob { - -public: - -string_to_blob_impl() : - block("string_to_blob", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(0, 0, 0)) { - - message_port_register_out(pmt::mp("out")); - - message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&string_to_blob_impl::make_blob, this, _1)); -} - -~string_to_blob_impl() { - -} - -void make_blob(pmt::pmt_t msg) { - - if(pmt::is_eof_object(msg)) { - message_port_pub(pmt::mp("out"), pmt::PMT_EOF); - detail().get()->set_done(true); - return; - } - - assert(pmt::is_symbol(msg)); - - int len = pmt::symbol_to_string(msg).length(); - const char *data = pmt::symbol_to_string(msg).data(); - - pmt::pmt_t blob = pmt::make_blob(data, len); - - message_port_pub(pmt::mp("out"), blob); -} - -}; - -string_to_blob::sptr -string_to_blob::make() { - return gnuradio::get_initial_sptr(new string_to_blob_impl()); -} - - diff --git a/swig/foo_swig.i b/swig/foo_swig.i index 9040e9f..b6d6bb5 100644 --- a/swig/foo_swig.i +++ b/swig/foo_swig.i @@ -10,7 +10,6 @@ #include "foo/packet_dropper.h" #include "foo/packet_pad.h" #include "foo/periodic_msg_source.h" -#include "foo/string_to_blob.h" #include "foo/wireshark_connector.h" %} @@ -19,12 +18,11 @@ %include "foo/packet_dropper.h" %include "foo/packet_pad.h" %include "foo/periodic_msg_source.h" -%include "foo/string_to_blob.h" %include "foo/wireshark_connector.h" + GR_SWIG_BLOCK_MAGIC2(foo, burst_tagger); GR_SWIG_BLOCK_MAGIC2(foo, packet_dropper); -GR_SWIG_BLOCK_MAGIC2(foo, wireshark_connector); GR_SWIG_BLOCK_MAGIC2(foo, packet_pad); GR_SWIG_BLOCK_MAGIC2(foo, periodic_msg_source); -GR_SWIG_BLOCK_MAGIC2(foo, string_to_blob); +GR_SWIG_BLOCK_MAGIC2(foo, wireshark_connector);