CMtuAdaptiveConfig.cpp

Go to the documentation of this file.
00001 #include <fstream>
00002 #include <algorithm>
00003  #include <CFatalException.h>
00004 #include "CMtuAdaptiveConfig.h"
00005 using namespace std;
00006 void CMtuAdaptiveConfig::GetData(string filename)
00007 {
00008 ifstream infile;
00009 infile.open(filename.c_str());
00010 infile.peek();
00011 if (!infile)
00012   throw CFatalException("No Configurationfile found !");
00013  GetData(infile);infile.close();
00014 }
00015 
00016 void CMtuAdaptiveConfig::GetData(std::ifstream &instream)
00017 {
00018 CMtuAdaptiveConfigLexer lexer(instream);
00019 CMtuAdaptiveConfigParser parser(lexer);
00020 parser.configfile();
00021 mu= parser.mu;
00022 delta= parser.delta;
00023 lambda= parser.lambda;
00024 filterlength= parser.filterlength;
00025 shift= parser.shift;
00026 secfactor= parser.secfactor;
00027 alpha= parser.alpha;
00028 hiddenlayers= parser.hiddenlayers;
00029 }
00030 
00031 void CMtuAdaptiveConfig::WriteData(string filename)
00032 {
00033 ofstream confout(filename.c_str());
00034 WriteData(confout);}
00035 
00036 void CMtuAdaptiveConfig::WriteData(std::ofstream &outstream)
00037 {
00038 outstream << "mu"  << "=" ;
00039 outstream << mu << endl;
00040 outstream << "delta"  << "=" ;
00041 outstream << delta << endl;
00042 outstream << "lambda"  << "=" ;
00043 outstream << lambda << endl;
00044 outstream << "filterlength"  << "=" ;
00045 outstream << filterlength << endl;
00046 outstream << "shift"  << "=" ;
00047 outstream << shift << endl;
00048 outstream << "secfactor"  << "=" ;
00049 outstream << secfactor << endl;
00050 outstream << "alpha"  << "=" ;
00051 outstream << alpha << endl;
00052 outstream << "hiddenlayers"  << "=" ;
00053 outstream << hiddenlayers << endl;
00054 }
00055 

Generated on Fri Jul 4 15:30:20 2008 for GPLIB++ by  doxygen 1.5.5