GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
The Free & Open Software Radio Ecosystem
selector.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 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_GR_SELECTOR_H
12 #define INCLUDED_GR_SELECTOR_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/blocks/api.h>
16 
17 namespace gr {
18 namespace blocks {
19 
20 /*!
21  * \brief output[output_index][i] = input[input_index][i]
22  * \ingroup misc_blk
23  *
24  * \details
25  * Connect the sink at input index to the source at output index
26  * Samples from other input ports are consumed and dumped
27  * Other output ports produce no samples
28  *
29  */
30 class BLOCKS_API selector : virtual public block
31 {
32 public:
33  typedef std::shared_ptr<selector> sptr;
34 
35  static sptr
36  make(size_t itemsize, unsigned int input_index, unsigned int output_index);
37 
38  // When enabled is set to false, no output samples are produced
39  // Otherwise samples are copied to the selected output port
40  virtual void set_enabled(bool enable) = 0;
41  virtual bool enabled() const = 0;
42 
43  virtual void set_input_index(unsigned int input_index) = 0;
44  virtual int input_index() const = 0;
45 
46  virtual void set_output_index(unsigned int output_index) = 0;
47  virtual int output_index() const = 0;
48 };
49 
50 } /* namespace blocks */
51 } /* namespace gr */
52 
53 #endif /* INCLUDED_GR_SELECTOR_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:60
output[output_index][i] = input[input_index][i]
Definition: selector.h:31
virtual int input_index() const =0
virtual void set_output_index(unsigned int output_index)=0
static sptr make(size_t itemsize, unsigned int input_index, unsigned int output_index)
std::shared_ptr< selector > sptr
Definition: selector.h:33
virtual bool enabled() const =0
virtual void set_input_index(unsigned int input_index)=0
virtual int output_index() const =0
virtual void set_enabled(bool enable)=0
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
BLOCKS_API size_t itemsize(vector_type type)
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29