GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
multiply_const.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2012,2018 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 
12 #ifndef MULTIPLY_CONST_H
13 #define MULTIPLY_CONST_H
14 
15 #include <gnuradio/blocks/api.h>
16 #include <gnuradio/sync_block.h>
17 #include <cstdint>
18 
19 namespace gr {
20 namespace blocks {
21 
22 /*!
23  * \brief output = input * constant
24  * \ingroup math_operators_blk
25  */
26 template <class T>
27 class BLOCKS_API multiply_const : virtual public sync_block
28 {
29 
30 public:
31  // gr::blocks::multiply_const::sptr
32  typedef std::shared_ptr<multiply_const<T>> sptr;
33 
34  /*!
35  * \brief Create an instance of multiply_const
36  * \param k multiplicative constant
37  * \param vlen number of items in vector
38  */
39  static sptr make(T k, size_t vlen = 1);
40 
41  /*!
42  * \brief Return multiplicative constant
43  */
44  virtual T k() const = 0;
45 
46  /*!
47  * \brief Set multiplicative constant
48  */
49  virtual void set_k(T k) = 0;
50 };
51 
56 } /* namespace blocks */
57 } /* namespace gr */
58 
59 #endif /* MULTIPLY_CONST_H */
output = input * constant
Definition: multiply_const.h:28
std::shared_ptr< multiply_const< T > > sptr
Definition: multiply_const.h:32
static sptr make(T k, size_t vlen=1)
Create an instance of multiply_const.
virtual T k() const =0
Return multiplicative constant.
virtual void set_k(T k)=0
Set multiplicative constant.
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
multiply_const< std::int32_t > multiply_const_ii
Definition: multiply_const.h:53
multiply_const< std::int16_t > multiply_const_ss
Definition: multiply_const.h:52
multiply_const< float > multiply_const_ff
Definition: multiply_const.h:54
multiply_const< gr_complex > multiply_const_cc
Definition: multiply_const.h:55
GNU Radio logging wrapper.
Definition: basic_block.h:29