]> SALOME platform Git repositories - samples/hello.git/commitdiff
Salome HOME
#29456 [EDF] (2022-T1) Finalization of SSL implementation rnv/29456
authorrnv <rnv@opencascade.com>
Thu, 14 Apr 2022 15:54:36 +0000 (18:54 +0300)
committerrnv <rnv@opencascade.com>
Thu, 14 Apr 2022 15:54:36 +0000 (18:54 +0300)
src/CMakeLists.txt
src/HELLO/CMakeLists.txt
src/HELLO/HELLO.cxx
src/HELLO/HELLO_Component_Generator.cxx [deleted file]
src/HELLO/HELLO_Component_Generator.hxx [deleted file]
src/HELLOGUI/HELLOGUI.cxx
src/HELLO_SWIG/CMakeLists.txt [deleted file]
src/HELLO_SWIG/HELLO_SalomeSessionless.py [deleted file]
src/HELLO_SWIG/HelloHelper.cxx [deleted file]
src/HELLO_SWIG/HelloHelper.h [deleted file]
src/HELLO_SWIG/HelloHelper.i [deleted file]

index 6c0235e01a937a7869a04a3710e77d5e3fc52d29..a99818bc2e196a540e7945db9f4e2947b7e3991c 100644 (file)
@@ -21,7 +21,7 @@
 # Common packages
 ##
 SET(SUBDIRS_COMMON
-  HELLO HELLOGUI HELLO_SWIG
+  HELLO HELLOGUI
 )
 
 SET(SUBDIRS
index f8a6863ebd0a95287f8eb540a2b3f4b46e79f54a..e265b0888e2f1e5d1669a1d2056c84463ef5d364 100644 (file)
@@ -47,7 +47,6 @@ SET(_link_LIBRARIES
 # header files / no moc processing
 SET(HELLO_HEADERS
   HELLO.hxx
-  HELLO_Component_Generator.hxx
 )
 
 # --- sources ---
@@ -55,7 +54,6 @@ SET(HELLO_HEADERS
 # sources / static
 SET(HELLO_SOURCES
   HELLO.cxx
-  HELLO_Component_Generator.cxx
 )
 
 # --- rules ---
index 5c7e2c602ff000009b5159fa655e2b56e5fdde1a..e16ae67c96a33b16fe172365720f560139ad72c0 100644 (file)
@@ -287,13 +287,23 @@ extern "C"
     \param interfaceName SALOME component interface name
     \return CORBA object identifier of the registered servant
   */
-  PortableServer::ObjectId* HELLOEngine_factory( CORBA::ORB_ptr orb,
-                                                PortableServer::POA_ptr poa, 
-                                                PortableServer::ObjectId* contId,
-                                                const char* instanceName, 
-                                                const char* interfaceName )
-  {
-    HELLO_Session* component = new HELLO_Session( orb, poa, contId, instanceName, interfaceName );
-    return component->getId();
-  }
+       PortableServer::ObjectId* HELLOEngine_factory(CORBA::ORB_ptr orb,
+               PortableServer::POA_ptr poa,
+               PortableServer::ObjectId* contId,
+               const char* instanceName,
+               const char* interfaceName)
+       {
+               CORBA::Object_var o = poa->id_to_reference(*contId);
+               Engines::Container_var cont = Engines::Container::_narrow(o);
+               if (cont->is_SSL_mode())
+               {
+                       HELLO_No_Session* component = new HELLO_No_Session(orb, poa, contId, instanceName, interfaceName);
+                       return component->getId();
+               }
+               else
+               {
+                       HELLO_Session* component = new HELLO_Session(orb, poa, contId, instanceName, interfaceName);
+                       return component->getId();
+               }
+       }
 }
diff --git a/src/HELLO/HELLO_Component_Generator.cxx b/src/HELLO/HELLO_Component_Generator.cxx
deleted file mode 100644 (file)
index 3ab5256..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HELLO_Component_Generator.hxx"
-
-#include "HELLO.hxx"
-#include "SALOME_Container_i.hxx"
-#include "SALOME_KernelServices.hxx"
-
-#include <cstring>
-
-static Engines::EngineComponent_var _unique_compo;
-
-Engines::EngineComponent_var RetrieveHELLOInstance()
-{
-  constexpr char COMPO_NAME[]="HELLO";
-  if (CORBA::is_nil(_unique_compo))
-  {
-    CORBA::ORB_var orb;
-    {
-      int argc(0);
-      orb = CORBA::ORB_init(argc, nullptr);
-    }
-    CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
-    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-    PortableServer::POAManager_var pman = poa->the_POAManager();
-    CORBA::PolicyList policies;
-    policies.length(0);
-    auto *cont(KERNEL::getContainerSA());
-    PortableServer::ObjectId *conId(cont->getCORBAId());
-    //
-    pman->activate();
-    //
-    HELLO_No_Session *servant = new HELLO_No_Session(orb, poa, conId, "HELLO_inst_2", COMPO_NAME);
-    PortableServer::ObjectId *zeId = servant->getId();
-    CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
-    KERNEL::RegisterCompo(COMPO_NAME,zeRef);
-    _unique_compo = Engines::EngineComponent::_narrow(zeRef);
-  }
-  return _unique_compo;
-}
diff --git a/src/HELLO/HELLO_Component_Generator.hxx b/src/HELLO/HELLO_Component_Generator.hxx
deleted file mode 100644 (file)
index 3c6145f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#pragma once
-
-#include "HELLO.hxx"
-
-#include "SALOMEconfig.h"
-
-#include CORBA_SERVER_HEADER(HELLO_Gen)
-
-HELLOENGINE_EXPORT Engines::EngineComponent_var RetrieveHELLOInstance();
index d9c8dc4362fe91c34fd94268605b6db961d97bb8..f4b4d30b8d6cd74a81cb150b9b3e5dfd6a3fe4b8 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "HELLOGUI.h"
 #include "HELLO_version.h"
-#include "HELLO_Component_Generator.hxx"
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
@@ -887,17 +886,7 @@ void HELLOGUI::init()
   if ( CORBA::is_nil( myEngine ) )
   {
     SALOME_NamingService_Abstract *ns = SalomeApp_Application::namingService();
-    Engines::EngineComponent_var comp;
-    if(ns->IsTrueNS())
-    {
-      comp = SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "HELLO" );
-    }
-    else
-    {
-      comp = RetrieveHELLOInstance();
-      CORBA::Object_var comp2 = CORBA::Object::_narrow(comp);
-      KERNEL::RegisterCompo("HELLO",comp2);
-    }
+    Engines::EngineComponent_var comp = SalomeApp_Application::lcc()->FindOrLoad_Component("FactoryServer", "HELLO");
     myEngine = HELLO_ORB::HELLO_Gen::_narrow( comp );
   }
 }
diff --git a/src/HELLO_SWIG/CMakeLists.txt b/src/HELLO_SWIG/CMakeLists.txt
deleted file mode 100644 (file)
index bfab586..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2012-2021  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-INCLUDE(${SWIG_USE_FILE})
-
-INCLUDE_DIRECTORIES(
-  ${KERNEL_INCLUDE_DIRS}
-  ${PROJECT_BINARY_DIR}/idl
-  ${PROJECT_SOURCE_DIR}/src/HELLO
-)
-
-SET(_bin_SCRIPTS
-  HELLO_SalomeSessionless.py
-)
-
-# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}  )
-
-# SWIG wrapping
-SET(HelloHelper_HEADERS HelloHelper.h HelloHelper.i)
-SET(HelloHelper_SOURCES HelloHelper.cxx ${HelloHelper_HEADERS})
-SET_SOURCE_FILES_PROPERTIES(HelloHelper.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(HelloHelper.i PROPERTIES SWIG_FLAGS "-py3")
-SET_SOURCE_FILES_PROPERTIES(HelloHelper_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
-SET(_swig_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/HelloHelper.py )
-IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
-  SWIG_ADD_MODULE(HelloHelper python ${HelloHelper_SOURCES})
-ELSE()
-  SWIG_ADD_LIBRARY(HelloHelper LANGUAGE python SOURCES ${HelloHelper_SOURCES})
-ENDIF()
-SWIG_LINK_LIBRARIES(HelloHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} HELLOEngine ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeDS} )
-SWIG_CHECK_GENERATION(HelloHelper)
-IF(WIN32)
-  SET_TARGET_PROPERTIES(_HelloHelper PROPERTIES DEBUG_OUTPUT_NAME _HelloHelper_d)
-ENDIF(WIN32)
-INSTALL(TARGETS _HelloHelper DESTINATION ${SALOME_INSTALL_LIBS})
-INSTALL(FILES ${HelloHelper_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_HelloHelper_REAL_NAME}")
-SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_PYTHON} DEF_PERMS)
diff --git a/src/HELLO_SWIG/HELLO_SalomeSessionless.py b/src/HELLO_SWIG/HELLO_SalomeSessionless.py
deleted file mode 100644 (file)
index 0d36984..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-def buildInstance(orb):
-    import HelloHelper
-    hello_ior = HelloHelper.BuildHELLOInstance()
-    import HELLO_ORB
-    import CORBA
-    orb=CORBA.ORB_init([''])
-    hello = orb.string_to_object(hello_ior)
-    return hello, orb
diff --git a/src/HELLO_SWIG/HelloHelper.cxx b/src/HELLO_SWIG/HelloHelper.cxx
deleted file mode 100644 (file)
index dcf031e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HelloHelper.h"
-
-#include "SALOME_KernelServices.hxx"
-
-#include "HELLO_Component_Generator.hxx"
-
-std::string BuildHELLOInstance()
-{
-  Engines::EngineComponent_var zeRef = RetrieveHELLOInstance();
-  CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
-  return std::string(ior.in());
-}
diff --git a/src/HELLO_SWIG/HelloHelper.h b/src/HELLO_SWIG/HelloHelper.h
deleted file mode 100644 (file)
index 5e2c9f4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <string>
-
-std::string BuildHELLOInstance();
diff --git a/src/HELLO_SWIG/HelloHelper.i b/src/HELLO_SWIG/HelloHelper.i
deleted file mode 100644 (file)
index a6d8bf2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-%module HelloHelper
-
-%include "std_string.i"
-
-%inline
-{
-  std::string BuildHELLOInstance();
-}