Salome HOME
- appli_path bug write fix
[modules/kernel.git] / src / ResourcesManager / SALOME_ResourcesCatalog_Handler.hxx
index 497f0dddf8beada9608a5b576818f3535f946edb..0be33ec67e33c231e39129253637cb00fd94d6c3 100755 (executable)
@@ -1,6 +1,6 @@
-//  SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  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
 //  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_ResourcesCatalog_Handler.hxx
 //  Author : Estelle Deville
 //  Module : SALOME
 //$Header$
-
+//
 #ifndef SALOME_RESOURCES_CATALOG_HANDLER
 #define SALOME_RESOURCES_CATALOG_HANDLER
 
+
+#include "ResourcesManager_Defs.hxx"
+
 #include "SALOME_ResourcesCatalog_Parser.hxx"
 
-#include <qxml.h>
 #include <string>
 #include <vector>
 
-class QDomElement;
-
-class QDomDocument;
-
-class SALOME_ResourcesCatalog_Handler : public QXmlDefaultHandler
-  {
+#include <libxml/parser.h>
 
+class RESOURCESMANAGER_EXPORT SALOME_ResourcesCatalog_Handler
+{
+  
   public :
-    SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& listOfResources);
+    SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& resources_list);
 
     const MapOfParserResourcesType& GetResourcesAfterParsing() const;
 
     virtual ~SALOME_ResourcesCatalog_Handler();
 
-    virtual bool startDocument();
-
-    virtual bool startElement(const QString& , const QString& ,
-                              const QString& name, 
-                             const QXmlAttributes& attrs);
-
-    virtual bool endElement(const QString&, const QString&,
-                            const QString& qName);
+    void ProcessXmlDocument(xmlDocPtr theDoc);
 
-    virtual bool characters(const QString& chars);
-
-    virtual bool endDocument();
-
-   virtual QString errorProtocol();
-    virtual bool fatalError(const QXmlParseException& exception);
-
-    void PrepareDocToXmlFile(QDomDocument& doc);
+    bool ProcessMachine(xmlNodePtr machine_descr, ParserResourcesType & resource);
+    bool ProcessCluster(xmlNodePtr cluster_descr, ParserResourcesType & resource);
+    bool ProcessMember(xmlNodePtr member_descr, ParserResourcesClusterMembersType & resource);
+  
+    void PrepareDocToXmlFile(xmlDocPtr theDoc);
 
   private :
-    QString errorProt;
-    std::string content;
-    std::string previous_module_name;
-    std::string previous_module_path;
+    std::string previous_component_name;
 
     ParserResourcesType _resource;
     MapOfParserResourcesType& _resources_list;
 
     const char *test_machine;
-    const char *test_resources;
-
+    const char *test_cluster;
+    const char *test_name;
     const char *test_hostname;
-    const char *test_alias;
     const char *test_protocol;
+    const char *test_cluster_internal_protocol;
     const char *test_mode;
+    const char *test_batch;
+    const char *test_mpi;
     const char *test_user_name;
     const char *test_appli_path;
+    // for compatibility
     const char *test_modules;
     const char *test_module_name;
-    const char *test_module_path;
-    const char *test_pre_req_file_path;
+    const char *test_components;
+    const char *test_component_name;
     const char *test_os;
     const char *test_mem_in_mb;
     const char *test_cpu_freq_mhz;
     const char *test_nb_of_nodes;
+    const char *test_nb_of_proc;
     const char *test_nb_of_proc_per_node;
+    const char *test_batch_queue;
+    const char *test_user_commands;
+    const char *test_use;
+    const char *test_members;
 
   };