Back to index

salome-kernel  6.5.0
SALOME_Launcher_Parser.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include "SALOME_Launcher_Parser.hxx"
00024 #include <iostream>
00025 #include <sstream>
00026 
00027 #define NULL_VALUE 0
00028 
00029 void MachineParameters::Clear()
00030 {
00031   EnvFile = "";
00032   WorkDirectory = "";
00033 }
00034 
00035 void MachineParameters::Print() const
00036 {
00037   std::ostringstream oss;
00038   oss << " EnvFile: " <<  EnvFile 
00039       << " WorkDirectory: " <<  WorkDirectory << std::endl;
00040 
00041   std::cout << oss.str();
00042 }
00043 
00044 void ParserLauncherType::Print() const
00045 {
00046   std::ostringstream oss;
00047   oss << std::endl <<
00048     "RefDirectory: " << RefDirectory << std::endl << 
00049     "NbOfProcesses: " << NbOfProcesses << std::endl <<
00050     "InputFile: ";
00051   for(int i=0; i <InputFile.size();i++)
00052     oss << InputFile[i] << " ";
00053   oss << std::endl << "OutputFile: ";
00054   for(int i=0; i <OutputFile.size();i++)
00055     oss << OutputFile[i] << " ";
00056   oss << std::endl <<
00057     "Command: " << Command << std::endl <<
00058     "Machines: " << std::endl;
00059 
00060   std::cout << oss.str();
00061 
00062   std::map < std::string, MachineParameters >::const_iterator it;
00063   for(it=MachinesList.begin();it!=MachinesList.end();it++){
00064     std::cout << "  " << it->first;
00065     it->second.Print();
00066   }
00067 
00068 }
00069 
00070 void ParserLauncherType::Clear()
00071 {
00072   MachinesList.clear();
00073   RefDirectory = "";
00074   NbOfProcesses = 1;
00075   InputFile.clear();
00076   OutputFile.clear();
00077   Command = "";
00078 }