eDSP  0.0.1
A cross-platform DSP library written in C++.
constant_generator.hpp
Go to the documentation of this file.
1 /*
2  * eDSP, A cross-platform Digital Signal Processing library written in modern C++.
3  * Copyright (C) 2018 Mohammed Boujemaoui Boulaghmoudi, All rights reserved.
4  *
5  * This program is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the Free
7  * Software Foundation, either version 3 of the License, or (at your option)
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along width
16  * this program. If not, see <http://www.gnu.org/licenses/>
17  *
18  * File: pink_noise.hpp
19  * Author: Mohammed Boujemaoui
20  * Date: 01/08/2018
21  */
22 #ifndef EDSP_CONSTANT_GENERATOR_HPP
23 #define EDSP_CONSTANT_GENERATOR_HPP
24 
25 namespace edsp { namespace random {
26 
31  template <typename T>
33  using value_type = T;
34 
39  explicit constant_generator(const value_type& value) : generator_(value) {}
40 
46  return generator_;
47  }
48 
49  private:
50  T generator_;
51  };
52 
53 }} // namespace edsp::random
54 
55 #endif // EDSP_CONSTANT_GENERATOR_HPP
constant_generator(const value_type &value)
Creates a random generator.
Definition: constant_generator.hpp:39
value_type operator()()
Generates a constant number.
Definition: constant_generator.hpp:45
This class implements a constant generator.
Definition: constant_generator.hpp:32
T value_type
Definition: constant_generator.hpp:33
Definition: amplifier.hpp:29