summaryrefslogtreecommitdiff
path: root/gnuradio-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r--gnuradio-runtime/include/gnuradio/thread/thread_group.h1
-rw-r--r--gnuradio-runtime/include/pmt/pmt.h13
-rw-r--r--gnuradio-runtime/lib/block_registry.cc3
-rw-r--r--gnuradio-runtime/lib/pmt/pmt.cc17
-rw-r--r--gnuradio-runtime/lib/pmt/pmt_int.h10
-rw-r--r--gnuradio-runtime/lib/pmt/qa_pmt_prims.cc15
-rw-r--r--gnuradio-runtime/python/pmt/__init__.py2
7 files changed, 31 insertions, 30 deletions
diff --git a/gnuradio-runtime/include/gnuradio/thread/thread_group.h b/gnuradio-runtime/include/gnuradio/thread/thread_group.h
index 9895068373..425858636f 100644
--- a/gnuradio-runtime/include/gnuradio/thread/thread_group.h
+++ b/gnuradio-runtime/include/gnuradio/thread/thread_group.h
@@ -17,7 +17,6 @@
#include <gnuradio/api.h>
#include <gnuradio/thread/thread.h>
-#include <boost/any.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/function.hpp>
#include <boost/thread/shared_mutex.hpp>
diff --git a/gnuradio-runtime/include/pmt/pmt.h b/gnuradio-runtime/include/pmt/pmt.h
index b55cc57d9f..7afdb92288 100644
--- a/gnuradio-runtime/include/pmt/pmt.h
+++ b/gnuradio-runtime/include/pmt/pmt.h
@@ -12,8 +12,8 @@
#define INCLUDED_PMT_H
#include <pmt/api.h>
-#include <boost/any.hpp>
#include <boost/noncopyable.hpp>
+#include <any>
#include <complex>
#include <cstdint>
#include <iosfwd>
@@ -664,10 +664,9 @@ PMT_API pmt_t dict_values(pmt_t dict);
/*
* ------------------------------------------------------------------------
- * Any (wraps boost::any -- can be used to wrap pretty much anything)
+ * Any (wraps std::any -- can be used to wrap pretty much anything)
*
* Cannot be serialized or used across process boundaries.
- * See http://www.boost.org/doc/html/any.html
* ------------------------------------------------------------------------
*/
@@ -675,13 +674,13 @@ PMT_API pmt_t dict_values(pmt_t dict);
PMT_API bool is_any(pmt_t obj);
//! make an any
-PMT_API pmt_t make_any(const boost::any& any);
+PMT_API pmt_t make_any(const std::any& any);
-//! Return underlying boost::any
-PMT_API boost::any any_ref(pmt_t obj);
+//! Return underlying std::any
+PMT_API std::any any_ref(pmt_t obj);
//! Store \p any in \p obj
-PMT_API void any_set(pmt_t obj, const boost::any& any);
+PMT_API void any_set(pmt_t obj, const std::any& any);
/*
diff --git a/gnuradio-runtime/lib/block_registry.cc b/gnuradio-runtime/lib/block_registry.cc
index a32c0e6801..9ba79c924a 100644
--- a/gnuradio-runtime/lib/block_registry.cc
+++ b/gnuradio-runtime/lib/block_registry.cc
@@ -13,6 +13,7 @@
#include <gnuradio/block_detail.h>
#include <gnuradio/block_registry.h>
#include <gnuradio/tpb_detail.h>
+#include <any>
gr::block_registry global_block_registry;
@@ -96,7 +97,7 @@ basic_block_sptr block_registry::block_lookup(pmt::pmt_t symbol)
if (pmt::eq(ref, pmt::PMT_NIL)) {
throw std::runtime_error("block lookup failed! block not found!");
}
- basic_block* blk = boost::any_cast<basic_block*>(pmt::any_ref(ref));
+ basic_block* blk = std::any_cast<basic_block*>(pmt::any_ref(ref));
return blk->shared_from_this();
}
diff --git a/gnuradio-runtime/lib/pmt/pmt.cc b/gnuradio-runtime/lib/pmt/pmt.cc
index d4ada683f9..043b9eb6a6 100644
--- a/gnuradio-runtime/lib/pmt/pmt.cc
+++ b/gnuradio-runtime/lib/pmt/pmt.cc
@@ -16,6 +16,7 @@
#include <gnuradio/messages/msg_accepter.h>
#include <pmt/pmt.h>
#include <pmt/pmt_pool.h>
+#include <any>
#include <cstdio>
#include <cstring>
#include <vector>
@@ -741,20 +742,20 @@ pmt_t dict_values(pmt_t dict)
// Any
////////////////////////////////////////////////////////////////////////////
-pmt_any::pmt_any(const boost::any& any) : d_any(any) {}
+pmt_any::pmt_any(const std::any& any) : d_any(any) {}
bool is_any(pmt_t obj) { return obj->is_any(); }
-pmt_t make_any(const boost::any& any) { return pmt_t(new pmt_any(any)); }
+pmt_t make_any(const std::any& any) { return pmt_t(new pmt_any(any)); }
-boost::any any_ref(pmt_t obj)
+std::any any_ref(pmt_t obj)
{
if (!obj->is_any())
throw wrong_type("pmt_any_ref", obj);
return _any(obj)->ref();
}
-void any_set(pmt_t obj, const boost::any& any)
+void any_set(pmt_t obj, const std::any& any)
{
if (!obj->is_any())
throw wrong_type("pmt_any_set", obj);
@@ -770,8 +771,8 @@ bool is_msg_accepter(const pmt_t& obj)
if (!is_any(obj))
return false;
- boost::any r = any_ref(obj);
- return boost::any_cast<gr::messages::msg_accepter_sptr>(&r) != 0;
+ std::any r = any_ref(obj);
+ return std::any_cast<gr::messages::msg_accepter_sptr>(&r) != 0;
}
//! make a msg_accepter
@@ -781,8 +782,8 @@ pmt_t make_msg_accepter(gr::messages::msg_accepter_sptr ma) { return make_any(ma
gr::messages::msg_accepter_sptr msg_accepter_ref(const pmt_t& obj)
{
try {
- return boost::any_cast<gr::messages::msg_accepter_sptr>(any_ref(obj));
- } catch (boost::bad_any_cast& e) {
+ return std::any_cast<gr::messages::msg_accepter_sptr>(any_ref(obj));
+ } catch (std::bad_any_cast& e) {
throw wrong_type("pmt_msg_accepter_ref", obj);
}
}
diff --git a/gnuradio-runtime/lib/pmt/pmt_int.h b/gnuradio-runtime/lib/pmt/pmt_int.h
index 7aadefe4d7..1c4b149a49 100644
--- a/gnuradio-runtime/lib/pmt/pmt_int.h
+++ b/gnuradio-runtime/lib/pmt/pmt_int.h
@@ -11,7 +11,7 @@
#define INCLUDED_PMT_INT_H
#include <pmt/pmt.h>
-#include <boost/any.hpp>
+#include <any>
/*
* EVERYTHING IN THIS FILE IS PRIVATE TO THE IMPLEMENTATION!
@@ -170,15 +170,15 @@ public:
class pmt_any : public pmt_base
{
- boost::any d_any;
+ std::any d_any;
public:
- pmt_any(const boost::any& any);
+ pmt_any(const std::any& any);
//~pmt_any();
bool is_any() const override { return true; }
- const boost::any& ref() const { return d_any; }
- void set(const boost::any& any) { d_any = any; }
+ const std::any& ref() const { return d_any; }
+ void set(const std::any& any) { d_any = any; }
};
diff --git a/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc b/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc
index f74dd2f7f9..7219f6f099 100644
--- a/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc
+++ b/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc
@@ -12,6 +12,7 @@
#include <pmt/api.h> //reason: suppress warnings
#include <boost/format.hpp>
#include <boost/test/unit_test.hpp>
+#include <any>
#include <cstring>
#include <sstream>
@@ -455,9 +456,9 @@ std::ostream& operator<<(std::ostream& os, const foo obj)
BOOST_AUTO_TEST_CASE(test_any)
{
- boost::any a0;
- boost::any a1;
- boost::any a2;
+ std::any a0;
+ std::any a1;
+ std::any a2;
a0 = std::string("Hello!");
a1 = 42;
@@ -468,11 +469,11 @@ BOOST_AUTO_TEST_CASE(test_any)
pmt::pmt_t p2 = pmt::make_any(a2);
BOOST_CHECK_EQUAL(std::string("Hello!"),
- boost::any_cast<std::string>(pmt::any_ref(p0)));
+ std::any_cast<std::string>(pmt::any_ref(p0)));
- BOOST_CHECK_EQUAL(42, boost::any_cast<int>(pmt::any_ref(p1)));
+ BOOST_CHECK_EQUAL(42, std::any_cast<int>(pmt::any_ref(p1)));
- BOOST_CHECK_EQUAL(foo(3.250, 21), boost::any_cast<foo>(pmt::any_ref(p2)));
+ BOOST_CHECK_EQUAL(foo(3.250, 21), std::any_cast<foo>(pmt::any_ref(p2)));
}
// ------------------------------------------------------------------------
@@ -491,7 +492,7 @@ BOOST_AUTO_TEST_CASE(test_msg_accepter)
{
pmt::pmt_t sym = pmt::mp("my-symbol");
- boost::any a0;
+ std::any a0;
a0 = std::string("Hello!");
pmt::pmt_t p0 = pmt::make_any(a0);
diff --git a/gnuradio-runtime/python/pmt/__init__.py b/gnuradio-runtime/python/pmt/__init__.py
index 9b313330b0..d654ad542c 100644
--- a/gnuradio-runtime/python/pmt/__init__.py
+++ b/gnuradio-runtime/python/pmt/__init__.py
@@ -24,7 +24,7 @@ more flexible.
The PMT library supports the following major types:
bool, symbol (string), integer, real, complex, null, pair, list,
-vector, dict, uniform_vector, any (boost::any cast)
+vector, dict, uniform_vector, any (std::any cast)
'''