Back to index

salome-kernel  6.5.0
SALOME_ResourcesCatalog_Handler.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
00024 //  File   : SALOME_ResourcesCatalog_Handler.hxx
00025 //  Author : Estelle Deville
00026 //  Module : SALOME
00027 //$Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.hxx,v 1.6.2.3.10.3.2.1 2012-04-12 14:05:20 vsr Exp $
00028 //
00029 #ifndef SALOME_RESOURCES_CATALOG_HANDLER
00030 #define SALOME_RESOURCES_CATALOG_HANDLER
00031 
00032 
00033 #include "ResourcesManager_Defs.hxx"
00034 
00035 #include "SALOME_ResourcesCatalog_Parser.hxx"
00036 
00037 #include <string>
00038 #include <vector>
00039 
00040 #include <libxml/parser.h>
00041 
00042 class RESOURCESMANAGER_EXPORT SALOME_ResourcesCatalog_Handler
00043 {
00044   
00045   public :
00046     SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& resources_list);
00047 
00048     const MapOfParserResourcesType& GetResourcesAfterParsing() const;
00049 
00050     virtual ~SALOME_ResourcesCatalog_Handler();
00051 
00052     void ProcessXmlDocument(xmlDocPtr theDoc);
00053 
00054     bool ProcessMachine(xmlNodePtr machine_descr, ParserResourcesType & resource);
00055     bool ProcessCluster(xmlNodePtr cluster_descr, ParserResourcesType & resource);
00056     bool ProcessMember(xmlNodePtr member_descr, ParserResourcesClusterMembersType & resource);
00057   
00058     void PrepareDocToXmlFile(xmlDocPtr theDoc);
00059 
00060   private :
00061     std::string previous_component_name;
00062 
00063     ParserResourcesType _resource;
00064     MapOfParserResourcesType& _resources_list;
00065 
00066     const char *test_machine;
00067     const char *test_cluster;
00068     const char *test_name;
00069     const char *test_hostname;
00070     const char *test_protocol;
00071     const char *test_cluster_internal_protocol;
00072     const char *test_mode;
00073     const char *test_batch;
00074     const char *test_mpi;
00075     const char *test_user_name;
00076     const char *test_appli_path;
00077     // for compatibility
00078     const char *test_modules;
00079     const char *test_module_name;
00080     const char *test_components;
00081     const char *test_component_name;
00082     const char *test_os;
00083     const char *test_mem_in_mb;
00084     const char *test_cpu_freq_mhz;
00085     const char *test_nb_of_nodes;
00086     const char *test_nb_of_proc;
00087     const char *test_nb_of_proc_per_node;
00088     const char *test_batch_queue;
00089     const char *test_user_commands;
00090     const char *test_use;
00091     const char *test_members;
00092     const char *test_is_cluster_head;
00093     const char *test_working_directory;
00094 
00095   };
00096 
00097 #endif // SALOME_RESOURCES_CATALOG_HANDLER