Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
algorithmfactorydescription.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2015 Haye Hinrichsen, Christoph Wick
3  *
4  * This file is part of Entropy Piano Tuner.
5  *
6  * Entropy Piano Tuner is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * Entropy Piano Tuner is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * Entropy Piano Tuner. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 #ifndef ALGORITHMFACTROYDESCRIPTION_H
21 #define ALGORITHMFACTROYDESCRIPTION_H
22 
23 #include <string>
24 #include <map>
25 #include <algorithm>
26 
28 {
29 public:
30  AlgorithmFactoryDescription(const std::string algorithmName);
31 
32  const std::string &getAlgorithmName() const {return mAlgorithmName;}
33 
34  void setDoubleParameter(const std::string &s, double p) {mDoubleParameters[s] = p;}
35  bool hasDoubleParameter(const std::string &s) const {return mDoubleParameters.count(s) > 0;}
36  double getDoubleParameter(const std::string &s) const;
37 
38  void setIntParameter(const std::string &s, int i) {mIntParamters[s] = i;}
39  bool hasIntParameter(const std::string &s) const {return mIntParamters.count(s) > 0;}
40  int getIntParameter(const std::string &s) const;
41 
42  void setStringParameter(const std::string &id, const std::string &s) {mStringParameters[id] = s;}
43  bool hasStringParameter(const std::string &id) const {return mStringParameters.count(id) > 0;}
44  const std::string &getStringParameter(const std::string &id) const;
45 
46 private:
47  const std::string mAlgorithmName;
48 
49  std::map<std::string, double> mDoubleParameters;
50  std::map<std::string, int> mIntParamters;
51  std::map<std::string, std::string> mStringParameters;
52 };
53 
54 #endif // ALGORITHMFACTROYDESCRIPTION_H
void setDoubleParameter(const std::string &s, double p)
bool hasDoubleParameter(const std::string &s) const
const std::string & getAlgorithmName() const
bool hasIntParameter(const std::string &s) const
double getDoubleParameter(const std::string &s) const
std::map< std::string, double > mDoubleParameters
int getIntParameter(const std::string &s) const
void setStringParameter(const std::string &id, const std::string &s)
AlgorithmFactoryDescription(const std::string algorithmName)
std::map< std::string, std::string > mStringParameters
std::map< std::string, int > mIntParamters
const std::string & getStringParameter(const std::string &id) const
void setIntParameter(const std::string &s, int i)
bool hasStringParameter(const std::string &id) const