8 #ifndef INCLUDED_UHD_RFNOC_BLOCK_H
9 #define INCLUDED_UHD_RFNOC_BLOCK_H
13 #include <uhd/rfnoc/noc_block_base.hpp>
33 using sptr = std::shared_ptr<rfnoc_block>;
44 static ::uhd::rfnoc::noc_block_base::sptr
46 const ::uhd::device_addr_t& block_args,
47 const std::string& block_name,
48 const int device_select = -1,
49 const int block_select = -1,
50 const size_t max_ref_count = 1);
55 template <
typename block_type>
58 auto cast_block_ref = std::dynamic_pointer_cast<block_type>(d_block_ref);
59 if (!cast_block_ref) {
60 throw std::runtime_error(
62 "Unable to cast the following block into its desired type: ") +
63 d_block_ref->get_unique_id());
65 return cast_block_ref;
83 ::uhd::rfnoc::noc_block_base::sptr d_block_ref;
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:60
Definition: rfnoc_block.h:25
::uhd::rfnoc::noc_block_base::sptr make_block_ref(rfnoc_graph::sptr graph, const ::uhd::device_addr_t &block_args, const std::string &block_name, const int device_select=-1, const int block_select=-1, const size_t max_ref_count=1)
Factory function to create a UHD block controller reference.
rfnoc_block(::uhd::rfnoc::noc_block_base::sptr block_ref)
std::string get_unique_id() const
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
This method should never be called by RFNoC blocks, they do the work.
std::shared_ptr< rfnoc_block > sptr
Definition: rfnoc_block.h:33
rfnoc_block()
Definition: rfnoc_block.h:30
std::shared_ptr< block_type > get_block_ref()
Return a type-cast block reference, or throw if the cast failed.
Definition: rfnoc_block.h:56
std::shared_ptr< rfnoc_graph > sptr
Definition: rfnoc_graph.h:31
#define GR_UHD_API
Definition: gr-uhd/include/gnuradio/uhd/api.h:18
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29
std::vector< const void * > gr_vector_const_void_star
Definition: types.h:28
std::vector< void * > gr_vector_void_star
Definition: types.h:27
std::vector< int > gr_vector_int
Definition: types.h:23