10#ifndef INCLUDED_BLOCK_GATEWAY_H
11#define INCLUDED_BLOCK_GATEWAY_H
19#include <pybind11/pybind11.h>
26namespace py = pybind11;
44 const std::string&
name,
49 using sptr = std::shared_ptr<block_gateway>;
60 const std::string&
name,
93 unsigned int which_input, uint64_t
start, uint64_t end,
const pmt::pmt_t& key);
94 [[nodiscard]] std::optional<gr::tag_t>
119 py::handle d_py_handle;
122 using msg_handlers_pybind_t = std::map<pmt::pmt_t, std::string, pmt::comparator>;
123 msg_handlers_pybind_t d_msg_handlers_pybind;
125 bool has_msg_handler(
pmt::pmt_t which_port)
override;
enum { GW_BLOCK_GENERAL=0, GW_BLOCK_SYNC, GW_BLOCK_DECIM, GW_BLOCK_INTERP } gw_block_t
Definition block_gateway.h:33
Definition block_gateway.h:41
void set_msg_handler_pybind(const pmt::pmt_t &which_port, std::string &handler_name)
std::vector< gr::tag_t > _get_tags_in_window(unsigned int which_input, uint64_t rel_start, uint64_t rel_end, const pmt::pmt_t &key)
std::optional< gr::tag_t > _get_first_tag_in_range(unsigned int which_input, uint64_t start, uint64_t end, const pmt::pmt_t &key)
std::shared_ptr< block_gateway > sptr
Definition block_gateway.h:49
bool start() override
Called to enable drivers, etc for i/o devices.
std::vector< gr::tag_t > _get_tags_in_range(unsigned int which_input, uint64_t abs_start, uint64_t abs_end)
gr::logger_ptr _get_logger() const
Definition block_gateway.h:116
void forecast(int noutput_items, gr_vector_int &ninput_items_required) override
Estimate input requirements given output request.
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)
static sptr make(const py::object &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_range(unsigned int which_input, uint64_t abs_start, uint64_t abs_end, const pmt::pmt_t &key)
std::vector< gr::tag_t > _get_tags_in_window(unsigned int which_input, uint64_t rel_start, uint64_t rel_end)
std::optional< gr::tag_t > _get_first_tag_in_range(unsigned int which_input, uint64_t start, uint64_t end, std::function< bool(const gr::tag_t &)>)
void _add_item_tag(unsigned int which_output, uint64_t abs_offset, const pmt::pmt_t &key, const pmt::pmt_t &value, const pmt::pmt_t &srcid)
void _add_item_tag(unsigned int which_output, const gr::tag_t &tag)
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
gr::logger_ptr d_logger
Definition basic_block.h:96
std::string name() const
Definition basic_block.h:168
The abstract base class for all 'terminal' processing blocks.
Definition gnuradio-runtime/include/gnuradio/block.h:65
std::shared_ptr< io_signature > sptr
Definition io_signature.h:52
STL class.
Definition vector_docstub.h:11
std::shared_ptr< logger > logger_ptr
Definition logger.h:248
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition pmt.h:85