Skip to content

Commit 7a9169f

Browse files
ThomasHabetsmichaelld
authored andcommittedApr 1, 2020
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>`.
1 parent 8226275 commit 7a9169f

File tree

512 files changed

+659
-665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

512 files changed

+659
-665
lines changed
 

‎docs/doxygen/other/shared_ptr_docstub.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace boost {
1+
namespace std {
22
/*!
33
* \brief shared_ptr documentation stub
44
*
@@ -20,4 +20,4 @@ class shared_ptr
2020
}; // shared_ptr
2121

2222

23-
} // namespace boost
23+
} // namespace std

‎gnuradio-runtime/include/gnuradio/basic_block.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <gnuradio/runtime_types.h>
1818
#include <gnuradio/sptr_magic.h>
1919
#include <gnuradio/thread/thread.h>
20-
#include <boost/enable_shared_from_this.hpp>
2120
#include <boost/function.hpp>
2221
#include <boost/thread/condition_variable.hpp>
2322
#include <deque>
@@ -41,7 +40,7 @@ namespace gr {
4140
* processing functions.
4241
*/
4342
class GR_RUNTIME_API basic_block : public msg_accepter,
44-
public boost::enable_shared_from_this<basic_block>
43+
public std::enable_shared_from_this<basic_block>
4544
{
4645
typedef boost::function<void(pmt::pmt_t)> msg_handler_t;
4746

@@ -53,7 +52,7 @@ class GR_RUNTIME_API basic_block : public msg_accepter,
5352
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comparator> msg_queue_map_t;
5453
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comparator>::iterator
5554
msg_queue_map_itr;
56-
std::map<pmt::pmt_t, boost::shared_ptr<boost::condition_variable>, pmt::comparator>
55+
std::map<pmt::pmt_t, std::shared_ptr<boost::condition_variable>, pmt::comparator>
5756
msg_queue_ready;
5857

5958
gr::thread::mutex mutex; //< protects all vars
@@ -291,7 +290,7 @@ class GR_RUNTIME_API basic_block : public msg_accepter,
291290
* store them. Each block has a vector to do this, and these never
292291
* need to be accessed again once they are registered with the RPC
293292
* backend. This function takes a
294-
* boost::shared_sptr<rpcbasic_base> so that when the block is
293+
* std::shared_sptr<rpcbasic_base> so that when the block is
295294
* deleted, all RPC registered variables are cleaned up.
296295
*
297296
* \param s an rpcbasic_sptr of the new RPC variable register to store.

0 commit comments

Comments
 (0)
Please sign in to comment.