GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
map_bb.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006,2012 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_MAP_BB_H
12 #define INCLUDED_GR_MAP_BB_H
13 
14 #include <gnuradio/digital/api.h>
15 #include <gnuradio/sync_block.h>
16 
17 namespace gr {
18 namespace digital {
19 
20 /*!
21  * \brief output[i] = map[input[i]]
22  * \ingroup symbol_coding_blk
23  *
24  * \details
25  * This block maps an incoming signal to the value in the map.
26  * The block expects that the incoming signal has a maximum
27  * value of len(map)-1.
28  *
29  * -> output[i] = map[input[i]]
30  */
31 class DIGITAL_API map_bb : virtual public sync_block
32 {
33 public:
34  // gr::digital::map_bb::sptr
35  typedef std::shared_ptr<map_bb> sptr;
36 
37  /*!
38  * Make a map block.
39  *
40  * \param map a vector of integers that maps x to map[x].
41  */
42  static sptr make(const std::vector<int>& map);
43 
44  virtual void set_map(const std::vector<int>& map) = 0;
45  virtual std::vector<int> map() const = 0;
46 };
47 
48 } /* namespace digital */
49 } /* namespace gr */
50 
51 #endif /* INCLUDED_GR_MAP_BB_H */
output[i] = map[input[i]]
Definition: map_bb.h:32
std::shared_ptr< map_bb > sptr
Definition: map_bb.h:35
virtual void set_map(const std::vector< int > &map)=0
virtual std::vector< int > map() const =0
static sptr make(const std::vector< int > &map)
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29
PMT_API pmt_t map(pmt_t proc(const pmt_t &), pmt_t list)
Apply proc element-wise to the elements of list and returns a list of the results,...