SeisAdaptiveConfig.cpp

Go to the documentation of this file.
00001 #include <fstream>
00002 #include <algorithm>
00003  #include <CFatalException.h>
00004 #include "SeisAdaptiveConfig.h"
00005 using namespace std;
00006 void SeisAdaptiveConfig::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 SeisAdaptiveConfig::GetData(std::ifstream &instream)
00017 {
00018 SeisAdaptiveConfigLexer lexer(instream);
00019 SeisAdaptiveConfigParser 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 SeisAdaptiveConfig::WriteData(string filename)
00032 {
00033 ofstream confout(filename.c_str());
00034 WriteData(confout);}
00035 
00036 void SeisAdaptiveConfig::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 Tue May 4 16:52:15 2010 for GPLIB++ by  doxygen 1.5.8