1 // SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_ResourcesCatalog_Handler.hxx
25 // Author : Estelle Deville
29 #ifndef SALOME_RESOURCES_CATALOG_HANDLER
30 #define SALOME_RESOURCES_CATALOG_HANDLER
32 #include "SALOME_ResourcesCatalog_Parser.hxx"
41 class SALOME_ResourcesCatalog_Handler : public QXmlDefaultHandler
44 //! standard constructor
45 SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& listOfResources);
47 const MapOfParserResourcesType& GetResourcesAfterParsing() const;
49 //! standard destructor
50 virtual ~SALOME_ResourcesCatalog_Handler();
52 //! method to overload handler function startDocument
53 /*! is called before a xml file is parsed
54 \return true if no error was detected
56 virtual bool startDocument();
58 //! method to overload handler function startElement
60 \param QString argument by value
61 \param QString argument by value
62 \param QString qName argument by value
63 \param QXmlAttributes atts argument by value
64 \return true if no error was detected
66 virtual bool startElement(const QString& , const QString& ,
67 const QString& name, const QXmlAttributes& attrs);
69 //! method to overload handler function endElement
71 \param QString argument by value
72 \param QString argument by value
73 \param QString qName argument by value
74 \return true if no error was detected
76 virtual bool endElement(const QString&, const QString&,
77 const QString& qName);
79 //! method to overload handler function characters
81 \param QString chars argument by value
82 \return true if no error was detected
84 virtual bool characters(const QString& chars);
86 //! method to overload handler function endDocument
87 /*! is called at the end of the parsing
88 \return true if no error was detected
90 virtual bool endDocument();
92 //! method to overload handler function errorProtocol
94 \return the error message
96 virtual QString errorProtocol();
98 //! method to overload handler function fatalError
100 \param QXmlParseException exception argument by value
101 \return true if no error was detected
103 virtual bool fatalError(const QXmlParseException& exception);
105 //! method to fill the document to be writen in a file
106 void PrepareDocToXmlFile(QDomDocument& doc);
111 std::string previous_module_name;
112 std::string previous_module_path;
114 ParserResourcesType _resource;
115 MapOfParserResourcesType& _resources_list;
117 const char *test_machine;
118 const char *test_resources;
120 const char *test_hostname;
121 const char *test_alias;
122 const char *test_protocol;
123 const char *test_mode;
124 const char *test_user_name;
125 const char *test_modules;
126 const char *test_module_name;
127 const char *test_module_path;
128 const char *test_pre_req_file_path;
130 const char *test_mem_in_mb;
131 const char *test_cpu_freq_mhz;
132 const char *test_nb_of_nodes;
133 const char *test_nb_of_proc_per_node;
137 #endif // SALOME_RESOURCES_CATALOG_HANDLER