# Common packages
##
SET(SUBDIRS_COMMON
- HELLO HELLOGUI HELLO_SWIG
+ HELLO HELLOGUI
)
SET(SUBDIRS
# header files / no moc processing
SET(HELLO_HEADERS
HELLO.hxx
- HELLO_Component_Generator.hxx
)
# --- sources ---
# sources / static
SET(HELLO_SOURCES
HELLO.cxx
- HELLO_Component_Generator.cxx
)
# --- rules ---
\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();
+ }
+ }
}
+++ /dev/null
-// 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;
-}
+++ /dev/null
-// 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();
#include "HELLOGUI.h"
#include "HELLO_version.h"
-#include "HELLO_Component_Generator.hxx"
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
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 );
}
}
+++ /dev/null
-# 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)
+++ /dev/null
-# -*- 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
+++ /dev/null
-// 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());
-}
+++ /dev/null
-// 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();
+++ /dev/null
-// 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();
-}