18 #ifndef INCLUDED_UHD_DEVICE3_HPP 19 #define INCLUDED_UHD_DEVICE3_HPP 22 #include <uhd/rfnoc/graph.hpp> 23 #include <uhd/rfnoc/block_ctrl_base.hpp> 24 #include <boost/units/detail/utility.hpp> 39 typedef boost::shared_ptr<device3>
sptr;
42 static sptr make(
const device_addr_t &hint,
const size_t which = 0);
44 virtual rfnoc::graph::sptr create_graph(
const std::string &name=
"") = 0;
57 bool has_block(
const rfnoc::block_id_t &block_id)
const;
64 bool has_block(
const rfnoc::block_id_t &block_id)
const 66 if (has_block(block_id)) {
67 return bool(boost::dynamic_pointer_cast<T>(get_block_ctrl(block_id)));
80 rfnoc::block_ctrl_base::sptr get_block_ctrl(
const rfnoc::block_id_t &block_id)
const;
98 boost::shared_ptr<T> blk = boost::dynamic_pointer_cast<T>(get_block_ctrl(block_id));
102 throw uhd::lookup_error(str(boost::format(
"This device does not have a block of type %s with ID: %s")
103 % boost::units::detail::demangle(
typeid(T).name())
104 % block_id.to_string()));
119 std::vector<rfnoc::block_id_t> find_blocks(
const std::string &block_id_hint)
const;
123 template <
typename T>
124 std::vector<rfnoc::block_id_t>
find_blocks(
const std::string &block_id_hint)
const 126 std::vector<rfnoc::block_id_t> all_block_ids = find_blocks(block_id_hint);
127 std::vector<rfnoc::block_id_t> filt_block_ids;
128 for (
size_t i = 0; i < all_block_ids.size(); i++) {
129 if (has_block<T>(all_block_ids[i])) {
130 filt_block_ids.push_back(all_block_ids[i]);
133 return filt_block_ids;
Definition: exception.hpp:59
std::vector< rfnoc::block_id_t > find_blocks(const std::string &block_id_hint) const
Definition: device3.hpp:124
Extends uhd::device for third-generation USRP devices.
Definition: device3.hpp:36
Definition: build_info.hpp:25
std::vector< rfnoc::block_ctrl_base::sptr > _rfnoc_block_ctrl
List of all RFNoC blocks available on this device.
Definition: device3.hpp:140
#define UHD_API
Definition: config.h:73
bool has_block(const rfnoc::block_id_t &block_id) const
Definition: device3.hpp:64
boost::shared_ptr< T > get_block_ctrl(const rfnoc::block_id_t &block_id) const
Definition: device3.hpp:96
Definition: device.hpp:38
boost::shared_ptr< device3 > sptr
Definition: device3.hpp:39
Definition: device_addr.hpp:47