GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
rep_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_REP_SINK_H
12#define INCLUDED_ZEROMQ_REP_SINK_H
13
14#include <gnuradio/sync_block.h>
15#include <gnuradio/zeromq/api.h>
16
17namespace gr {
18namespace zeromq {
19
20/*!
21 * \brief Sink the contents of a stream to a ZMQ REP socket
22 * \ingroup zeromq
23 *
24 * \details
25 * This block acts a a streaming sink for a GNU Radio flowgraph
26 * and writes its contents to a ZMQ REP socket. A REP socket will
27 * only send its contents to an attached REQ socket when it
28 * requests items.
29 */
30class ZEROMQ_API rep_sink : virtual public gr::sync_block
31{
32public:
33 typedef std::shared_ptr<rep_sink> sptr;
34
35 /*!
36 * \brief Return a shared_ptr to a new instance of zeromq::rep_sink.
37 *
38 * \param itemsize Size of a stream item in bytes.
39 * \param vlen Vector length of the input items. Note that one vector is one item.
40 * \param address ZMQ socket address specifier.
41 * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments.
42 * \param pass_tags Whether sink will serialize and pass tags over the link.
43 * \param hwm High Watermark to configure the socket to (-1 => zmq's default)
44 */
45 static sptr make(size_t itemsize,
46 size_t vlen,
47 char* address,
48 int timeout = 100,
49 bool pass_tags = false,
50 int hwm = -1);
51
52 /*!
53 * \brief Return a std::string of ZMQ_LAST_ENDPOINT from the underlying ZMQ socket.
54 */
55 virtual std::string last_endpoint() = 0;
56};
57
58} // namespace zeromq
59} // namespace gr
60
61#endif /* INCLUDED_ZEROMQ_REP_SINK_H */
synchronous 1:1 input to output with history
Definition: sync_block.h:26
Sink the contents of a stream to a ZMQ REP socket.
Definition: rep_sink.h:31
virtual std::string last_endpoint()=0
Return a std::string of ZMQ_LAST_ENDPOINT from the underlying ZMQ socket.
static sptr make(size_t itemsize, size_t vlen, char *address, int timeout=100, bool pass_tags=false, int hwm=-1)
Return a shared_ptr to a new instance of zeromq::rep_sink.
std::shared_ptr< rep_sink > sptr
Definition: rep_sink.h:33
#define ZEROMQ_API
Definition: gr-zeromq/include/gnuradio/zeromq/api.h:18
GR_RUNTIME_API size_t itemsize(types::vector_type type)
GNU Radio logging wrapper.
Definition: basic_block.h:29