diff options
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/hier_block2.h | 6 | ||||
-rw-r--r-- | gnuradio-runtime/include/gnuradio/top_block.h | 5 | ||||
-rw-r--r-- | gnuradio-runtime/lib/hier_block2.cc | 4 | ||||
-rw-r--r-- | gnuradio-runtime/lib/test.cc | 26 | ||||
-rw-r--r-- | gnuradio-runtime/lib/test.h | 15 | ||||
-rw-r--r-- | gnuradio-runtime/lib/top_block.cc | 2 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc | 2 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc | 2 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc | 2 |
9 files changed, 26 insertions, 38 deletions
diff --git a/gnuradio-runtime/include/gnuradio/hier_block2.h b/gnuradio-runtime/include/gnuradio/hier_block2.h index 69173becd6..fc81796a78 100644 --- a/gnuradio-runtime/include/gnuradio/hier_block2.h +++ b/gnuradio-runtime/include/gnuradio/hier_block2.h @@ -34,10 +34,8 @@ class GR_RUNTIME_API hier_block2 : public basic_block { private: friend class hier_block2_detail; - friend GR_RUNTIME_API hier_block2_sptr - make_hier_block2(const std::string& name, - gr::io_signature::sptr input_signature, - gr::io_signature::sptr output_signature); + template <typename T, typename... Args> + friend std::shared_ptr<T> gnuradio::make_block_sptr(Args&&... args); /*! * \brief Private implementation details of gr::hier_block2. diff --git a/gnuradio-runtime/include/gnuradio/top_block.h b/gnuradio-runtime/include/gnuradio/top_block.h index fd8ab66a94..12051e6f04 100644 --- a/gnuradio-runtime/include/gnuradio/top_block.h +++ b/gnuradio-runtime/include/gnuradio/top_block.h @@ -28,8 +28,9 @@ GR_RUNTIME_API top_block_sptr make_top_block(const std::string& name, class GR_RUNTIME_API top_block : public hier_block2 { private: - friend GR_RUNTIME_API top_block_sptr make_top_block(const std::string& name, - bool catch_exceptions); + template <typename T, typename... Args> + friend std::shared_ptr<T> gnuradio::make_block_sptr(Args&&... args); + std::unique_ptr<top_block_impl> d_impl; diff --git a/gnuradio-runtime/lib/hier_block2.cc b/gnuradio-runtime/lib/hier_block2.cc index 035152051c..18b60b9a47 100644 --- a/gnuradio-runtime/lib/hier_block2.cc +++ b/gnuradio-runtime/lib/hier_block2.cc @@ -27,8 +27,8 @@ hier_block2_sptr make_hier_block2(const std::string& name, gr::io_signature::sptr input_signature, gr::io_signature::sptr output_signature) { - return gnuradio::get_initial_sptr( - new hier_block2(name, input_signature, output_signature)); + return gnuradio::make_block_sptr<hier_block2>( + name, input_signature, output_signature); } hier_block2::hier_block2() {} diff --git a/gnuradio-runtime/lib/test.cc b/gnuradio-runtime/lib/test.cc index 9f2e3c58e0..810489e928 100644 --- a/gnuradio-runtime/lib/test.cc +++ b/gnuradio-runtime/lib/test.cc @@ -34,19 +34,19 @@ test_sptr make_test(const std::string& name, consume_type_t cons_type, produce_type_t prod_type) { - return gnuradio::get_initial_sptr(new test(name, - min_inputs, - max_inputs, - sizeof_input_item, - min_outputs, - max_outputs, - sizeof_output_item, - history, - output_multiple, - relative_rate, - fixed_rate, - cons_type, - prod_type)); + return gnuradio::make_block_sptr<test>(name, + min_inputs, + max_inputs, + sizeof_input_item, + min_outputs, + max_outputs, + sizeof_output_item, + history, + output_multiple, + relative_rate, + fixed_rate, + cons_type, + prod_type); } test::test(const std::string& name, diff --git a/gnuradio-runtime/lib/test.h b/gnuradio-runtime/lib/test.h index ab03231861..2b8dc78252 100644 --- a/gnuradio-runtime/lib/test.h +++ b/gnuradio-runtime/lib/test.h @@ -205,19 +205,8 @@ protected: consume_type_t cons_type, produce_type_t prod_type); - friend GR_RUNTIME_API test_sptr make_test(const std::string& name, - int min_inputs, - int max_inputs, - unsigned int sizeof_input_item, - int min_outputs, - int max_outputs, - unsigned int sizeof_output_item, - unsigned int history, - unsigned int output_multiple, - double relative_rate, - bool fixed_rate, - consume_type_t cons_type, - produce_type_t prod_type); + template <typename T, typename... Args> + friend std::shared_ptr<T> gnuradio::make_block_sptr(Args&&... args); }; } /* namespace gr */ diff --git a/gnuradio-runtime/lib/top_block.cc b/gnuradio-runtime/lib/top_block.cc index aad25f005a..c7e0ee74ce 100644 --- a/gnuradio-runtime/lib/top_block.cc +++ b/gnuradio-runtime/lib/top_block.cc @@ -24,7 +24,7 @@ namespace gr { top_block_sptr make_top_block(const std::string& name, bool catch_exceptions) { - return gnuradio::get_initial_sptr(new top_block(name, catch_exceptions)); + return gnuradio::make_block_sptr<top_block>(name, catch_exceptions); } top_block::top_block(const std::string& name, bool catch_exceptions) diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc index f2d439ad52..8e3531bd2e 100644 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/hier_block2_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(hier_block2.h) */ -/* BINDTOOL_HEADER_FILE_HASH(367d4df8d747ae4040c2e5b46cbe1b4f) */ +/* BINDTOOL_HEADER_FILE_HASH(64f7da5ad13cee375a2646d78073229b) */ /***********************************************************************************/ #include <pybind11/complex.h> diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc index 91706dd079..1f7d5a43ce 100644 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/sptr_magic_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(sptr_magic.h) */ -/* BINDTOOL_HEADER_FILE_HASH(53ec33a057706160ccd13788ef91ab9b) */ +/* BINDTOOL_HEADER_FILE_HASH(79deab244963f18ba5e14b48a482f967) */ /***********************************************************************************/ #include <pybind11/complex.h> diff --git a/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc b/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc index 16a9c817a8..caed388ad5 100644 --- a/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc +++ b/gnuradio-runtime/python/gnuradio/gr/bindings/top_block_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(top_block.h) */ -/* BINDTOOL_HEADER_FILE_HASH(c3f0d1bdb473739fbd3e929fc8338e94) */ +/* BINDTOOL_HEADER_FILE_HASH(96ae1e4a3aed7d59ef7e8c596e83c07e) */ /***********************************************************************************/ #include <pybind11/complex.h> |