10 #ifndef INCLUDED_BLOCK_GATEWAY_H
11 #define INCLUDED_BLOCK_GATEWAY_H
19 #include <pybind11/pybind11.h>
25 namespace py = pybind11;
43 const std::string&
name,
48 using sptr = std::shared_ptr<block_gateway>;
58 static sptr make(
const py::object& py_handle,
59 const std::string& name,
75 std::vector<gr::tag_t>
83 std::vector<gr::tag_t>
101 bool start()
override;
103 bool stop()
override;
110 py::handle d_py_handle;
113 using msg_handlers_pybind_t = std::map<pmt::pmt_t, std::string, pmt::comparator>;
114 msg_handlers_pybind_t d_msg_handlers_pybind;
116 bool has_msg_handler(
pmt::pmt_t which_port)
override;
std::shared_ptr< io_signature > sptr
Definition: io_signature.h:52
GR_RUNTIME_API const pmt::pmt_t msg()
bool start() override
Called to enable drivers, etc for i/o devices.
std::vector< const void * > gr_vector_const_void_star
Definition: types.h:28
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
compute output items from input items
std::shared_ptr< logger > logger_ptr
Definition: logger.h:250
std::string name() const
Definition: basic_block.h:168
static sptr make(const py::object &py_handle, const std::string &name, gr::io_signature::sptr in_sig, gr::io_signature::sptr out_sig)
void set_msg_handler_pybind(const pmt::pmt_t &which_port, std::string &handler_name)
enum{GW_BLOCK_GENERAL=0, GW_BLOCK_SYNC, GW_BLOCK_DECIM, GW_BLOCK_INTERP} gw_block_t
Definition: block_gateway.h:37
std::vector< void * > gr_vector_void_star
Definition: types.h:27
Definition: block_gateway.h:39
gr::logger_ptr _get_logger() const
Definition: block_gateway.h:107
bool stop() override
Called to disable drivers, etc for i/o devices.
block_gateway(const py::handle &py_handle, const std::string &name, gr::io_signature::sptr in_sig, gr::io_signature::sptr out_sig)
std::vector< gr::tag_t > _get_tags_in_window(unsigned int which_input, uint64_t rel_start, uint64_t rel_end)
std::vector< gr::tag_t > _get_tags_in_range(unsigned int which_input, uint64_t abs_start, uint64_t abs_end)
void forecast(int noutput_items, gr_vector_int &ninput_items_required) override
Estimate input requirements given output request.
void _add_item_tag(unsigned int which_output, const gr::tag_t &tag)
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: gnuradio-runtime/include/gnuradio/block.h:62
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:83
gr::logger_ptr d_logger
Definition: basic_block.h:96
std::shared_ptr< block_gateway > sptr
Definition: block_gateway.h:48
std::vector< int > gr_vector_int
Definition: types.h:23