Mercurial > hg > aimc
comparison src/Support/ModuleTree.h @ 195:0db637cac96b
- Added as-yet-unfinished support for a proper configuraiton file format
- Added a couple of pythin scripts to generate HMM configuration files
- Variable name changes and other cosmetic things
- Added the option for the noise generation to do pink noise (untested)
author | tomwalters |
---|---|
date | Thu, 12 Aug 2010 11:28:11 +0000 |
parents | 3cdaa81c3aca |
children | 503b6f40d0aa |
comparison
equal
deleted
inserted
replaced
194:578ec2d32170 | 195:0db637cac96b |
---|---|
22 /*! \author: Thomas Walters <tom@acousticscale.org> | 22 /*! \author: Thomas Walters <tom@acousticscale.org> |
23 * \date 2010/08/08 | 23 * \date 2010/08/08 |
24 * \version \$Id: $ | 24 * \version \$Id: $ |
25 */ | 25 */ |
26 | 26 |
27 #include <iostream> | |
28 #include <map> | |
29 #include <string> | 27 #include <string> |
30 | |
31 #include "Support/Common.h" | |
32 #include "Support/Module.h" | |
33 #include "Support/Parameters.h" | |
34 #include "Support/SignalBank.h" | |
35 #include "Support/linked_ptr.h" | |
36 | 28 |
37 namespace aimc { | 29 namespace aimc { |
38 using std::string; | 30 using std::string; |
39 using std::map; | |
40 using std::ostream; | |
41 | |
42 class ModuleTree { | 31 class ModuleTree { |
43 public: | 32 public: |
44 ModuleTree(); | 33 bool ParseConfigFile(const string &filename); |
45 bool LoadConfigFile(const string &filename); | 34 bool ParseConfigText(const string &config_text); |
46 bool LoadConfigText(const string &config_text); | 35 void set_output_filename_prefix(const string &prefix); |
47 string GetFullConfig(); | |
48 bool Initialize(Parameters *global_parameters); | |
49 void Reset(); | |
50 void PrintConfiguration(ostream &out); | |
51 void Process(); | |
52 void MakeDotGraph(ostream &out); | |
53 void set_output_filename_prefix(const string &prefix) { | |
54 output_filename_prefix_ = prefix; | |
55 }; | |
56 string output_filename_prefix() { | 36 string output_filename_prefix() { |
57 return output_filename_prefix_; | 37 return output_filename_prefix_; |
58 }; | 38 } |
59 private: | 39 private: |
60 bool ConstructTree(); | |
61 Parameters config_; | |
62 SignalBank s_; | |
63 string output_filename_prefix_; | 40 string output_filename_prefix_; |
64 map<string, linked_ptr<Module> > modules_; | |
65 Module *root_module_; | |
66 map<string, linked_ptr<Parameters> > parameters_; | |
67 bool initialized_; | |
68 DISALLOW_COPY_AND_ASSIGN(ModuleTree); | 41 DISALLOW_COPY_AND_ASSIGN(ModuleTree); |
69 }; | 42 }; |
70 } // namespace aimc | 43 } // namespace aimc |