From 946182a59b2a6950022034623a0eadfa1555ad1d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Sat, 16 Jan 2021 05:59:24 +0100 Subject: [PATCH] First SMESH/GEOM case OK without external Server connection --- src/ModuleCatalog/CMakeLists.txt | 3 +++ src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx | 12 ++++++++++++ src/ModuleCatalog/SALOME_ModuleCatalog_impl.hxx | 11 +++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/ModuleCatalog/CMakeLists.txt b/src/ModuleCatalog/CMakeLists.txt index 3c8a47a22..fd7583952 100644 --- a/src/ModuleCatalog/CMakeLists.txt +++ b/src/ModuleCatalog/CMakeLists.txt @@ -26,6 +26,8 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService ${CMAKE_CURRENT_SOURCE_DIR}/../Utils + ${CMAKE_CURRENT_SOURCE_DIR}/../KernelHelpers + ${CMAKE_CURRENT_SOURCE_DIR}/../LifeCycleCORBA ${PROJECT_BINARY_DIR}/idl ) @@ -36,6 +38,7 @@ SET(COMMON_LIBS SALOMELocalTrace SALOMEBasics SalomeIDLKernel + SalomeKernelHelpers ${LIBXML2_LIBRARIES} ${PTHREAD_LIBRARIES} ) diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 326dddc14..b5de2b0d9 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -60,6 +60,18 @@ static int MYDEBUG = 0; static const char* SEPARATOR = "::"; static const char* OLD_SEPARATOR = ":"; +SALOME_ModuleCatalog::ModuleCatalog_ptr KERNEL::getModuleComponentServantSA() +{ + static SALOME_ModuleCatalog::ModuleCatalog_var moduleCata; + if(CORBA::is_nil(moduleCata)) + { + CORBA::ORB_ptr orb = KERNEL::getORB(); + char *argv[4] = {"SALOME_ModuleCatalog_Server","-common","\"/home/H87074/salomeDEV/DEV2/share/salome/resources/geom/GEOMCatalog.xml\"::\"/home/H87074/salomeDEV/DEV2/share/salome/resources/smesh/SMESHCatalog.xml\"",nullptr}; + SALOME_ModuleCatalogImpl *servant = new SALOME_ModuleCatalogImpl(3,argv,orb); + moduleCata = servant->_this(); + } + return SALOME_ModuleCatalog::ModuleCatalog::_duplicate(moduleCata); +} std::list splitStringToList(const std::string& theString, const std::string& theSeparator) { diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.hxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.hxx index 3936d7787..c593914ca 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.hxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.hxx @@ -26,10 +26,10 @@ // Module : SALOME // $Header$ // -#ifndef MODULECATALOG_IMPL_H -#define MODULECATALOG_IMPL_H +#pragma once #include "SALOME_ModuleCatalog.hxx" +#include "SALOME_KernelServices.hxx" #include #include @@ -42,6 +42,11 @@ #pragma warning(disable:4290) // Warning Exception ... #endif +namespace KERNEL +{ + MODULECATALOG_EXPORT SALOME_ModuleCatalog::ModuleCatalog_ptr getModuleComponentServantSA(); +} + class MODULECATALOG_EXPORT SALOME_ModuleCatalogImpl: public POA_SALOME_ModuleCatalog::ModuleCatalog { class Private; @@ -140,5 +145,3 @@ private: CORBA::ORB_ptr _orb; Private* myPrivate; }; - -#endif // MODULECATALOG_IMPL_H -- 2.39.2