From 8e3bf470347a12ee5abadf1b69d3be3ffb9d33b0 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 18 Feb 2021 16:29:07 +0100 Subject: [PATCH] WIP --- src/Session/SALOME_Session_Server.cxx | 8 +++++--- src/Session/Session_ServerLauncher.cxx | 6 ++++++ src/Session/Session_ServerThread.cxx | 10 +++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index b73e8f180..464f68e1f 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -38,6 +38,7 @@ #include "Session_ServerCheck.hxx" #include "Session_ServerLauncher.hxx" #include "Session_Promises.hxx" +#include "SALOME_Fake_NamingService.hxx" #include "GUI_version.h" #include "Qtx.h" @@ -458,6 +459,7 @@ SALOME::Session_var GUIAppNewStyle::getSession() // ---------------------------- MAIN ----------------------- int AbstractGUIApp::main(int argc, char **argv) { + using NamingServiceImplementation = SALOME_Fake_NamingService; // Set-up application settings configuration (as for QSettings) // Note: these are default settings which can be customized (see below) QApplication::setOrganizationName("salome"); @@ -549,7 +551,7 @@ int AbstractGUIApp::main(int argc, char **argv) SUIT_Session *aGUISession = 0; GetInterfaceThread *guiThread = 0; - Session_ServerLauncher *myServerLauncher = nullptr; + Session_ServerLauncher *myServerLauncher = nullptr; #if defined(WIN32) && defined(UNICODE) char **new_argv = NULL; @@ -627,9 +629,9 @@ int AbstractGUIApp::main(int argc, char **argv) } // Free memory allocated for CommandLineToArgvW arguments. LocalFree(szArglist); - myServerLauncher = new Session_ServerLauncher(nArgs, new_argv, orb, poa, &_GUIMutex, &_ServerLaunch, &_SessionMutex, &_SessionStarted); + myServerLauncher = new Session_ServerLauncher(nArgs, new_argv, orb, poa, &_GUIMutex, &_ServerLaunch, &_SessionMutex, &_SessionStarted); #else - myServerLauncher = new Session_ServerLauncher(argc, argv, orb, poa, &_GUIMutex, &_ServerLaunch, &_SessionMutex, &_SessionStarted); + myServerLauncher = new Session_ServerLauncher(argc, argv, orb, poa, &_GUIMutex, &_ServerLaunch, &_SessionMutex, &_SessionStarted); #endif // ...block this thread until launcher is ready _ServerLaunch.wait(&_GUIMutex); diff --git a/src/Session/Session_ServerLauncher.cxx b/src/Session/Session_ServerLauncher.cxx index f85a1b2c0..730e7f089 100644 --- a/src/Session/Session_ServerLauncher.cxx +++ b/src/Session/Session_ServerLauncher.cxx @@ -261,3 +261,9 @@ void Session_ServerLauncher::KillAll() delete (*itServ); } } + +template class Session_ServerLauncher; + +#include "SALOME_Fake_NamingService.hxx" + +template class Session_ServerLauncher; diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 8cc0a339f..5cc708528 100644 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -88,7 +88,7 @@ Session_ServerThread::Session_ServerThread(int argc, _orb = CORBA::ORB::_duplicate(orb); _root_poa = PortableServer::POA::_duplicate(poa); _servType =-1; - _NS.reset( new SALOME_NamingService(_orb) ); // one instance per server to limit + _NS.reset( new MY_NS(_orb) ); // one instance per server to limit // multi thread coherence problems _container = nullptr; // embedded container } @@ -452,3 +452,11 @@ void Session_SessionThread::ActivateSession(int argc, char ** argv) INFOS("Caught unknown exception."); } } + +template class Session_ServerThread; +template class Session_SessionThread; + +#include "SALOME_Fake_NamingService.hxx" + +template class Session_ServerThread; +template class Session_SessionThread; -- 2.39.2