Salome HOME
Ajout des properties
[modules/kernel.git] / src / ResourcesManager / SALOME_ResourcesCatalog_Handler.hxx
1 //  SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
2 //
3 //  Copyright (C) 2003  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 //
23 //
24 //  File   : SALOME_ResourcesCatalog_Handler.hxx
25 //  Author : Estelle Deville
26 //  Module : SALOME
27 //$Header$
28
29 #ifndef SALOME_RESOURCES_CATALOG_HANDLER
30 #define SALOME_RESOURCES_CATALOG_HANDLER
31
32 #include "SALOME_ResourcesCatalog_Parser.hxx"
33
34 #include <qxml.h>
35 #include <string>
36 #include <vector>
37
38 class QDomElement;
39
40 class QDomDocument;
41
42 class SALOME_ResourcesCatalog_Handler : public QXmlDefaultHandler
43   {
44
45   public :
46     SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& listOfResources);
47
48     const MapOfParserResourcesType& GetResourcesAfterParsing() const;
49
50     virtual ~SALOME_ResourcesCatalog_Handler();
51
52     virtual bool startDocument();
53
54     virtual bool startElement(const QString& , const QString& ,
55                               const QString& name, 
56                               const QXmlAttributes& attrs);
57
58     virtual bool endElement(const QString&, const QString&,
59                             const QString& qName);
60
61     virtual bool characters(const QString& chars);
62
63     virtual bool endDocument();
64
65    virtual QString errorProtocol();
66     virtual bool fatalError(const QXmlParseException& exception);
67
68     void PrepareDocToXmlFile(QDomDocument& doc);
69
70   private :
71     QString errorProt;
72     std::string content;
73     std::string previous_module_name;
74     std::string previous_module_path;
75
76     ParserResourcesType _resource;
77     MapOfParserResourcesType& _resources_list;
78
79     const char *test_machine;
80     const char *test_resources;
81
82     const char *test_hostname;
83     const char *test_alias;
84     const char *test_protocol;
85     const char *test_mode;
86     const char *test_user_name;
87     const char *test_appli_path;
88     const char *test_modules;
89     const char *test_module_name;
90     const char *test_module_path;
91     const char *test_pre_req_file_path;
92     const char *test_os;
93     const char *test_mem_in_mb;
94     const char *test_cpu_freq_mhz;
95     const char *test_nb_of_nodes;
96     const char *test_nb_of_proc_per_node;
97
98   };
99
100 #endif // SALOME_RESOURCES_CATALOG_HANDLER