ToPS
|
00001 /* 00002 * ConfigurationReader.hpp 00003 * 00004 * Copyright 2011 Andre Yoshiaki Kashiwabara <akashiwabara@usp.br> 00005 * Ígor Bonádio <ibonadio@ime.usp.br> 00006 * Vitor Onuchic <vitoronuchic@gmail.com> 00007 * Alan Mitchell Durham <aland@usp.br> 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 3 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00022 * MA 02110-1301, USA. 00023 */ 00024 00025 #ifndef CONFIGURATION_READER_HPP 00026 #define CONFIGURATION_READER_HPP 00027 #include <boost/shared_ptr.hpp> 00028 00029 #include "crossplatform.hpp" 00030 00031 #include <iostream> 00032 #include <string> 00033 00034 00035 using namespace std; 00036 00037 00038 namespace tops { 00039 00040 class DLLEXPORT Alphabet; 00041 class DLLEXPORT ProbabilisticModelParameters; 00042 00043 class DLLEXPORT ProbabilisticModelParameterValue; 00044 typedef boost::shared_ptr<ProbabilisticModelParameterValue> ProbabilisticModelParameterValuePtr; 00045 typedef boost::shared_ptr<ProbabilisticModelParameters> ProbabilisticModelParametersPtr; 00046 00048 class DLLEXPORT ConfigurationReader { 00049 public: 00050 00051 ConfigurationReader(); 00053 bool load( std::string & data); 00054 00056 bool loadFromFile( const std::string & filename); 00057 00058 void setCurrentParameterValue(ProbabilisticModelParameterValuePtr value); 00059 00060 ProbabilisticModelParameterValuePtr getCurrentParameterValue(); 00061 00062 void setCurrentParameterName(const std::string & name); 00063 00064 void setAuxString(const std::string & aux) ; 00065 00066 std::string getAuxString(); 00067 00068 std::string getCurrentParameterName(); 00069 00070 void add_parameter(); 00071 00072 ProbabilisticModelParametersPtr parameters(); 00073 00074 std::string getAuxString2(); 00075 00076 std::string getAuxString3(); 00077 00078 void setAuxString2(const std::string & aux); 00079 00080 void setAuxString3(const std::string & aux); 00081 void reset(); 00082 00083 private: 00084 ProbabilisticModelParametersPtr _parameters; 00085 ProbabilisticModelParameterValuePtr _current_value; 00086 std::string _current_name; 00087 std::string _aux_string; 00088 std::string _aux_string_2; 00089 std::string _aux_string_3; 00090 }; 00091 00092 00093 00094 } 00095 00096 #endif