GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
pub_msg_sink.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013,2014 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio.
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_ZEROMQ_PUB_MSG_SINK_H
12 #define INCLUDED_ZEROMQ_PUB_MSG_SINK_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/zeromq/api.h>
16 
17 namespace gr {
18 namespace zeromq {
19 
20 /*!
21  * \brief Sink the contents of a msg port to a ZMQ PUB socket
22  * \ingroup zeromq
23  *
24  * \details
25  * This block acts a message port receiver and writes individual
26  * messages to a ZMQ PUB socket. A PUB socket may have
27  * subscribers and will pass all incoming messages to each
28  * subscriber. Subscribers can be either another gr-zeromq source
29  * block or a non-GNU Radio ZMQ socket.
30  */
31 class ZEROMQ_API pub_msg_sink : virtual public gr::block
32 {
33 public:
34  typedef std::shared_ptr<pub_msg_sink> sptr;
35 
36  /*!
37  * \brief Return a shared_ptr to a new instance of zeromq::pub_msg_sink.
38  *
39  * \param address ZMQ socket address specifier
40  * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments
41  * \param bind If true this block will bind to the address, otherwise it will
42  * connect; the default is to bind
43  *
44  */
45  static sptr make(char* address, int timeout = 100, bool bind = true);
46 
47  /*!
48  * \brief Return a std::string of ZMQ_LAST_ENDPOINT from the underlying ZMQ socket.
49  */
50  virtual std::string last_endpoint() = 0;
51 };
52 
53 } // namespace zeromq
54 } // namespace gr
55 
56 #endif /* INCLUDED_ZEROMQ_PUB_MSG_SINK_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Sink the contents of a msg port to a ZMQ PUB socket.
Definition: pub_msg_sink.h:32
virtual std::string last_endpoint()=0
Return a std::string of ZMQ_LAST_ENDPOINT from the underlying ZMQ socket.
static sptr make(char *address, int timeout=100, bool bind=true)
Return a shared_ptr to a new instance of zeromq::pub_msg_sink.
std::shared_ptr< pub_msg_sink > sptr
Definition: pub_msg_sink.h:34
#define ZEROMQ_API
Definition: gr-zeromq/include/gnuradio/zeromq/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29