diff options
author | Thomas Habets <thomas@habets.se> | 2020-03-14 12:01:44 +0000 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2020-04-01 11:44:45 -0400 |
commit | 7a9169fe8cca1cb378be0d0d403e03a338ffbfda (patch) | |
tree | fef77ae9c34538b78e4172580cb5ecdc24d40134 /gnuradio-runtime/include/gnuradio/sptr_magic.h | |
parent | 82262753a56d15cfa6343044c726cf0035c38d9c (diff) |
Switch from boost pointers to std C++11 pointers
Most of this code is automated code changes:
```
set -e
SUB="s/dummy/dummy/"
for i in shared_ptr make_shared dynamic_pointer_cast weak_ptr enable_shared_from_this get_deleter; do
SUB="$SUB;s/boost::$i/std::$i/g"
done
SUB="$SUB;s^#include <boost/shared_ptr.hpp>^#include <memory>^g"
SUB="$SUB;s^namespace boost^namespace std^g"
find . \( -name "*.cc" -o -name "*.h" -o -name "*.i" -o -name "*.cxx" -o -name "*.py" \) -print0 | xargs -0 sed -i "$SUB"
```
Only one manual change. In `./gr-fec/lib/fec_mtrx_impl.cc`, add
`#include <algorithm>`.
Diffstat (limited to 'gnuradio-runtime/include/gnuradio/sptr_magic.h')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/sptr_magic.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gnuradio-runtime/include/gnuradio/sptr_magic.h b/gnuradio-runtime/include/gnuradio/sptr_magic.h index 4d447885ab..fdcb68f91d 100644 --- a/gnuradio-runtime/include/gnuradio/sptr_magic.h +++ b/gnuradio-runtime/include/gnuradio/sptr_magic.h @@ -12,7 +12,7 @@ #define INCLUDED_GR_RUNTIME_SPTR_MAGIC_H #include <gnuradio/api.h> -#include <boost/shared_ptr.hpp> +#include <memory> namespace gr { class basic_block; @@ -25,7 +25,7 @@ namespace detail { class GR_RUNTIME_API sptr_magic { public: - static boost::shared_ptr<gr::basic_block> fetch_initial_sptr(gr::basic_block* p); + static std::shared_ptr<gr::basic_block> fetch_initial_sptr(gr::basic_block* p); static void create_and_stash_initial_sptr(gr::hier_block2* p); static void cancel_initial_sptr(gr::hier_block2* p); }; @@ -33,12 +33,12 @@ public: /* * \brief New! Improved! Standard method to get/create the - * boost::shared_ptr for a block. + * std::shared_ptr for a block. */ template <class T> -boost::shared_ptr<T> get_initial_sptr(T* p) +std::shared_ptr<T> get_initial_sptr(T* p) { - return boost::dynamic_pointer_cast<T, gr::basic_block>( + return std::dynamic_pointer_cast<T, gr::basic_block>( detail::sptr_magic::fetch_initial_sptr(p)); } } // namespace gnuradio |