summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt58
m---------gnuradio0
-rw-r--r--include/gnuradio/gr_block.h141
-rw-r--r--include/gnuradio/gr_hier_block2.h49
-rw-r--r--include/gnuradio/gr_io_signature.h85
-rw-r--r--include/gnuradio/gr_sync_block.h55
-rw-r--r--include/gnuradio/gr_sync_decimator.h36
-rw-r--r--include/gnuradio/gr_sync_interpolator.h36
-rw-r--r--include/gnuradio/gr_tags.h46
-rw-r--r--include/gnuradio/gr_top_block.h48
-rw-r--r--include/gnuradio/gr_types.h45
-rw-r--r--include/gnuradio/gr_vmcircbuf.h10
-rw-r--r--include/gnuradio/gras.hpp39
-rw-r--r--include/gras/block.hpp (renamed from include/gnuradio/block.hpp)16
-rw-r--r--include/gras/element.hpp (renamed from include/gnuradio/element.hpp)22
-rw-r--r--include/gras/gras.hpp69
-rw-r--r--include/gras/hier_block.hpp (renamed from include/gnuradio/hier_block.hpp)12
-rw-r--r--include/gras/io_signature.hpp (renamed from include/gnuradio/io_signature.hpp)10
-rw-r--r--include/gras/sbuffer.hpp (renamed from include/gnuradio/sbuffer.hpp)14
-rw-r--r--include/gras/sbuffer.ipp (renamed from include/gnuradio/sbuffer.ipp)10
-rw-r--r--include/gras/tags.hpp (renamed from include/gnuradio/tags.hpp)12
-rw-r--r--include/gras/thread_pool.hpp (renamed from include/gnuradio/thread_pool.hpp)12
-rw-r--r--include/gras/top_block.hpp (renamed from include/gnuradio/top_block.hpp)12
-rw-r--r--lib/CMakeLists.txt156
-rw-r--r--lib/block.cpp6
-rw-r--r--lib/block_actor.cpp4
-rw-r--r--lib/block_allocator.cpp2
-rw-r--r--lib/block_handlers.cpp2
-rw-r--r--lib/block_task.cpp2
-rw-r--r--lib/element.cpp4
-rw-r--r--lib/element_impl.hpp8
-rw-r--r--lib/gr_block.cpp213
-rw-r--r--lib/gr_hier_block2.cpp41
-rw-r--r--lib/gr_sync_block.cpp75
-rw-r--r--lib/gr_top_block.cpp69
-rw-r--r--lib/gras_impl/bitset.hpp6
-rw-r--r--lib/gras_impl/block_actor.hpp12
-rw-r--r--lib/gras_impl/buffer_queue.hpp6
-rw-r--r--lib/gras_impl/input_buffer_queues.hpp6
-rw-r--r--lib/gras_impl/interruptible_thread.hpp6
-rw-r--r--lib/gras_impl/messages.hpp54
-rw-r--r--lib/gras_impl/output_buffer_queues.hpp4
-rw-r--r--lib/gras_impl/token.hpp4
-rw-r--r--lib/hier_block.cpp4
-rw-r--r--lib/input_handlers.cpp2
-rw-r--r--lib/output_handlers.cpp2
-rw-r--r--lib/pmx_helper.hpp263
-rw-r--r--lib/register_messages.cpp38
-rw-r--r--lib/sbuffer.cpp6
-rw-r--r--lib/tag_handlers.hpp4
-rw-r--r--lib/tags.cpp6
-rw-r--r--lib/theron_allocator.cpp2
-rw-r--r--lib/top_block.cpp4
-rw-r--r--lib/topology_handler.cpp2
55 files changed, 315 insertions, 1538 deletions
diff --git a/.gitmodules b/.gitmodules
index 98a7640..57f9896 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "gnuradio"]
- path = gnuradio
- url = https://github.com/guruofquality/gnuradio.git
[submodule "Theron"]
path = Theron
url = https://github.com/guruofquality/Theron.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..8ae84e9
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,58 @@
+########################################################################
+# Project setup
+########################################################################
+cmake_minimum_required(VERSION 2.6)
+project(gras CXX C)
+enable_testing()
+
+#select the release build type by default to get optimization flags
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Release")
+ message(STATUS "Build type not specified: defaulting to release.")
+endif(NOT CMAKE_BUILD_TYPE)
+set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
+
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_definitions(-DGRAS_DEBUG)
+endif()
+
+set(GRAS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(LIBVER 0.0.0)
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ add_definitions(-Wall)
+ add_definitions(-fvisibility=hidden)
+ add_definitions(-fvisibility-inlines-hidden)
+endif()
+
+add_definitions(-DGRAS_DLL=1) #this project builds a dll
+
+########################################################################
+# Component names for install rules
+########################################################################
+if (NOT DEFINED GRAS_COMP_DEVEL)
+ set(GRAS_COMP_DEVEL "devel")
+endif()
+if (NOT DEFINED GRAS_COMP_RUNTIME)
+ set(GRAS_COMP_RUNTIME "runtime")
+endif()
+if (NOT DEFINED GRAS_COMP_PYTHON)
+ set(GRAS_COMP_PYTHON "python")
+endif()
+
+########################################################################
+# Setup PMC Deps
+########################################################################
+set(PMC_COMP_DEVEL ${GRAS_COMP_DEVEL})
+set(PMC_COMP_RUNTIME ${GRAS_COMP_RUNTIME})
+set(PMC_COMP_PYTHON ${GRAS_COMP_PYTHON})
+
+list(APPEND CMAKE_MODULE_PATH ${GRAS_SOURCE_DIR}/PMC/cmake/Modules)
+include_directories(${GRAS_SOURCE_DIR}/PMC/include)
+add_subdirectory(PMC)
+
+########################################################################
+# Add subdirectories
+########################################################################
+add_subdirectory(lib)
diff --git a/gnuradio b/gnuradio
deleted file mode 160000
-Subproject 517b057e732eee9504510f1171d44c98f1ceec9
diff --git a/include/gnuradio/gr_block.h b/include/gnuradio/gr_block.h
deleted file mode 100644
index 8e0c40e..0000000
--- a/include/gnuradio/gr_block.h
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_BLOCK_H
-#define INCLUDED_GNURADIO_GR_BLOCK_H
-
-#include <gnuradio/block.hpp>
-#include <gnuradio/gr_io_signature.h>
-#include <gnuradio/gr_types.h>
-#include <gnuradio/gr_tags.h>
-#include <string>
-
-typedef std::vector<int> gr_vector_int;
-typedef std::vector<void *> gr_vector_void_star;
-typedef std::vector<const void *> gr_vector_const_void_star;
-
-namespace gnuradio
-{
-//! dummy entry, just here for legacy purposes
-template <typename T>
-boost::shared_ptr<T> get_initial_sptr(T *p)
-{
- return boost::shared_ptr<T>(p);
-}
-}
-
-struct GRAS_API gr_block : gnuradio::Block
-{
-
- gr_block(void);
-
- gr_block(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
- );
-
- template <typename T> void set_msg_handler(T msg_handler){/*LOL*/}
-
- //! implements work -> calls general work
- int work(
- const InputItems &input_items,
- const OutputItems &output_items
- );
-
- //! Overload me! I am the forecast
- virtual void forecast(int, std::vector<int> &);
-
- /*!
- * \brief compute output items from input items
- *
- * \param noutput_items number of output items to write on each output stream
- * \param ninput_items number of input items available on each input stream
- * \param input_items vector of pointers to the input items, one entry per input stream
- * \param output_items vector of pointers to the output items, one entry per output stream
- *
- * \returns number of items actually written to each output stream, or -1 on EOF.
- * It is OK to return a value less than noutput_items. -1 <= return value <= noutput_items
- *
- * general_work must call consume or consume_each to indicate how many items
- * were consumed on each input stream.
- */
- virtual int general_work(
- int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items
- );
-
- void add_item_tag(
- const size_t which_output, const gr_tag_t &tag
- );
-
- void add_item_tag(
- const size_t which_output,
- uint64_t abs_offset,
- const pmt::pmt_t &key,
- const pmt::pmt_t &value,
- const pmt::pmt_t &srcid=pmt::PMT_F
- );
-
- void get_tags_in_range(
- std::vector<gr_tag_t> &tags,
- const size_t which_input,
- uint64_t abs_start,
- uint64_t abs_end,
- const pmt::pmt_t &key = pmt::pmt_t()
- );
-
- unsigned history(void) const;
-
- void set_history(unsigned history);
-
- void set_alignment(const size_t alignment);
-
- bool is_unaligned(void);
-
- size_t fixed_rate_noutput_to_ninput(const size_t noutput_items);
-
- size_t interpolation(void) const;
-
- void set_interpolation(const size_t);
-
- size_t decimation(void) const;
-
- void set_decimation(const size_t);
-
- int max_noutput_items(void) const;
-
- void set_max_noutput_items(int);
-
- void unset_max_noutput_items(void);
-
- bool is_set_max_noutput_items(void) const;
-
- ///////////// TODO //////////////////////
- void set_max_output_buffer(long){}
- void set_max_output_buffer(int, long){}
- long max_output_buffer(size_t){return 0;}
- void set_min_output_buffer(long){}
- void set_min_output_buffer(int, long){}
- long min_output_buffer(size_t){return 0;}
-
-};
-
-typedef boost::shared_ptr<gr_block> gr_block_sptr;
-
-#endif /*INCLUDED_GNURADIO_GR_BLOCK_H*/
diff --git a/include/gnuradio/gr_hier_block2.h b/include/gnuradio/gr_hier_block2.h
deleted file mode 100644
index 956cb1d..0000000
--- a/include/gnuradio/gr_hier_block2.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_HIER_BLOCK2_H
-#define INCLUDED_GNURADIO_GR_HIER_BLOCK2_H
-
-#include <gnuradio/hier_block.hpp>
-#include <gnuradio/gr_io_signature.h>
-
-struct GRAS_API gr_hier_block2 : gnuradio::HierBlock
-{
-
- gr_hier_block2(void);
-
- gr_hier_block2(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
- );
-
- const gr_hier_block2 &self(void) const
- {
- return *this;
- }
-
-};
-
-typedef boost::shared_ptr<gr_hier_block2> gr_hier_block2_sptr;
-
-GRAS_API gr_hier_block2_sptr gr_make_hier_block2(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
-);
-
-#endif /*INCLUDED_GNURADIO_GR_HIER_BLOCK2_H*/
diff --git a/include/gnuradio/gr_io_signature.h b/include/gnuradio/gr_io_signature.h
deleted file mode 100644
index 0b32efb..0000000
--- a/include/gnuradio/gr_io_signature.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_IO_SIGNATURE_H
-#define INCLUDED_GNURADIO_GR_IO_SIGNATURE_H
-
-#include <gnuradio/io_signature.hpp>
-#include <vector>
-
-typedef gnuradio::IOSignature gr_io_signature;
-typedef gr_io_signature gr_io_signature_sptr;
-
-inline gr_io_signature_sptr gr_make_io_signature(
- int min_streams,
- int max_streams,
- int sizeof_stream_item
-){
- gnuradio::IOSignature io_sig(min_streams, max_streams);
-
- if (io_sig.max_streams() != gr_io_signature::IO_INFINITE)
- {
- io_sig.resize(io_sig.max_streams(), sizeof_stream_item);
- }
- else
- {
- io_sig.resize(1, sizeof_stream_item);
- }
-
- return io_sig;
-}
-
-inline gr_io_signature_sptr gr_make_io_signature2(
- int min_streams,
- int max_streams,
- int sizeof_stream_item1,
- int sizeof_stream_item2
-){
- gnuradio::IOSignature io_sig(min_streams, max_streams);
- io_sig.push_back(sizeof_stream_item1);
- io_sig.push_back(sizeof_stream_item2);
- return io_sig;
-}
-
-inline gr_io_signature_sptr gr_make_io_signature3(
- int min_streams,
- int max_streams,
- int sizeof_stream_item1,
- int sizeof_stream_item2,
- int sizeof_stream_item3
-){
- gnuradio::IOSignature io_sig(min_streams, max_streams);
- io_sig.push_back(sizeof_stream_item1);
- io_sig.push_back(sizeof_stream_item2);
- io_sig.push_back(sizeof_stream_item3);
- return io_sig;
-}
-
-template <typename T>
-inline gr_io_signature_sptr gr_make_io_signaturev(
- int min_streams,
- int max_streams,
- const std::vector<T> &sizeof_stream_items
-){
- gnuradio::IOSignature io_sig(min_streams, max_streams);
- for (unsigned i = 0; i < sizeof_stream_items.size(); i++)
- {
- io_sig.push_back(sizeof_stream_items[i]);
- }
- return io_sig;
-}
-
-#endif /*INCLUDED_GNURADIO_GR_IO_SIGNATURE_H*/
diff --git a/include/gnuradio/gr_sync_block.h b/include/gnuradio/gr_sync_block.h
deleted file mode 100644
index cb81e67..0000000
--- a/include/gnuradio/gr_sync_block.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_SYNC_BLOCK_H
-#define INCLUDED_GNURADIO_GR_SYNC_BLOCK_H
-
-#include <gnuradio/gr_block.h>
-
-struct GRAS_API gr_sync_block : public gr_block
-{
- gr_sync_block(void);
-
- gr_sync_block(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
- );
-
- //! implements work -> calls work
- inline int general_work(
- int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items
- ){
- return this->work(noutput_items, input_items, output_items);
- }
-
- /*!
- * \brief just like gr_block::general_work, only this arranges to call consume_each for you
- *
- * The user must override work to define the signal processing code
- */
- virtual int work(
- int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items
- );
-
-};
-
-#endif /*INCLUDED_GNURADIO_GR_SYNC_BLOCK_H*/
diff --git a/include/gnuradio/gr_sync_decimator.h b/include/gnuradio/gr_sync_decimator.h
deleted file mode 100644
index 43f94be..0000000
--- a/include/gnuradio/gr_sync_decimator.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_SYNC_DECIMATOR_H
-#define INCLUDED_GNURADIO_GR_SYNC_DECIMATOR_H
-
-#include <gnuradio/gr_sync_block.h>
-
-struct GRAS_API gr_sync_decimator : gr_sync_block
-{
-
- gr_sync_decimator(void);
-
- gr_sync_decimator(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature,
- const size_t decim_rate
- );
-
-};
-
-#endif /*INCLUDED_GNURADIO_GR_SYNC_DECIMATOR_H*/
diff --git a/include/gnuradio/gr_sync_interpolator.h b/include/gnuradio/gr_sync_interpolator.h
deleted file mode 100644
index b165ce8..0000000
--- a/include/gnuradio/gr_sync_interpolator.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_SYNC_INTERPOLATOR_H
-#define INCLUDED_GNURADIO_GR_SYNC_INTERPOLATOR_H
-
-#include <gnuradio/gr_sync_block.h>
-
-struct GRAS_API gr_sync_interpolator : gr_sync_block
-{
-
- gr_sync_interpolator(void);
-
- gr_sync_interpolator(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature,
- const size_t interp_rate
- );
-
-};
-
-#endif /*INCLUDED_GNURADIO_GR_SYNC_INTERPOLATOR_H*/
diff --git a/include/gnuradio/gr_tags.h b/include/gnuradio/gr_tags.h
deleted file mode 100644
index ca45170..0000000
--- a/include/gnuradio/gr_tags.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GR_TAGS_H
-#define INCLUDED_GR_TAGS_H
-
-#include <gnuradio/gras.hpp>
-#include <gruel/pmt.h>
-
-struct GRAS_API gr_tag_t
-{
-
- //! the item \p tag occurred at (as a uint64_t)
- uint64_t offset;
-
- //! the key of \p tag (as a PMT symbol)
- pmt::pmt_t key;
-
- //! the value of \p tag (as a PMT)
- pmt::pmt_t value;
-
- //! the source ID of \p tag (as a PMT)
- pmt::pmt_t srcid;
-
- //! Comparison function to test which tag, \p x or \p y, came first in time
- static inline bool offset_compare(
- const gr_tag_t &x, const gr_tag_t &y
- ){
- return x.offset < y.offset;
- }
-};
-
-#endif /*INCLUDED_GR_TAGS_H*/
diff --git a/include/gnuradio/gr_top_block.h b/include/gnuradio/gr_top_block.h
deleted file mode 100644
index b50b35b..0000000
--- a/include/gnuradio/gr_top_block.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GR_TOP_BLOCK_H
-#define INCLUDED_GNURADIO_GR_TOP_BLOCK_H
-
-#include <gnuradio/top_block.hpp>
-#include <gnuradio/gr_hier_block2.h>
-
-struct GRAS_API gr_top_block : gnuradio::TopBlock
-{
-
- gr_top_block(void);
-
- gr_top_block(const std::string &name);
-
- void start(void);
-
- void start(const size_t max_items);
-
- void run(void);
-
- void run(const size_t max_items);
-
- int max_noutput_items(void) const;
-
- void set_max_noutput_items(int max_items);
-
-};
-
-typedef boost::shared_ptr<gr_top_block> gr_top_block_sptr;
-
-GRAS_API gr_top_block_sptr gr_make_top_block(const std::string &name);
-
-#endif /*INCLUDED_GNURADIO_GR_TOP_BLOCK_H*/
diff --git a/include/gnuradio/gr_types.h b/include/gnuradio/gr_types.h
deleted file mode 100644
index 872cadc..0000000
--- a/include/gnuradio/gr_types.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GRNURADIO_TYPES_H
-#define INCLUDED_GRNURADIO_TYPES_H
-
-// this section is to satisfy swig includes for gnuradio.i
-// since gnuradio.i includes gr_types.h, we only have to edit this file
-#include <gnuradio/io_signature.hpp>
-#include <gnuradio/element.hpp>
-#include <gnuradio/block.hpp>
-#include <gnuradio/top_block.hpp>
-#include <gnuradio/hier_block.hpp>
-
-// and gnuradio apparently needs its own typedefs for stdint...
-#ifdef __cplusplus
-
-#include <boost/cstdint.hpp>
-typedef boost::int16_t gr_int16;
-typedef boost::int32_t gr_int32;
-typedef boost::int64_t gr_int64;
-typedef boost::uint16_t gr_uint16;
-typedef boost::uint32_t gr_uint32;
-typedef boost::uint64_t gr_uint64;
-
-#include <complex>
-typedef std::complex<float> gr_complex;
-typedef std::complex<double> gr_complexd;
-
-#endif
-
-#endif /* INCLUDED_GRNURADIO_TYPES_H */
diff --git a/include/gnuradio/gr_vmcircbuf.h b/include/gnuradio/gr_vmcircbuf.h
deleted file mode 100644
index 7c58fcc..0000000
--- a/include/gnuradio/gr_vmcircbuf.h
+++ /dev/null
@@ -1,10 +0,0 @@
-
-//totally bogus so I dont have to change gnuradio-core/src/tests/CMakeLists.txt
-
-struct gr_vmcircbuf_sysconfig
-{
- static bool test_all_factories(int)
- {
- return true;
- }
-};
diff --git a/include/gnuradio/gras.hpp b/include/gnuradio/gras.hpp
deleted file mode 100644
index 1712ed4..0000000
--- a/include/gnuradio/gras.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_GNURADIO_GRAS_HPP
-#define INCLUDED_GNURADIO_GRAS_HPP
-
-#include <ciso646>
-
-//this is part of core for now, treat it as such
-#include <gr_core_api.h>
-#define GRAS_API GR_CORE_API
-
-#define GRAS_MAX_ALIGNMENT 32
-
-//define cross platform attribute macros
-#if defined(GRAS_DEBUG)
- #define GRAS_FORCE_INLINE inline
-#elif defined(BOOST_MSVC)
- #define GRAS_FORCE_INLINE __forceinline
-#elif defined(__GNUG__) && __GNUG__ >= 4
- #define GRAS_FORCE_INLINE inline __attribute__((always_inline))
-#else
- #define GRAS_FORCE_INLINE inline
-#endif
-
-#endif /*INCLUDED_GNURADIO_GRAS_HPP*/
diff --git a/include/gnuradio/block.hpp b/include/gras/block.hpp
index bcce34a..983d54a 100644
--- a/include/gnuradio/block.hpp
+++ b/include/gras/block.hpp
@@ -14,17 +14,17 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_BLOCK_HPP
-#define INCLUDED_GNURADIO_BLOCK_HPP
+#ifndef INCLUDED_GRAS_BLOCK_HPP
+#define INCLUDED_GRAS_BLOCK_HPP
-#include <gnuradio/element.hpp>
-#include <gnuradio/sbuffer.hpp>
-#include <gnuradio/tags.hpp>
+#include <gras/element.hpp>
+#include <gras/sbuffer.hpp>
+#include <gras/tags.hpp>
#include <vector>
#include <string>
#include <boost/range.hpp> //iterator range
-namespace gnuradio
+namespace gras
{
//! Configuration parameters for an input port
@@ -315,6 +315,6 @@ struct GRAS_API Block : Element
};
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_BLOCK_HPP*/
+#endif /*INCLUDED_GRAS_BLOCK_HPP*/
diff --git a/include/gnuradio/element.hpp b/include/gras/element.hpp
index abf0e34..3142510 100644
--- a/include/gnuradio/element.hpp
+++ b/include/gras/element.hpp
@@ -14,15 +14,15 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_ELEMENT_HPP
-#define INCLUDED_GNURADIO_ELEMENT_HPP
+#ifndef INCLUDED_GRAS_ELEMENT_HPP
+#define INCLUDED_GRAS_ELEMENT_HPP
-#include <gnuradio/gras.hpp>
-#include <gnuradio/io_signature.hpp>
+#include <gras/gras.hpp>
+#include <gras/io_signature.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
-namespace gnuradio
+namespace gras
{
class ElementImpl;
@@ -61,16 +61,16 @@ struct GRAS_API Element : boost::shared_ptr<ElementImpl>, boost::enable_shared_f
//! get a canonical name for this element
std::string to_string(void) const;
- void set_output_signature(const gnuradio::IOSignature &sig);
+ void set_output_signature(const gras::IOSignature &sig);
- void set_input_signature(const gnuradio::IOSignature &sig);
+ void set_input_signature(const gras::IOSignature &sig);
- const gnuradio::IOSignature &input_signature(void) const;
+ const gras::IOSignature &input_signature(void) const;
- const gnuradio::IOSignature &output_signature(void) const;
+ const gras::IOSignature &output_signature(void) const;
};
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_ELEMENT_HPP*/
+#endif /*INCLUDED_GRAS_ELEMENT_HPP*/
diff --git a/include/gras/gras.hpp b/include/gras/gras.hpp
new file mode 100644
index 0000000..bbeffba
--- /dev/null
+++ b/include/gras/gras.hpp
@@ -0,0 +1,69 @@
+//
+// Copyright 2012 Josh Blum
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef INCLUDED_GRAS_GRAS_HPP
+#define INCLUDED_GRAS_GRAS_HPP
+
+#include <ciso646>
+
+// http://gcc.gnu.org/wiki/Visibility
+// Generic helper definitions for shared library support
+#if defined _WIN32 || defined __CYGWIN__
+ #define GRAS_HELPER_DLL_IMPORT __declspec(dllimport)
+ #define GRAS_HELPER_DLL_EXPORT __declspec(dllexport)
+ #define GRAS_HELPER_DLL_LOCAL
+#else
+ #if __GNUC__ >= 4
+ #define GRAS_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
+ #define GRAS_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
+ #define GRAS_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
+ #else
+ #define GRAS_HELPER_DLL_IMPORT
+ #define GRAS_HELPER_DLL_EXPORT
+ #define GRAS_HELPER_DLL_LOCAL
+ #endif
+#endif
+
+// Now we use the generic helper definitions above to define GRAS_API and GRAS_LOCAL.
+// GRAS_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
+// GRAS_LOCAL is used for non-api symbols.
+
+#ifdef GRAS_DLL // defined if GRAS is compiled as a DLL
+ #ifdef GRAS_DLL_EXPORTS // defined if we are building the GRAS DLL (instead of using it)
+ #define GRAS_API GRAS_HELPER_DLL_EXPORT
+ #else
+ #define GRAS_API GRAS_HELPER_DLL_IMPORT
+ #endif // GRAS_DLL_EXPORTS
+ #define GRAS_LOCAL GRAS_HELPER_DLL_LOCAL
+#else // GRAS_DLL is not defined: this means GRAS is a static lib.
+ #define GRAS_API
+ #define GRAS_LOCAL
+#endif // GRAS_DLL
+
+#define GRAS_MAX_ALIGNMENT 32
+
+//define cross platform attribute macros
+#if defined(GRAS_DEBUG)
+ #define GRAS_FORCE_INLINE inline
+#elif defined(BOOST_MSVC)
+ #define GRAS_FORCE_INLINE __forceinline
+#elif defined(__GNUG__) && __GNUG__ >= 4
+ #define GRAS_FORCE_INLINE inline __attribute__((always_inline))
+#else
+ #define GRAS_FORCE_INLINE inline
+#endif
+
+#endif /*INCLUDED_GRAS_GRAS_HPP*/
diff --git a/include/gnuradio/hier_block.hpp b/include/gras/hier_block.hpp
index c981b03..0574f14 100644
--- a/include/gnuradio/hier_block.hpp
+++ b/include/gras/hier_block.hpp
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_HIER_BLOCK_HPP
-#define INCLUDED_GNURADIO_HIER_BLOCK_HPP
+#ifndef INCLUDED_GRAS_HIER_BLOCK_HPP
+#define INCLUDED_GRAS_HIER_BLOCK_HPP
-#include <gnuradio/element.hpp>
+#include <gras/element.hpp>
-namespace gnuradio
+namespace gras
{
struct GRAS_API HierBlock : Element
@@ -70,6 +70,6 @@ struct GRAS_API HierBlock : Element
};
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_HIER_BLOCK_HPP*/
+#endif /*INCLUDED_GRAS_HIER_BLOCK_HPP*/
diff --git a/include/gnuradio/io_signature.hpp b/include/gras/io_signature.hpp
index b6b11a5..bb0df5f 100644
--- a/include/gnuradio/io_signature.hpp
+++ b/include/gras/io_signature.hpp
@@ -14,13 +14,13 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_IO_SIGNATURE_HPP
-#define INCLUDED_GNURADIO_IO_SIGNATURE_HPP
+#ifndef INCLUDED_GRAS_IO_SIGNATURE_HPP
+#define INCLUDED_GRAS_IO_SIGNATURE_HPP
#include <vector>
#include <stdexcept>
-namespace gnuradio
+namespace gras
{
/*!
@@ -108,6 +108,6 @@ struct IOSignature : std::vector<int>
int _max_streams;
};
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_IO_SIGNATURE_HPP*/
+#endif /*INCLUDED_GRAS_IO_SIGNATURE_HPP*/
diff --git a/include/gnuradio/sbuffer.hpp b/include/gras/sbuffer.hpp
index 6398991..7997e09 100644
--- a/include/gnuradio/sbuffer.hpp
+++ b/include/gras/sbuffer.hpp
@@ -14,16 +14,16 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_SBUFFER_HPP
-#define INCLUDED_GNURADIO_SBUFFER_HPP
+#ifndef INCLUDED_GRAS_SBUFFER_HPP
+#define INCLUDED_GRAS_SBUFFER_HPP
-#include <gnuradio/gras.hpp>
+#include <gras/gras.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/function.hpp>
-namespace gnuradio
+namespace gras
{
struct SBufferImpl;
@@ -135,8 +135,8 @@ struct GRAS_API SBuffer : boost::intrusive_ptr<SBufferImpl>
size_t use_count(void) const;
};
-} //namespace gnuradio
+} //namespace gras
-#include <gnuradio/sbuffer.ipp>
+#include <gras/sbuffer.ipp>
-#endif /*INCLUDED_GNURADIO_SBUFFER_HPP*/
+#endif /*INCLUDED_GRAS_SBUFFER_HPP*/
diff --git a/include/gnuradio/sbuffer.ipp b/include/gras/sbuffer.ipp
index 11a16a0..c090123 100644
--- a/include/gnuradio/sbuffer.ipp
+++ b/include/gras/sbuffer.ipp
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_SBUFFER_IPP
-#define INCLUDED_GNURADIO_SBUFFER_IPP
+#ifndef INCLUDED_GRAS_SBUFFER_IPP
+#define INCLUDED_GRAS_SBUFFER_IPP
#include <boost/detail/atomic_count.hpp>
-namespace gnuradio
+namespace gras
{
struct SBufferImpl
@@ -93,6 +93,6 @@ GRAS_FORCE_INLINE size_t SBuffer::use_count(void) const
return (*this)->count;
}
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_SBUFFER_IPP*/
+#endif /*INCLUDED_GRAS_SBUFFER_IPP*/
diff --git a/include/gnuradio/tags.hpp b/include/gras/tags.hpp
index bc83709..9faa667 100644
--- a/include/gnuradio/tags.hpp
+++ b/include/gras/tags.hpp
@@ -14,15 +14,15 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_TAGS_HPP
-#define INCLUDED_GNURADIO_TAGS_HPP
+#ifndef INCLUDED_GRAS_TAGS_HPP
+#define INCLUDED_GRAS_TAGS_HPP
-#include <gnuradio/gras.hpp>
+#include <gras/gras.hpp>
#include <boost/operators.hpp>
#include <PMC/PMC.hpp>
#include <boost/cstdint.hpp>
-namespace gnuradio
+namespace gras
{
struct GRAS_API Tag : boost::less_than_comparable<Tag>
@@ -48,6 +48,6 @@ struct GRAS_API Tag : boost::less_than_comparable<Tag>
GRAS_API bool operator<(const Tag &lhs, const Tag &rhs);
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_TAGS_HPP*/
+#endif /*INCLUDED_GRAS_TAGS_HPP*/
diff --git a/include/gnuradio/thread_pool.hpp b/include/gras/thread_pool.hpp
index d34c161..bfda931 100644
--- a/include/gnuradio/thread_pool.hpp
+++ b/include/gras/thread_pool.hpp
@@ -14,10 +14,10 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_THREAD_POOL_HPP
-#define INCLUDED_GNURADIO_THREAD_POOL_HPP
+#ifndef INCLUDED_GRAS_THREAD_POOL_HPP
+#define INCLUDED_GRAS_THREAD_POOL_HPP
-#include <gnuradio/gras.hpp>
+#include <gras/gras.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <string>
@@ -29,7 +29,7 @@ namespace Theron
class Framework;
}
-namespace gnuradio
+namespace gras
{
struct GRAS_API ThreadPoolConfig
@@ -87,6 +87,6 @@ struct GRAS_API ThreadPool : boost::shared_ptr<Theron::Framework>
void set_active(void);
};
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_THREAD_POOL_HPP*/
+#endif /*INCLUDED_GRAS_THREAD_POOL_HPP*/
diff --git a/include/gnuradio/top_block.hpp b/include/gras/top_block.hpp
index ad9f02a..8bf366f 100644
--- a/include/gnuradio/top_block.hpp
+++ b/include/gras/top_block.hpp
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#ifndef INCLUDED_GNURADIO_TOP_BLOCK_HPP
-#define INCLUDED_GNURADIO_TOP_BLOCK_HPP
+#ifndef INCLUDED_GRAS_TOP_BLOCK_HPP
+#define INCLUDED_GRAS_TOP_BLOCK_HPP
-#include <gnuradio/hier_block.hpp>
+#include <gras/hier_block.hpp>
-namespace gnuradio
+namespace gras
{
struct GRAS_API GlobalBlockConfig
@@ -93,6 +93,6 @@ struct GRAS_API TopBlock : HierBlock
};
-} //namespace gnuradio
+} //namespace gras
-#endif /*INCLUDED_GNURADIO_TOP_BLOCK_HPP*/
+#endif /*INCLUDED_GRAS_TOP_BLOCK_HPP*/
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index bb471f7..e67f341 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,28 +1,30 @@
########################################################################
-# This file included, use CMake directory variables
+# Setup the GRAS library build
########################################################################
+include_directories(${GRAS_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-set(GRAS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../)
-set(GRAS_BINARY_DIR ${CMAKE_BINARY_DIR}/gruel/src)
-set(RUNTIME_SOURCE_DIR ${CMAKE_SOURCE_DIR}/gnuradio-core/src/lib/runtime)
-
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- add_definitions(-DGRAS_DEBUG)
-endif()
-
########################################################################
-# Setup PMC Deps
+# Setup Boost
########################################################################
-include_directories(${GRAS_SOURCE_DIR}/PMC/include)
+if(UNIX AND EXISTS "/usr/lib64")
+ list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
+endif(UNIX AND EXISTS "/usr/lib64")
-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})
+set(Boost_ADDITIONAL_VERSIONS
+ "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
+ "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
+ "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
+ "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
+ "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
+ "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
+ "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
+)
+find_package(Boost COMPONENTS)
-add_subdirectory(${GRAS_SOURCE_DIR}/PMC ${CMAKE_BINARY_DIR}/PMC)
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
+list(APPEND GRAS_LIBRARIES ${Boost_LIBRARIES})
########################################################################
# Setup Theron Deps
@@ -33,8 +35,8 @@ include_directories(${THERON_INCLUDE_DIRS})
link_directories(${THERON_LIBRARY_DIRS})
add_definitions(${THERON_DEFINES})
-list(APPEND gnuradio_core_libs ${THERON_LIBRARIES})
-list(APPEND gnuradio_core_sources ${THERON_SOURCES})
+list(APPEND GRAS_LIBRARIES ${THERON_LIBRARIES})
+list(APPEND GRAS_SOURCES ${THERON_SOURCES})
########################################################################
# Setup Apology Deps
@@ -43,12 +45,12 @@ include_directories(${GRAS_SOURCE_DIR}/Apology/include)
include_directories(${GRAS_SOURCE_DIR}/Apology/lib)
file(GLOB apology_sources "${GRAS_SOURCE_DIR}/Apology/lib/*.cpp")
-list(APPEND gnuradio_core_sources ${apology_sources})
+list(APPEND GRAS_SOURCES ${apology_sources})
########################################################################
-# Append gnuradio-core library sources
+# Append gras-core library sources
########################################################################
-list(APPEND gnuradio_core_sources
+list(APPEND GRAS_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp
${CMAKE_CURRENT_SOURCE_DIR}/element.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sbuffer.cpp
@@ -64,113 +66,15 @@ list(APPEND gnuradio_core_sources
${CMAKE_CURRENT_SOURCE_DIR}/output_handlers.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hier_block.cpp
${CMAKE_CURRENT_SOURCE_DIR}/top_block.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/gr_block.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/gr_sync_block.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/gr_hier_block2.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/gr_top_block.cpp
${CMAKE_CURRENT_SOURCE_DIR}/register_messages.cpp
)
-#sources that are in tree that have not changed
-list(APPEND gnuradio_core_sources
- ${RUNTIME_SOURCE_DIR}/gr_sys_paths.cc
- ${RUNTIME_SOURCE_DIR}/gr_message.cc
- ${RUNTIME_SOURCE_DIR}/gr_msg_queue.cc
- ${RUNTIME_SOURCE_DIR}/gr_msg_handler.cc
-)
-
-########################################################################
-# Append gnuradio-core test sources
-########################################################################
-list(APPEND test_gnuradio_core_sources
- ${RUNTIME_SOURCE_DIR}/qa_gr_block.cc
- ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2.cc
- ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2_derived.cc
- #${RUNTIME_SOURCE_DIR}/qa_gr_buffer.cc
- #${RUNTIME_SOURCE_DIR}/qa_gr_flowgraph.cc
- ${RUNTIME_SOURCE_DIR}/qa_gr_top_block.cc
- ${RUNTIME_SOURCE_DIR}/qa_gr_io_signature.cc
- #${RUNTIME_SOURCE_DIR}/qa_gr_vmcircbuf.cc
- ${RUNTIME_SOURCE_DIR}/qa_block_tags.cc
- ${GRAS_SOURCE_DIR}/lib/qa_runtime.cc
- #${RUNTIME_SOURCE_DIR}/qa_set_msg_handler.cc
-)
-
-#copy test headers to include dir
-set(test_headers
- ${RUNTIME_SOURCE_DIR}/qa_gr_block.h
- ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2.h
- ${RUNTIME_SOURCE_DIR}/qa_gr_hier_block2_derived.h
- #${RUNTIME_SOURCE_DIR}/qa_gr_buffer.h
- #${RUNTIME_SOURCE_DIR}/qa_gr_flowgraph.h
- ${RUNTIME_SOURCE_DIR}/qa_gr_top_block.h
- ${RUNTIME_SOURCE_DIR}/qa_gr_io_signature.h
- #${RUNTIME_SOURCE_DIR}/qa_gr_vmcircbuf.h
- ${RUNTIME_SOURCE_DIR}/qa_block_tags.h
- ${RUNTIME_SOURCE_DIR}/qa_runtime.h
- #${RUNTIME_SOURCE_DIR}/qa_set_msg_handler.h
- ${RUNTIME_SOURCE_DIR}/gr_unittests.h
-)
-foreach(header ${test_headers})
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${GRAS_BINARY_DIR}/include)
-endforeach(header)
-
-########################################################################
-# Install runtime headers
-########################################################################
-set(runtime_copy_headers
- ${RUNTIME_SOURCE_DIR}/gr_sys_paths.h
- ${RUNTIME_SOURCE_DIR}/gr_message.h
- ${RUNTIME_SOURCE_DIR}/gr_msg_queue.h
- ${RUNTIME_SOURCE_DIR}/gr_msg_handler.h
- ${RUNTIME_SOURCE_DIR}/gr_complex.h
-)
-
-#copy the headers to a place that is in the include path
-foreach(runtime_copy_header ${runtime_copy_headers})
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${runtime_copy_header} ${GRAS_BINARY_DIR}/include)
-endforeach(runtime_copy_header)
-
-file(GLOB runtime_headers "${GRAS_SOURCE_DIR}/include/gnuradio/*")
-install(FILES
- ${runtime_headers} ${runtime_copy_headers}
- DESTINATION ${GR_INCLUDE_DIR}/gnuradio
- COMPONENT "core_devel"
-)
-
########################################################################
-# Install swig headers
+# Build library
########################################################################
-if(ENABLE_PYTHON)
-
-set(runtime_copy_swigs
- ${RUNTIME_SOURCE_DIR}/gr_message.i
- ${RUNTIME_SOURCE_DIR}/gr_msg_queue.i
- ${RUNTIME_SOURCE_DIR}/gr_msg_handler.i
-)
-
-#makes swig doc generator happy
-execute_process(
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/runtime/
- COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/nop.h
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/nop.h
- ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/runtime/nop.h
-)
-
-#copy the headers to a place that is in the include path
-foreach(runtime_copy_header ${runtime_copy_swigs})
- execute_process(
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig/
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${runtime_copy_header} ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig/
- )
-endforeach(runtime_copy_header)
-
-file(GLOB runtime_swigs "${GRAS_SOURCE_DIR}/swig/*.i")
-install(FILES
- ${runtime_swigs} ${runtime_copy_swigs}
- DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
- COMPONENT "core_swig"
-)
+include(GrMiscUtils)
-endif(ENABLE_PYTHON)
+add_library(gras SHARED ${GRAS_SOURCES})
+target_link_libraries(gras ${GRAS_LIBRARIES})
+set(GR_LIBRARY_DIR lib)
+GR_LIBRARY_FOO(gras RUNTIME_COMPONENT ${GRAS_COMP_RUNTIME} DEVEL_COMPONENT ${GRAS_COMP_DEVEL})
diff --git a/lib/block.cpp b/lib/block.cpp
index 95d27fa..0d50ef7 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -15,9 +15,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "element_impl.hpp"
-#include <gnuradio/block.hpp>
+#include <gras/block.hpp>
-using namespace gnuradio;
+using namespace gras;
InputPortConfig::InputPortConfig(void)
{
@@ -136,7 +136,7 @@ bool Block::fixed_rate(void) const
void Block::set_output_multiple(const size_t multiple)
{
(*this)->block->output_multiple_items = multiple;
- gnuradio::OutputPortConfig config = this->output_config();
+ gras::OutputPortConfig config = this->output_config();
config.reserve_items = multiple;
this->set_output_config(config);
}
diff --git a/lib/block_actor.cpp b/lib/block_actor.cpp
index 108e7d3..0576588 100644
--- a/lib/block_actor.cpp
+++ b/lib/block_actor.cpp
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gnuradio/thread_pool.hpp>
+#include <gras/thread_pool.hpp>
#include <gras_impl/block_actor.hpp>
#include <boost/thread/thread.hpp>
#include <Theron/Framework.h>
-using namespace gnuradio;
+using namespace gras;
ThreadPoolConfig::ThreadPoolConfig(void)
{
diff --git a/lib/block_allocator.cpp b/lib/block_allocator.cpp
index 05b35ac..8a94141 100644
--- a/lib/block_allocator.cpp
+++ b/lib/block_allocator.cpp
@@ -19,7 +19,7 @@
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
-using namespace gnuradio;
+using namespace gras;
const size_t AT_LEAST_DEFAULT_ITEMS = 1 << 13;
const size_t AHH_TOO_MANY_BYTES = 1 << 20; //TODO
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index ca42b45..6140d40 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -18,7 +18,7 @@
#include <boost/make_shared.hpp>
#include <boost/bind.hpp>
-using namespace gnuradio;
+using namespace gras;
void BlockActor::handle_top_active(
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index a291c01..be97af2 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -19,7 +19,7 @@
#define REALLY_BIG size_t(1 << 30)
-using namespace gnuradio;
+using namespace gras;
void BlockActor::mark_done(void)
{
diff --git a/lib/element.cpp b/lib/element.cpp
index 39cbca3..6d116e9 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -15,13 +15,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "element_impl.hpp"
-#include <gnuradio/element.hpp>
+#include <gras/element.hpp>
#include <boost/format.hpp>
#include <boost/detail/atomic_count.hpp>
static boost::detail::atomic_count unique_id_pool(0);
-using namespace gnuradio;
+using namespace gras;
Element::Element(void)
{
diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp
index d058e63..e079d8e 100644
--- a/lib/element_impl.hpp
+++ b/lib/element_impl.hpp
@@ -20,12 +20,12 @@
#include <gras_impl/block_actor.hpp>
#include <Apology/Topology.hpp>
#include <Apology/Executor.hpp>
-#include <gnuradio/element.hpp>
-#include <gnuradio/block.hpp>
+#include <gras/element.hpp>
+#include <gras/block.hpp>
#include <gras_impl/token.hpp>
#include <gras_impl/interruptible_thread.hpp>
-namespace gnuradio
+namespace gras
{
struct ElementImpl
@@ -61,6 +61,6 @@ struct ElementImpl
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_ELEMENT_IMPL_HPP*/
diff --git a/lib/gr_block.cpp b/lib/gr_block.cpp
deleted file mode 100644
index f8ce6f4..0000000
--- a/lib/gr_block.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#include "element_impl.hpp"
-#include "pmx_helper.hpp"
-#include <gr_block.h>
-#include <boost/foreach.hpp>
-
-gr_block::gr_block(void)
-{
- //NOP
-}
-
-gr_block::gr_block(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
-):
- gnuradio::Block(name)
-{
- this->set_fixed_rate(false);
- this->set_input_signature(input_signature);
- this->set_output_signature(output_signature);
-}
-
-int gr_block::work(
- const InputItems &input_items,
- const OutputItems &output_items
-){
- return this->general_work(
- (*this)->block->work_noutput_items,
- (*this)->block->work_ninput_items,
- (*this)->block->work_input_items,
- (*this)->block->work_output_items
- );
-}
-
-void gr_block::forecast(int noutput_items, std::vector<int> &ninputs_req)
-{
- for (size_t i = 0; i < ninputs_req.size(); i++)
- {
- ninputs_req[i] = fixed_rate_noutput_to_ninput(noutput_items);
- }
-}
-
-int gr_block::general_work(
- int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items
-){
- throw std::runtime_error("gr_block subclasses must overload general_work!");
-}
-
-void gr_block::set_alignment(const size_t)
-{
- //TODO
- //probably dont need this since buffers always start aligned
- //and therefore alignment is always re-acheived
-}
-
-bool gr_block::is_unaligned(void)
-{
- //TODO
- //probably dont need this since volk dispatcher checks alignment
- //32 byte aligned is good enough for you
- return ((*this)->block->work_io_ptr_mask & ptrdiff_t(GRAS_MAX_ALIGNMENT-1)) != 0;
-}
-
-size_t gr_block::fixed_rate_noutput_to_ninput(const size_t noutput_items)
-{
- if (this->fixed_rate())
- {
- return size_t(0.5 + (noutput_items/this->relative_rate())) + this->history() - 1;
- }
- else
- {
- return noutput_items + this->history() - 1;
- }
-}
-
-size_t gr_block::interpolation(void) const
-{
- return size_t(1.0*this->relative_rate());
-}
-
-void gr_block::set_interpolation(const size_t interp)
-{
- this->set_relative_rate(1.0*interp);
- this->set_output_multiple(interp);
-}
-
-size_t gr_block::decimation(void) const
-{
- return size_t(1.0/this->relative_rate());
-}
-
-void gr_block::set_decimation(const size_t decim)
-{
- this->set_relative_rate(1.0/decim);
-}
-
-unsigned gr_block::history(void) const
-{
- //implement off-by-one history compat
- return this->input_config().lookahead_items+1;
-}
-
-void gr_block::set_history(unsigned history)
-{
- gnuradio::InputPortConfig config = this->input_config();
- //implement off-by-one history compat
- if (history == 0) history++;
- config.lookahead_items = history-1;
- this->set_input_config(config);
-}
-
-int gr_block::max_noutput_items(void) const
-{
- return this->output_config().maximum_items;
-}
-
-void gr_block::set_max_noutput_items(int max_items)
-{
- gnuradio::OutputPortConfig config = this->output_config();
- config.maximum_items = max_items;
- this->set_output_config(config);
-}
-
-void gr_block::unset_max_noutput_items(void)
-{
- this->set_max_noutput_items(0);
-}
-
-bool gr_block::is_set_max_noutput_items(void) const
-{
- return this->max_noutput_items() != 0;
-}
-
-//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 = pmt::pmc_to_pmt(tag.key);
- t.value = pmt::pmc_to_pmt(tag.value);
- t.srcid = pmt::pmc_to_pmt(tag.srcid);
- return t;
-}
-
-static gnuradio::Tag gr_tag2Tag(const gr_tag_t &tag)
-{
- return gnuradio::Tag
- (
- tag.offset,
- pmt::pmt_to_pmc(tag.key),
- pmt::pmt_to_pmc(tag.value),
- pmt::pmt_to_pmc(tag.srcid)
- );
-}
-
-void gr_block::add_item_tag(
- const size_t which_output, const gr_tag_t &tag
-){
- this->post_output_tag(which_output, gr_tag2Tag(tag));
-}
-
-void gr_block::add_item_tag(
- const size_t which_output,
- uint64_t abs_offset,
- const pmt::pmt_t &key,
- const pmt::pmt_t &value,
- const pmt::pmt_t &srcid
-){
- gr_tag_t t;
- t.offset = abs_offset;
- t.key = key;
- t.value = value;
- t.srcid = srcid;
- this->add_item_tag(which_output, t);
-}
-
-void gr_block::get_tags_in_range(
- std::vector<gr_tag_t> &tags,
- const size_t which_input,
- uint64_t abs_start,
- uint64_t abs_end,
- const pmt::pmt_t &key
-){
- tags.clear();
- BOOST_FOREACH(const gnuradio::Tag &tag, this->get_input_tags(which_input))
- {
- if (tag.offset >= abs_start and tag.offset <= abs_end)
- {
- gr_tag_t t = Tag2gr_tag(tag);
- if (key or pmt::pmt_equal(t.key, key)) tags.push_back(t);
- }
- }
-}
diff --git a/lib/gr_hier_block2.cpp b/lib/gr_hier_block2.cpp
deleted file mode 100644
index b40755a..0000000
--- a/lib/gr_hier_block2.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#include <gr_hier_block2.h>
-
-gr_hier_block2::gr_hier_block2(void)
-{
- //NOP
-}
-
-gr_hier_block2::gr_hier_block2(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
-):
- gnuradio::HierBlock(name)
-{
- this->set_input_signature(input_signature);
- this->set_output_signature(output_signature);
-}
-
-gr_hier_block2_sptr gr_make_hier_block2(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
-){
- return gr_hier_block2_sptr(new gr_hier_block2(name, input_signature, output_signature));
-}
diff --git a/lib/gr_sync_block.cpp b/lib/gr_sync_block.cpp
deleted file mode 100644
index e883861..0000000
--- a/lib/gr_sync_block.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#include "element_impl.hpp"
-#include <gr_sync_block.h>
-#include <gr_sync_interpolator.h>
-#include <gr_sync_decimator.h>
-
-gr_sync_block::gr_sync_block(void)
-{
- //NOP
-}
-
-gr_sync_block::gr_sync_block(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature
-):
- gr_block(name, input_signature, output_signature)
-{
- this->set_fixed_rate(true);
-}
-
-int gr_sync_block::work(
- int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items
-){
- throw std::runtime_error("gr_block subclasses must overload general_work!");
-}
-
-gr_sync_interpolator::gr_sync_interpolator(void)
-{
- //NOP
-}
-
-gr_sync_interpolator::gr_sync_interpolator(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature,
- const size_t interp_rate
-):
- gr_sync_block(name, input_signature, output_signature)
-{
- this->set_interpolation(interp_rate);
-}
-
-gr_sync_decimator::gr_sync_decimator(void)
-{
- //NOP
-}
-
-gr_sync_decimator::gr_sync_decimator(
- const std::string &name,
- gr_io_signature_sptr input_signature,
- gr_io_signature_sptr output_signature,
- const size_t decim_rate
-):
- gr_sync_block(name, input_signature, output_signature)
-{
- this->set_decimation(decim_rate);
-}
diff --git a/lib/gr_top_block.cpp b/lib/gr_top_block.cpp
deleted file mode 100644
index c51f9b3..0000000
--- a/lib/gr_top_block.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#include <gr_top_block.h>
-
-gr_top_block::gr_top_block(void):
- //cannot make a null top block, use name constructor
- gnuradio::TopBlock("top")
-{
- //NOP
-}
-
-gr_top_block::gr_top_block(const std::string &name):
- gnuradio::TopBlock(name)
-{
- //NOP
-}
-
-gr_top_block_sptr gr_make_top_block(const std::string &name)
-{
- return gr_top_block_sptr(new gr_top_block(name));
-}
-
-void gr_top_block::start(void)
-{
- gnuradio::TopBlock::start();
-}
-
-void gr_top_block::start(const size_t max_items)
-{
- this->set_max_noutput_items(max_items);
- gnuradio::TopBlock::start();
-}
-
-void gr_top_block::run(void)
-{
- gnuradio::TopBlock::run();
-}
-
-void gr_top_block::run(const size_t max_items)
-{
- this->set_max_noutput_items(max_items);
- gnuradio::TopBlock::run();
-}
-
-int gr_top_block::max_noutput_items(void) const
-{
- return this->global_config().maximum_output_items;
-}
-
-void gr_top_block::set_max_noutput_items(int max_items)
-{
- gnuradio::GlobalBlockConfig config = this->global_config();
- config.maximum_output_items = max_items;
- this->set_global_config(config);
-}
diff --git a/lib/gras_impl/bitset.hpp b/lib/gras_impl/bitset.hpp
index 5ea2acb..7a2184f 100644
--- a/lib/gras_impl/bitset.hpp
+++ b/lib/gras_impl/bitset.hpp
@@ -17,10 +17,10 @@
#ifndef INCLUDED_LIBGRAS_IMPL_BITSET_HPP
#define INCLUDED_LIBGRAS_IMPL_BITSET_HPP
-#include <gnuradio/gras.hpp>
+#include <gras/gras.hpp>
#include <boost/dynamic_bitset.hpp>
-namespace gnuradio
+namespace gras
{
//! Its just dynamic bitset w/ the handle all() routine
@@ -32,6 +32,6 @@ struct BitSet : boost::dynamic_bitset<>
}
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_BITSET_HPP*/
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp
index d32c105..4ef71e8 100644
--- a/lib/gras_impl/block_actor.hpp
+++ b/lib/gras_impl/block_actor.hpp
@@ -19,10 +19,10 @@
#include <gras_impl/debug.hpp>
#include <gras_impl/bitset.hpp>
-#include <gnuradio/gras.hpp>
-#include <gnuradio/block.hpp>
-#include <gnuradio/top_block.hpp>
-#include <gnuradio/thread_pool.hpp>
+#include <gras/gras.hpp>
+#include <gras/block.hpp>
+#include <gras/top_block.hpp>
+#include <gras/thread_pool.hpp>
#include <Apology/Worker.hpp>
#include <gras_impl/token.hpp>
#include <gras_impl/messages.hpp>
@@ -32,7 +32,7 @@
#include <vector>
#include <set>
-namespace gnuradio
+namespace gras
{
static GRAS_FORCE_INLINE unsigned long myulround(const double x)
@@ -201,6 +201,6 @@ struct BlockActor : Apology::Worker
bool topology_init;
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_BLOCK_ACTOR_HPP*/
diff --git a/lib/gras_impl/buffer_queue.hpp b/lib/gras_impl/buffer_queue.hpp
index bde4986..5a9c28c 100644
--- a/lib/gras_impl/buffer_queue.hpp
+++ b/lib/gras_impl/buffer_queue.hpp
@@ -17,11 +17,11 @@
#ifndef INCLUDED_LIBGRAS_IMPL_BUFFER_QUEUE_HPP
#define INCLUDED_LIBGRAS_IMPL_BUFFER_QUEUE_HPP
-#include <gnuradio/sbuffer.hpp>
+#include <gras/sbuffer.hpp>
#include <boost/bind.hpp>
#include <queue>
-namespace gnuradio
+namespace gras
{
struct BufferQueue : std::queue<SBuffer>
@@ -54,6 +54,6 @@ struct BufferQueue : std::queue<SBuffer>
SBufferToken _token;
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_BUFFER_QUEUE_HPP*/
diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp
index d17c4f0..92bfb02 100644
--- a/lib/gras_impl/input_buffer_queues.hpp
+++ b/lib/gras_impl/input_buffer_queues.hpp
@@ -20,14 +20,14 @@
#include <gras_impl/debug.hpp>
#include <gras_impl/bitset.hpp>
#include <gras_impl/buffer_queue.hpp>
-#include <gnuradio/sbuffer.hpp>
+#include <gras/sbuffer.hpp>
#include <vector>
#include <queue>
#include <deque>
#include <cstring> //memcpy/memset
#include <boost/circular_buffer.hpp>
-namespace gnuradio
+namespace gras
{
struct InputBufferQueues
@@ -217,6 +217,6 @@ GRAS_FORCE_INLINE void InputBufferQueues::consume(const size_t i, const size_t b
__update(i);
}
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_INPUT_BUFFERS_HPP*/
diff --git a/lib/gras_impl/interruptible_thread.hpp b/lib/gras_impl/interruptible_thread.hpp
index 1cb9b64..5af9369 100644
--- a/lib/gras_impl/interruptible_thread.hpp
+++ b/lib/gras_impl/interruptible_thread.hpp
@@ -32,7 +32,7 @@
/*!
* This is the only place you will find any threading stuff.
- * The entire point here is that the source's in gnuradio
+ * The entire point here is that the source's in gras
* are sometimed bad and block forever (the author is guilty too).
* This thread pool creates an interruptible thread to perform work.
* Everything is nice and synchronous with the block actor.
@@ -40,7 +40,7 @@
* However, this will be interrupted and not block forever,
* when the executor is told to stop/interrupt and wait/join.
*/
-namespace gnuradio
+namespace gras
{
typedef boost::shared_ptr<boost::thread_group> SharedThreadGroup;
@@ -138,6 +138,6 @@ namespace gnuradio
boost::thread *_thread;
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_INTERRUPTIBLE_THREAD_HPP*/
diff --git a/lib/gras_impl/messages.hpp b/lib/gras_impl/messages.hpp
index 68c3392..d09a71c 100644
--- a/lib/gras_impl/messages.hpp
+++ b/lib/gras_impl/messages.hpp
@@ -17,12 +17,12 @@
#ifndef INCLUDED_LIBGRAS_IMPL_MESSAGES_HPP
#define INCLUDED_LIBGRAS_IMPL_MESSAGES_HPP
-#include <gnuradio/sbuffer.hpp>
-#include <gnuradio/tags.hpp>
-#include <gnuradio/sbuffer.hpp>
+#include <gras/sbuffer.hpp>
+#include <gras/tags.hpp>
+#include <gras/sbuffer.hpp>
#include <gras_impl/token.hpp>
-namespace gnuradio
+namespace gras
{
//----------------------------------------------------------------------
@@ -137,33 +137,33 @@ struct UpdateInputsMessage
//empty
};
-} //namespace gnuradio
+} //namespace gras
#include <Theron/Register.h>
-#include <gnuradio/top_block.hpp>
+#include <gras/top_block.hpp>
#include <gras_impl/messages.hpp>
#include <gras_impl/interruptible_thread.hpp>
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::TopAllocMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::TopActiveMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::TopInertMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::TopTokenMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::GlobalBlockConfig);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::SharedThreadGroup);
-
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::InputTagMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::InputBufferMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::InputTokenMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::InputCheckMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::InputAllocMessage);
-
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::OutputBufferMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::OutputTokenMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::OutputCheckMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::OutputHintMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::OutputAllocMessage);
-
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::SelfKickMessage);
-THERON_DECLARE_REGISTERED_MESSAGE(gnuradio::UpdateInputsMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::TopAllocMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::TopActiveMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::TopInertMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::TopTokenMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::GlobalBlockConfig);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::SharedThreadGroup);
+
+THERON_DECLARE_REGISTERED_MESSAGE(gras::InputTagMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::InputBufferMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::InputTokenMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::InputCheckMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::InputAllocMessage);
+
+THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputBufferMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputTokenMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputCheckMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputHintMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputAllocMessage);
+
+THERON_DECLARE_REGISTERED_MESSAGE(gras::SelfKickMessage);
+THERON_DECLARE_REGISTERED_MESSAGE(gras::UpdateInputsMessage);
#endif /*INCLUDED_LIBGRAS_IMPL_MESSAGES_HPP*/
diff --git a/lib/gras_impl/output_buffer_queues.hpp b/lib/gras_impl/output_buffer_queues.hpp
index 1f07af0..d876aa7 100644
--- a/lib/gras_impl/output_buffer_queues.hpp
+++ b/lib/gras_impl/output_buffer_queues.hpp
@@ -21,7 +21,7 @@
#include <vector>
#include <boost/circular_buffer.hpp>
-namespace gnuradio
+namespace gras
{
template <typename T>
@@ -100,6 +100,6 @@ struct OutputBufferQueues
}
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_OUTPUT_BUFFER_QUEUES_HPP*/
diff --git a/lib/gras_impl/token.hpp b/lib/gras_impl/token.hpp
index db5f047..5cc634f 100644
--- a/lib/gras_impl/token.hpp
+++ b/lib/gras_impl/token.hpp
@@ -20,7 +20,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
-namespace gnuradio
+namespace gras
{
typedef boost::weak_ptr<int> WeakToken;
@@ -35,6 +35,6 @@ struct Token : boost::shared_ptr<int>
}
};
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_IMPL_TOKEN_HPP*/
diff --git a/lib/hier_block.cpp b/lib/hier_block.cpp
index 422ed77..6c95e9b 100644
--- a/lib/hier_block.cpp
+++ b/lib/hier_block.cpp
@@ -15,9 +15,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "element_impl.hpp"
-#include <gnuradio/hier_block.hpp>
+#include <gras/hier_block.hpp>
-using namespace gnuradio;
+using namespace gras;
HierBlock::HierBlock(void)
{
diff --git a/lib/input_handlers.cpp b/lib/input_handlers.cpp
index 30bb613..d9adfa5 100644
--- a/lib/input_handlers.cpp
+++ b/lib/input_handlers.cpp
@@ -17,7 +17,7 @@
#include <gras_impl/block_actor.hpp>
#include <boost/foreach.hpp>
-using namespace gnuradio;
+using namespace gras;
void BlockActor::handle_input_tag(const InputTagMessage &message, const Theron::Address)
{
diff --git a/lib/output_handlers.cpp b/lib/output_handlers.cpp
index c3d8392..7256a75 100644
--- a/lib/output_handlers.cpp
+++ b/lib/output_handlers.cpp
@@ -17,7 +17,7 @@
#include <gras_impl/block_actor.hpp>
#include <boost/foreach.hpp>
-using namespace gnuradio;
+using namespace gras;
void BlockActor::handle_output_buffer(const OutputBufferMessage &message, const Theron::Address)
diff --git a/lib/pmx_helper.hpp b/lib/pmx_helper.hpp
deleted file mode 100644
index b44345c..0000000
--- a/lib/pmx_helper.hpp
+++ /dev/null
@@ -1,263 +0,0 @@
-//
-// Copyright 2012 Josh Blum
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef INCLUDED_LIBGRAS_PMX_HELPER_HPP
-#define INCLUDED_LIBGRAS_PMX_HELPER_HPP
-
-#include <PMC/PMC.hpp>
-#include <PMC/Containers.hpp>
-#include <gruel/pmt.h>
-#include <boost/foreach.hpp>
-
-namespace pmt
-{
-
-inline pmt_t pmc_to_pmt(const PMCC &p)
-{
- //the container is null
- if (not p) return pmt::pmt_t();
-
- #define decl_pmc_to_pmt(type, conv) if (p.is<type >()) return conv(p.as<type >())
-
- //bool
- decl_pmc_to_pmt(bool, pmt_from_bool);
-
- //string
- decl_pmc_to_pmt(std::string, pmt_string_to_symbol);
-
- //numeric types
- decl_pmc_to_pmt(int8_t, pmt_from_long);
- decl_pmc_to_pmt(int16_t, pmt_from_long);
- decl_pmc_to_pmt(int32_t, pmt_from_long);
- decl_pmc_to_pmt(uint8_t, pmt_from_long);
- decl_pmc_to_pmt(uint16_t, pmt_from_long);
- decl_pmc_to_pmt(uint32_t, pmt_from_long);
- decl_pmc_to_pmt(int64_t, pmt_from_uint64);
- decl_pmc_to_pmt(uint64_t, pmt_from_uint64);
- decl_pmc_to_pmt(float, pmt_from_double);
- decl_pmc_to_pmt(double, pmt_from_double);
- #define pmt_from_complex(x) pmt_make_rectangular((x).real(), (x).imag())
- decl_pmc_to_pmt(std::complex<float>, pmt_from_complex);
- decl_pmc_to_pmt(std::complex<double>, pmt_from_complex);
-
- //pair container
- if (p.is<PMCPair>())
- {
- const PMCPair &pr = p.as<PMCPair>();
- return pmt_cons(pmc_to_pmt(pr.first), pmc_to_pmt(pr.second));
- }
-
- //fucking tuples
-/*
-for i in range(11):
- args = list()
- for j in range(i):
- args.append('pmc_to_pmt(p.as<PMCTuple<%d> >()[%d])'%(i, j))
- print ' if (p.is<PMCTuple<%d> >())'%i
- print ' return pmt_make_tuple(%s);'%(', '.join(args),)
-*/
- if (p.is<PMCTuple<0> >())
- return pmt_make_tuple();
- if (p.is<PMCTuple<1> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<1> >()[0]));
- if (p.is<PMCTuple<2> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<2> >()[0]), pmc_to_pmt(p.as<PMCTuple<2> >()[1]));
- if (p.is<PMCTuple<3> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<3> >()[0]), pmc_to_pmt(p.as<PMCTuple<3> >()[1]), pmc_to_pmt(p.as<PMCTuple<3> >()[2]));
- if (p.is<PMCTuple<4> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<4> >()[0]), pmc_to_pmt(p.as<PMCTuple<4> >()[1]), pmc_to_pmt(p.as<PMCTuple<4> >()[2]), pmc_to_pmt(p.as<PMCTuple<4> >()[3]));
- if (p.is<PMCTuple<5> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<5> >()[0]), pmc_to_pmt(p.as<PMCTuple<5> >()[1]), pmc_to_pmt(p.as<PMCTuple<5> >()[2]), pmc_to_pmt(p.as<PMCTuple<5> >()[3]), pmc_to_pmt(p.as<PMCTuple<5> >()[4]));
- if (p.is<PMCTuple<6> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<6> >()[0]), pmc_to_pmt(p.as<PMCTuple<6> >()[1]), pmc_to_pmt(p.as<PMCTuple<6> >()[2]), pmc_to_pmt(p.as<PMCTuple<6> >()[3]), pmc_to_pmt(p.as<PMCTuple<6> >()[4]), pmc_to_pmt(p.as<PMCTuple<6> >()[5]));
- if (p.is<PMCTuple<7> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<7> >()[0]), pmc_to_pmt(p.as<PMCTuple<7> >()[1]), pmc_to_pmt(p.as<PMCTuple<7> >()[2]), pmc_to_pmt(p.as<PMCTuple<7> >()[3]), pmc_to_pmt(p.as<PMCTuple<7> >()[4]), pmc_to_pmt(p.as<PMCTuple<7> >()[5]), pmc_to_pmt(p.as<PMCTuple<7> >()[6]));
- if (p.is<PMCTuple<8> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<8> >()[0]), pmc_to_pmt(p.as<PMCTuple<8> >()[1]), pmc_to_pmt(p.as<PMCTuple<8> >()[2]), pmc_to_pmt(p.as<PMCTuple<8> >()[3]), pmc_to_pmt(p.as<PMCTuple<8> >()[4]), pmc_to_pmt(p.as<PMCTuple<8> >()[5]), pmc_to_pmt(p.as<PMCTuple<8> >()[6]), pmc_to_pmt(p.as<PMCTuple<8> >()[7]));
- if (p.is<PMCTuple<9> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<9> >()[0]), pmc_to_pmt(p.as<PMCTuple<9> >()[1]), pmc_to_pmt(p.as<PMCTuple<9> >()[2]), pmc_to_pmt(p.as<PMCTuple<9> >()[3]), pmc_to_pmt(p.as<PMCTuple<9> >()[4]), pmc_to_pmt(p.as<PMCTuple<9> >()[5]), pmc_to_pmt(p.as<PMCTuple<9> >()[6]), pmc_to_pmt(p.as<PMCTuple<9> >()[7]), pmc_to_pmt(p.as<PMCTuple<9> >()[8]));
- if (p.is<PMCTuple<10> >())
- return pmt_make_tuple(pmc_to_pmt(p.as<PMCTuple<10> >()[0]), pmc_to_pmt(p.as<PMCTuple<10> >()[1]), pmc_to_pmt(p.as<PMCTuple<10> >()[2]), pmc_to_pmt(p.as<PMCTuple<10> >()[3]), pmc_to_pmt(p.as<PMCTuple<10> >()[4]), pmc_to_pmt(p.as<PMCTuple<10> >()[5]), pmc_to_pmt(p.as<PMCTuple<10> >()[6]), pmc_to_pmt(p.as<PMCTuple<10> >()[7]), pmc_to_pmt(p.as<PMCTuple<10> >()[8]), pmc_to_pmt(p.as<PMCTuple<10> >()[9]));
-
- //vector container
- if (p.is<PMCList>())
- {
- const PMCList &l = p.as<PMCList>();
- pmt_t v = pmt_make_vector(l.size(), pmt_t());
- for (size_t i = 0; i < l.size(); i++)
- {
- pmt_vector_set(v, i, pmc_to_pmt(l[i]));
- }
- return v;
- }
-
- //numeric arrays
- #define decl_pmc_to_pmt_numeric_array(type, suffix) \
- if (p.is<std::vector<type> >()) return pmt_init_ ## suffix ## vector(p.as<std::vector<type> >().size(), &p.as<std::vector<type> >()[0])
- decl_pmc_to_pmt_numeric_array(uint8_t, u8);
- decl_pmc_to_pmt_numeric_array(uint16_t, u16);
- decl_pmc_to_pmt_numeric_array(uint32_t, u32);
- decl_pmc_to_pmt_numeric_array(uint64_t, u64);
- decl_pmc_to_pmt_numeric_array(int8_t, s8);
- decl_pmc_to_pmt_numeric_array(int16_t, s16);
- decl_pmc_to_pmt_numeric_array(int32_t, s32);
- decl_pmc_to_pmt_numeric_array(int64_t, s64);
- decl_pmc_to_pmt_numeric_array(float, f32);
- decl_pmc_to_pmt_numeric_array(double, f64);
- decl_pmc_to_pmt_numeric_array(std::complex<float>, c32);
- decl_pmc_to_pmt_numeric_array(std::complex<double>, c64);
-
- //dictionary container
- if (p.is<PMCDict>())
- {
- const PMCDict &m = p.as<PMCDict>();
- pmt_t d = pmt_make_dict();
- BOOST_FOREACH(const PMCPair &pr, m)
- {
- d = pmt_dict_add(d, pmc_to_pmt(pr.first), pmc_to_pmt(pr.second));
- }
- return d;
- }
-
- //set container
- if (p.is<PMCSet>())
- {
- const PMCSet &s = p.as<PMCSet>();
- pmt_t l = PMT_NIL;
- BOOST_FOREACH(const PMCC &elem, s)
- {
- l = pmt_list_add(l, pmc_to_pmt(elem));
- }
- return l;
- }
-
- //is it already a pmt?
- if (p.is<pmt_t>()) return p.as<pmt_t>();
-
- //backup plan... boost::any
- return pmt_make_any(p);
-
-}
-
-inline PMCC pmt_to_pmc(const pmt_t &p)
-{
- //if the container null?
- if (not p) return PMC();
-
- #define decl_pmt_to_pmc(check, conv) if (check(p)) return PMC::make(conv(p))
-
- //bool
- decl_pmt_to_pmc(pmt_is_bool, pmt_to_bool);
-
- //string
- decl_pmt_to_pmc(pmt_is_symbol, pmt_symbol_to_string);
-
- //numeric types
- decl_pmt_to_pmc(pmt_is_integer, pmt_to_long);
- decl_pmt_to_pmc(pmt_is_uint64, pmt_to_uint64);
- decl_pmt_to_pmc(pmt_is_real, pmt_to_double);
- decl_pmt_to_pmc(pmt_is_complex, pmt_to_complex);
-
- //is it a boost any holding a PMCC?
- if (pmt_is_any(p))
- {
- const boost::any a = pmt_any_ref(p);
- if (a.type() == typeid(PMCC)) return boost::any_cast<PMCC>(a);
- }
-
- //pair container
- if (pmt_is_pair(p))
- {
- PMCPair pr(pmt_to_pmc(pmt_car(p)), pmt_to_pmc(pmt_cdr(p)));
- return PMC::make(pr);
- }
-
- //fucking tuples
- #define decl_pmt_to_pmc_tuple(n) \
- if (pmt_is_tuple(p) and pmt_length(p) == n) \
- { \
- PMCTuple<n> t; \
- for (size_t i = 0; i < n; i++) t[i] = pmt_to_pmc(pmt_tuple_ref(p, i)); \
- return PMC::make(t); \
- }
- decl_pmt_to_pmc_tuple(0);
- decl_pmt_to_pmc_tuple(1);
- decl_pmt_to_pmc_tuple(2);
- decl_pmt_to_pmc_tuple(3);
- decl_pmt_to_pmc_tuple(4);
- decl_pmt_to_pmc_tuple(5);
- decl_pmt_to_pmc_tuple(6);
- decl_pmt_to_pmc_tuple(7);
- decl_pmt_to_pmc_tuple(8);
- decl_pmt_to_pmc_tuple(9);
- decl_pmt_to_pmc_tuple(10);
-
- //vector container
- if (pmt_is_vector(p))
- {
- PMCList l(pmt_length(p));
- for (size_t i = 0; i < l.size(); i++)
- {
- l[i] = pmt_to_pmc(pmt_vector_ref(p, i));
- }
- return PMC::make(l);
- }
-
- //numeric arrays
- #define decl_pmt_to_pmc_numeric_array(type, suffix) \
- if (pmt_is_ ## suffix ## vector(p)) \
- { \
- size_t n; const type* i = pmt_ ## suffix ## vector_elements(p, n); \
- return PMC::make(std::vector<type>(i, i+n)); \
- }
- decl_pmt_to_pmc_numeric_array(uint8_t, u8);
- decl_pmt_to_pmc_numeric_array(uint16_t, u16);
- decl_pmt_to_pmc_numeric_array(uint32_t, u32);
- decl_pmt_to_pmc_numeric_array(uint64_t, u64);
- decl_pmt_to_pmc_numeric_array(int8_t, s8);
- decl_pmt_to_pmc_numeric_array(int16_t, s16);
- decl_pmt_to_pmc_numeric_array(int32_t, s32);
- decl_pmt_to_pmc_numeric_array(int64_t, s64);
- decl_pmt_to_pmc_numeric_array(float, f32);
- decl_pmt_to_pmc_numeric_array(double, f64);
- decl_pmt_to_pmc_numeric_array(std::complex<float>, c32);
- decl_pmt_to_pmc_numeric_array(std::complex<double>, c64);
-
- //dictionary container
- if (pmt_is_dict(p))
- {
- PMCDict m;
- pmt_t items = pmt_dict_items(p);
- for (size_t i = 0; i < pmt_length(items); i++)
- {
- pmt_t item = pmt_nth(i, items);
- PMCC key = pmt_to_pmc(pmt_car(item));
- PMCC val = pmt_to_pmc(pmt_cdr(item));
- m[key] = val;
- }
- return PMC::make(m);
- }
-
- //set container
- //FIXME no pmt_is_list...
-
- //backup plan... store the pmt
- return PMC::make(p);
-}
-
-}
-
-#endif /*INCLUDED_LIBGRAS_PMX_HELPER_HPP*/
diff --git a/lib/register_messages.cpp b/lib/register_messages.cpp
index 4d774ea..b23c4a2 100644
--- a/lib/register_messages.cpp
+++ b/lib/register_messages.cpp
@@ -14,28 +14,28 @@
// You should have received a copy of the GNU Lesser General Public License
// along with io_sig program. If not, see <http://www.gnu.org/licenses/>.
-#include <gnuradio/top_block.hpp>
+#include <gras/top_block.hpp>
#include <gras_impl/messages.hpp>
#include <gras_impl/interruptible_thread.hpp>
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::TopAllocMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::TopActiveMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::TopInertMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::TopTokenMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::GlobalBlockConfig);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::SharedThreadGroup);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::TopAllocMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::TopActiveMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::TopInertMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::TopTokenMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::GlobalBlockConfig);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::SharedThreadGroup);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::InputTagMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::InputBufferMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::InputTokenMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::InputCheckMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::InputAllocMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::InputTagMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::InputBufferMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::InputTokenMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::InputCheckMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::InputAllocMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::OutputBufferMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::OutputTokenMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::OutputCheckMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::OutputHintMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::OutputAllocMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::OutputBufferMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::OutputTokenMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::OutputCheckMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::OutputHintMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::OutputAllocMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::SelfKickMessage);
-THERON_DEFINE_REGISTERED_MESSAGE(gnuradio::UpdateInputsMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::SelfKickMessage);
+THERON_DEFINE_REGISTERED_MESSAGE(gras::UpdateInputsMessage);
diff --git a/lib/sbuffer.cpp b/lib/sbuffer.cpp
index ab5c72c..37c2c33 100644
--- a/lib/sbuffer.cpp
+++ b/lib/sbuffer.cpp
@@ -14,13 +14,13 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gnuradio/sbuffer.hpp>
+#include <gras/sbuffer.hpp>
#include "alloc_on_node.hpp"
#include <boost/bind.hpp>
-using namespace gnuradio;
+using namespace gras;
-void gnuradio::sbuffer_handle_deref(SBufferImpl *impl)
+void gras::sbuffer_handle_deref(SBufferImpl *impl)
{
//call the deleter if possible
boost::shared_ptr<SBufferDeleter> token_deleter = impl->config.token.lock();
diff --git a/lib/tag_handlers.hpp b/lib/tag_handlers.hpp
index 4e630fb..408e28b 100644
--- a/lib/tag_handlers.hpp
+++ b/lib/tag_handlers.hpp
@@ -20,7 +20,7 @@
#include <gras_impl/block_actor.hpp>
#include <algorithm>
-namespace gnuradio
+namespace gras
{
GRAS_FORCE_INLINE void BlockActor::sort_tags(const size_t i)
@@ -80,6 +80,6 @@ GRAS_FORCE_INLINE void BlockActor::trim_tags(const size_t i)
if (last != 0) tags_i.erase(tags_i.begin(), tags_i.begin()+last);
}
-} //namespace gnuradio
+} //namespace gras
#endif /*INCLUDED_LIBGRAS_TAG_HANDLERS_HPP*/
diff --git a/lib/tags.cpp b/lib/tags.cpp
index ec563d0..a837c24 100644
--- a/lib/tags.cpp
+++ b/lib/tags.cpp
@@ -14,9 +14,9 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <gnuradio/tags.hpp>
+#include <gras/tags.hpp>
-using namespace gnuradio;
+using namespace gras;
Tag::Tag(void):
offset(0)
@@ -30,7 +30,7 @@ Tag::Tag(const uint64_t &offset, const PMCC &key, const PMCC &value, const PMCC
//NOP
}
-bool gnuradio::operator<(const Tag &lhs, const Tag &rhs)
+bool gras::operator<(const Tag &lhs, const Tag &rhs)
{
return lhs.offset < rhs.offset;
}
diff --git a/lib/theron_allocator.cpp b/lib/theron_allocator.cpp
index 3158159..e5b3748 100644
--- a/lib/theron_allocator.cpp
+++ b/lib/theron_allocator.cpp
@@ -22,7 +22,7 @@
* and otherwise the regular malloc/free for larger buffers.
**********************************************************************/
-#include <gnuradio/gras.hpp>
+#include <gras/gras.hpp>
#include <gras_impl/debug.hpp>
#include <Theron/Detail/Threading/SpinLock.h>
#include <Theron/IAllocator.h>
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index a09744e..b82f603 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -15,10 +15,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "element_impl.hpp"
-#include <gnuradio/top_block.hpp>
+#include <gras/top_block.hpp>
#include <boost/thread/thread.hpp> //sleep
-using namespace gnuradio;
+using namespace gras;
GlobalBlockConfig::GlobalBlockConfig(void)
{
diff --git a/lib/topology_handler.cpp b/lib/topology_handler.cpp
index 5ad9378..27c2346 100644
--- a/lib/topology_handler.cpp
+++ b/lib/topology_handler.cpp
@@ -16,7 +16,7 @@
#include <gras_impl/block_actor.hpp>
-using namespace gnuradio;
+using namespace gras;
template <typename V, typename Sig>
void fill_item_sizes_from_sig(V &v, const Sig &s, const size_t size)