Salome HOME
Porting SALOME KERNEL to CMake
[modules/kernel.git] / src / Launcher / SALOME_Launcher_Handler.cxx
index 31b4e7ce1c0beec25eb2fb3f8b05c1f3ad814834..185e58d34305ebe79a516846bfc273dbf5ff8e8e 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
 //  File   : SALOME_Laucher_Handler.cxx
 //  Author : Bernard Secher
 #include <iostream>
 #include <map>
 
-using namespace std;
-
-#ifdef _DEBUG_
-static int MYDEBUG = 1;
-#else
-static int MYDEBUG = 0;
-#endif
-
 //=============================================================================
 /*!
  *  Constructor
@@ -108,26 +101,26 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_machine_list) ){
       xmlNodePtr aCurNode2 = aCurNode->xmlChildrenNode;
       while(aCurNode2 != NULL){
-       if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
-         _machp.Clear();
-         xmlChar* name = xmlNodeGetContent(aCurNode2);
-         string clusterName = (const char*)name;
-         xmlFree(name);
-       
-         if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
-           xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
-           _machp.EnvFile = (const char*)envfile;
-           xmlFree(envfile);
-         }
-
-         if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
-           xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
-           _machp.WorkDirectory = (const char*)workdirectory;
-           xmlFree(workdirectory);
-         }
-         _launch.MachinesList[clusterName]=_machp ;
-       }
-       aCurNode2 = aCurNode2->next;
+        if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
+          _machp.Clear();
+          xmlChar* name = xmlNodeGetContent(aCurNode2);
+          std::string clusterName = (const char*)name;
+          xmlFree(name);
+        
+          if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
+            xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
+            _machp.EnvFile = (const char*)envfile;
+            xmlFree(envfile);
+          }
+
+          if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
+            xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
+            _machp.WorkDirectory = (const char*)workdirectory;
+            xmlFree(workdirectory);
+          }
+          _launch.MachinesList[clusterName]=_machp ;
+        }
+        aCurNode2 = aCurNode2->next;
       }
     }
 
@@ -136,31 +129,31 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
       _launch.RefDirectory = (const char*)refdirectory;
       xmlFree(refdirectory);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_nb_processes) ){
       xmlChar* nbofprocesses = xmlNodeGetContent(aCurNode);
       _launch.NbOfProcesses = atoi((const char*)nbofprocesses);
       xmlFree(nbofprocesses);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_input_file) ){
       xmlChar* inputfile = xmlNodeGetContent(aCurNode);
       _launch.InputFile.push_back((const char*)inputfile);
       xmlFree(inputfile);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_output_file) ){
       xmlChar* outputfile = xmlNodeGetContent(aCurNode);
       _launch.OutputFile.push_back((const char*)outputfile);
       xmlFree(outputfile);
     }
-         
+          
     if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_command) ){
       xmlChar* command = xmlNodeGetContent(aCurNode);
       _launch.Command = (const char*)command;
       xmlFree(command);
     }
-         
+          
     aCurNode = aCurNode->next;
   }