annotate src/Support/ModuleTree.h @ 120:89e4facffd93

- Module tree
author tomwalters
date Sun, 17 Oct 2010 02:42:12 +0000
parents 077c7ecc2d5f
children 3cdaa81c3aca
rev   line source
tomwalters@84 1 // Copyright 2010, Thomas Walters
tomwalters@84 2 //
tomwalters@84 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@84 4 // http://www.acousticscale.org/AIMC
tomwalters@84 5 //
tomwalters@84 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@84 7 // you may not use this file except in compliance with the License.
tomwalters@84 8 // You may obtain a copy of the License at
tomwalters@84 9 //
tomwalters@84 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@84 11 //
tomwalters@84 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@84 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@84 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@84 15 // See the License for the specific language governing permissions and
tomwalters@84 16 // limitations under the License.
tomwalters@84 17
tomwalters@84 18 /*! \file
tomwalters@84 19 * \brief Parse a configuration file to generate a tree of modules.
tomwalters@84 20 */
tomwalters@84 21
tomwalters@84 22 /*! \author: Thomas Walters <tom@acousticscale.org>
tomwalters@84 23 * \date 2010/08/08
tomwalters@84 24 * \version \$Id: $
tomwalters@84 25 */
tomwalters@84 26
tomwalters@114 27 #include <boost/scoped_ptr.hpp>
tomwalters@114 28 #include <hash_map>
tomwalters@84 29 #include <string>
tomwalters@84 30
tomwalters@84 31 namespace aimc {
tomwalters@84 32 using std::string;
tomwalters@120 33 class Module;
tomwalters@120 34 class Parameters;
tomwalters@120 35
tomwalters@84 36 class ModuleTree {
tomwalters@84 37 public:
tomwalters@84 38 bool ParseConfigFile(const string &filename);
tomwalters@84 39 bool ParseConfigText(const string &config_text);
tomwalters@114 40 string GetFullConfig()
tomwalters@114 41 void set_output_filename_prefix(const string &prefix) {
tomwalters@114 42 output_filename_prefix_ = prefix;
tomwalters@114 43 }
tomwalters@84 44 string output_filename_prefix() {
tomwalters@84 45 return output_filename_prefix_;
tomwalters@84 46 }
tomwalters@84 47 private:
tomwalters@120 48 Paramters config_;
tomwalters@84 49 string output_filename_prefix_;
tomwalters@114 50 hash_map<string, scoped_ptr<Module> > modules_;
tomwalters@120 51 hash_map<string, scoped_ptr<Parameters> > parameters_;
tomwalters@114 52 string root_name_;
tomwalters@84 53 DISALLOW_COPY_AND_ASSIGN(ModuleTree);
tomwalters@84 54 };
tomwalters@84 55 } // namespace aimc