Back to index

salome-kernel  6.5.0
SALOME_ModuleCatalog_impl.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 ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
00024 //  File   : SALOME_ModuleCatalog_impl.hxx
00025 //  Author : Estelle Deville
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/ModuleCatalog/SALOME_ModuleCatalog_impl.hxx,v 1.8.2.1.10.2.12.1 2012-04-12 14:05:17 vsr Exp $
00028 //
00029 #ifndef MODULECATALOG_IMPL_H
00030 #define MODULECATALOG_IMPL_H
00031 
00032 #include "SALOME_ModuleCatalog.hxx"
00033 
00034 #include <string>
00035 #include <map>
00036 
00037 #include "SALOME_ModuleCatalog_Handler.hxx"
00038 
00039 #include <SALOMEconfig.h>
00040 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
00041 
00042 #ifdef WNT
00043 #pragma warning(disable:4275) // Disable warning interface non dll
00044 #pragma warning(disable:4290) // Warning Exception ...
00045 #endif
00046 
00047 class MODULECATALOG_EXPORT SALOME_ModuleCatalogImpl: public POA_SALOME_ModuleCatalog::ModuleCatalog
00048 {
00049 public:
00051   SALOME_ModuleCatalogImpl(int artgc, char** argv, CORBA::ORB_ptr orb = NULL);
00052 
00054   virtual ~SALOME_ModuleCatalogImpl();
00055 
00057 
00060   virtual SALOME_ModuleCatalog::ListOfComputers* GetComputerList();
00061 
00063 
00066   virtual SALOME_ModuleCatalog::ListOfTypeDefinition* GetTypes();
00067 
00069 
00073   virtual char* GetPathPrefix(const char* machinename);
00074 
00076 
00079   virtual void ImportXmlCatalogFile(const char* xmlFileName);
00080 
00082 
00085   virtual SALOME_ModuleCatalog::ListOfComponents* GetComponentList();
00086 
00088 
00091   virtual SALOME_ModuleCatalog::ListOfIAPP_Affich* GetComponentIconeList();
00092 
00094 
00097   virtual SALOME_ModuleCatalog::ListOfComponents* 
00098     GetTypedComponentList(SALOME_ModuleCatalog::ComponentType component_type);
00099 
00101 
00105   virtual SALOME_ModuleCatalog::Acomponent_ptr 
00106     GetComponent(const char* componentname);
00107   
00109 
00113   virtual SALOME_ModuleCatalog::ComponentDef *
00114     GetComponentInfo(const char *name);
00115 
00116   void ping(){};
00117   CORBA::Long getPID();
00118   void ShutdownWithExit();
00119 
00120   void shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); };
00121 
00122 private:
00124 
00130   virtual void _parse_xml_file(const char* file, 
00131                           ParserComponents & modulelist, 
00132                           ParserPathPrefixes & pathlist,
00133         ParserTypes& typeMap,
00134         TypeList& typeList);
00135 
00137 
00141   ParserComponent *findComponent(const std::string & name);
00142 
00144 
00148   void duplicate(SALOME_ModuleCatalog::ComponentDef & C_corba,
00149                  const ParserComponent & C_parser);
00150     
00152 
00156   void duplicate(SALOME_ModuleCatalog::DefinitionInterface & I_corba,
00157                  const ParserInterface & I_parser);
00158   
00160 
00164   void duplicate(SALOME_ModuleCatalog::Service & S_corba,
00165                  const ParserService & service);
00166   
00168 
00172   void duplicate(SALOME_ModuleCatalog::ServicesParameter & P_corba,
00173                  const ParserParameter & P_parser);
00174   
00176 
00180   void duplicate(SALOME_ModuleCatalog::ServicesDataStreamParameter & P_corba,
00181                  const ParserDataStreamParameter & P_parser);
00182   
00184 
00188   void duplicate(ParserPathPrefixes & p_out, const ParserPathPrefixes & P_in);
00189 
00191 
00195   virtual bool _verify_path_prefix(ParserPathPrefixes & pathlist);
00196 
00197 
00199 
00205   virtual bool _parseArguments(int argc, char **argv, 
00206                                char **_general, char** _personal);
00207 
00208 
00209   // Theses variables will contain the path to the general and personal catalogs
00210   char* _general_path;
00211   char* _personal_path;
00212 
00213 
00214   // These variables will contain the informations on the general common catalog
00215   ParserComponents    _general_module_list ;
00216   ParserPathPrefixes  _general_path_list ;
00217   ParserTypes _typeMap;
00218   TypeList _typeList;
00219 
00220   // These variables will contain the informations on the personal catalog
00221   ParserComponents    _personal_module_list ;
00222   ParserPathPrefixes  _personal_path_list ; 
00223 
00224   std::map <std::string, SALOME_ModuleCatalog::DataStreamDependency> 
00225   DataStreamDepConvert;
00226 
00227   std::map <ParserComponentType, SALOME_ModuleCatalog::ComponentType> 
00228   ComponentTypeConvert;
00229 
00230   CORBA::ORB_ptr _orb;
00231 };
00232 
00233 #endif // MODULECATALOG_IMPL_H