diff options
author | Andriy Gelman <andriy.gelman@gmail.com> | 2020-01-12 01:54:44 -0500 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-03-02 18:15:24 -0500 |
commit | 1b362a2336f6f9b0db57021e280ff65e32409905 (patch) | |
tree | c8fcaef950c4661a652b90862e34a9629bdc42ae /gr-zeromq/lib/pub_sink_impl.cc | |
parent | 5f18a419e2cec9f46d67147cae957d304d7a0195 (diff) |
gr-zeromq: Add optional key filtering
Fixes #2236
Allows to filter a multi-part message by key/topic on a sub source and
insert key/topic on a pub sink.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Diffstat (limited to 'gr-zeromq/lib/pub_sink_impl.cc')
-rw-r--r-- | gr-zeromq/lib/pub_sink_impl.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gr-zeromq/lib/pub_sink_impl.cc b/gr-zeromq/lib/pub_sink_impl.cc index 098888bade..84a7364152 100644 --- a/gr-zeromq/lib/pub_sink_impl.cc +++ b/gr-zeromq/lib/pub_sink_impl.cc @@ -19,19 +19,29 @@ namespace gr { namespace zeromq { -pub_sink::sptr pub_sink::make( - size_t itemsize, size_t vlen, char* address, int timeout, bool pass_tags, int hwm) +pub_sink::sptr pub_sink::make(size_t itemsize, + size_t vlen, + char* address, + int timeout, + bool pass_tags, + int hwm, + const std::string& key) { return gnuradio::get_initial_sptr( - new pub_sink_impl(itemsize, vlen, address, timeout, pass_tags, hwm)); + new pub_sink_impl(itemsize, vlen, address, timeout, pass_tags, hwm, key)); } -pub_sink_impl::pub_sink_impl( - size_t itemsize, size_t vlen, char* address, int timeout, bool pass_tags, int hwm) +pub_sink_impl::pub_sink_impl(size_t itemsize, + size_t vlen, + char* address, + int timeout, + bool pass_tags, + int hwm, + const std::string& key) : gr::sync_block("pub_sink", gr::io_signature::make(1, 1, itemsize * vlen), gr::io_signature::make(0, 0, 0)), - base_sink_impl(ZMQ_PUB, itemsize, vlen, address, timeout, pass_tags, hwm) + base_sink_impl(ZMQ_PUB, itemsize, vlen, address, timeout, pass_tags, hwm, key) { /* All is delegated */ } |