Salome HOME
merge from branch BR_V5_DEV
[modules/kernel.git] / src / Launcher / SALOME_Launcher_Parser.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #include "SALOME_Launcher_Parser.hxx"
23 #include <iostream>
24 #include <sstream>
25
26 #define NULL_VALUE 0
27
28 using namespace std;
29
30 void MachineParameters::Clear()
31 {
32   EnvFile = "";
33   WorkDirectory = "";
34 }
35
36 void MachineParameters::Print() const
37 {
38   ostringstream oss;
39   oss << " EnvFile: " <<  EnvFile 
40       << " WorkDirectory: " <<  WorkDirectory << endl;
41
42   cout << oss.str();
43 }
44
45 void ParserLauncherType::Print() const
46 {
47   ostringstream oss;
48   oss << endl <<
49     "RefDirectory: " << RefDirectory << endl << 
50     "NbOfProcesses: " << NbOfProcesses << endl <<
51     "InputFile: ";
52   for(int i=0; i <InputFile.size();i++)
53     oss << InputFile[i] << " ";
54   oss << endl << "OutputFile: ";
55   for(int i=0; i <OutputFile.size();i++)
56     oss << OutputFile[i] << " ";
57   oss << endl <<
58     "Command: " << Command << endl <<
59     "Machines: " << endl;
60
61   cout << oss.str();
62
63   std::map < string, MachineParameters >::const_iterator it;
64   for(it=MachinesList.begin();it!=MachinesList.end();it++){
65     cout << "  " << it->first;
66     it->second.Print();
67   }
68
69 }
70
71 void ParserLauncherType::Clear()
72 {
73   MachinesList.clear();
74   RefDirectory = "";
75   NbOfProcesses = 1;
76   InputFile.clear();
77   OutputFile.clear();
78   Command = "";
79 }