9 #ifndef INCLUDED_UHD_DEVICE3_HPP 10 #define INCLUDED_UHD_DEVICE3_HPP 15 #include <boost/core/demangle.hpp> 16 #include <boost/thread/mutex.hpp> 31 typedef boost::shared_ptr<device3>
sptr;
34 static sptr make(
const device_addr_t& hint,
const size_t which = 0);
59 if (has_block(block_id)) {
60 return bool(boost::dynamic_pointer_cast<T>(get_block_ctrl(block_id)));
94 boost::shared_ptr<T> blk =
95 boost::dynamic_pointer_cast<T>(get_block_ctrl(block_id));
100 boost::format(
"This device does not have a block of type %s with ID: %s")
101 % boost::core::demangle(
typeid(T).name()) % block_id.
to_string()));
128 std::vector<rfnoc::block_id_t> find_blocks(
const std::string& block_id_hint)
const;
132 template <
typename T>
133 std::vector<rfnoc::block_id_t>
find_blocks(
const std::string& block_id_hint)
const 135 std::vector<rfnoc::block_id_t> all_block_ids = find_blocks(block_id_hint);
136 std::vector<rfnoc::block_id_t> filt_block_ids;
137 for (
size_t i = 0; i < all_block_ids.size(); i++) {
138 if (has_block<T>(all_block_ids[i])) {
139 filt_block_ids.push_back(all_block_ids[i]);
142 return filt_block_ids;
std::string to_string() const
Return a string like this: "0/FFT_1" (includes all components, if set)
Definition: exception.hpp:60
boost::shared_ptr< uhd::rfnoc::graph > sptr
Definition: graph.hpp:20
std::vector< rfnoc::block_id_t > find_blocks(const std::string &block_id_hint) const
Definition: device3.hpp:133
Extends uhd::device for third-generation USRP devices.
Definition: device3.hpp:28
Definition: block_id.hpp:39
Definition: build_info.hpp:13
boost::mutex _block_ctrl_mutex
Mutex to protect access to members.
Definition: device3.hpp:151
boost::shared_ptr< block_ctrl_base > sptr
Definition: block_ctrl_base.hpp:93
std::vector< rfnoc::block_ctrl_base::sptr > _rfnoc_block_ctrl
List of all RFNoC blocks available on this device.
Definition: device3.hpp:149
#define UHD_API
Definition: config.h:68
bool has_block(const rfnoc::block_id_t &block_id) const
Definition: device3.hpp:57
boost::shared_ptr< T > get_block_ctrl(const rfnoc::block_id_t &block_id) const
Definition: device3.hpp:92
Definition: device.hpp:28
boost::shared_ptr< device3 > sptr
Definition: device3.hpp:31
Definition: device_addr.hpp:38