From 41e66aae8d76e8444f3b3dda584074d38e53c824 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 13 Jan 2021 12:00:14 +0100 Subject: [PATCH] Attempt to embed Study servant into current process --- src/KernelHelpers/SALOME_KernelServices.cxx | 1 + src/KernelHelpers/SALOME_KernelServices.hxx | 5 +---- src/SALOMEDS/CMakeLists.txt | 3 +++ src/SALOMEDS/SALOMEDS_Study_i.cxx | 16 ++++++++++++++++ src/SALOMEDS/SALOMEDS_Study_i.hxx | 9 ++++++--- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/KernelHelpers/SALOME_KernelServices.cxx b/src/KernelHelpers/SALOME_KernelServices.cxx index 3bb6b144b..b4fa7ad6e 100644 --- a/src/KernelHelpers/SALOME_KernelServices.cxx +++ b/src/KernelHelpers/SALOME_KernelServices.cxx @@ -64,6 +64,7 @@ namespace KERNEL { /** * This returns a static reference to the SALOME study. The * study can be used to get informations about it. + * \sa getStudyServantSA */ SALOMEDS::Study_ptr getStudyServant() { static SALOMEDS::Study_ptr aStudy; diff --git a/src/KernelHelpers/SALOME_KernelServices.hxx b/src/KernelHelpers/SALOME_KernelServices.hxx index e03068d38..2e163429d 100644 --- a/src/KernelHelpers/SALOME_KernelServices.hxx +++ b/src/KernelHelpers/SALOME_KernelServices.hxx @@ -19,8 +19,7 @@ // Author: Guillaume Boulant (EDF/R&D) -#ifndef __KERNEL_SERVICES_H__ -#define __KERNEL_SERVICES_H__ +#pragma once #include "KernelHelpers.hxx" @@ -101,5 +100,3 @@ namespace KERNEL { #include "Utils_CorbaException.hxx" // Tip: CORBA exceptions can be used with LOG (or more generally in streams) // Ex: LOG("An exception occurs: "<_this(); + } + return SALOMEDS::Study::_duplicate(aStudy); +} + namespace SALOMEDS { class Notifier: public SALOMEDSImpl_AbstractCallback diff --git a/src/SALOMEDS/SALOMEDS_Study_i.hxx b/src/SALOMEDS/SALOMEDS_Study_i.hxx index 821414cc8..856abdf45 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.hxx @@ -24,8 +24,7 @@ // Author : Sergey RUIN // Module : SALOME // -#ifndef __SALOMEDS_STUDY_I_H__ -#define __SALOMEDS_STUDY_I_H__ +#pragma once // std C++ headers #include @@ -47,6 +46,11 @@ #include "SALOMEDSImpl_Study.hxx" #include "SALOMEDSImpl_AttributeIOR.hxx" +namespace KERNEL +{ + Standard_EXPORT SALOMEDS::Study_ptr getStudyServantSA(); +} + class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study { private: @@ -358,4 +362,3 @@ public: virtual void attach(SALOMEDS::Observer_ptr theObs, CORBA::Boolean modify); virtual void detach(SALOMEDS::Observer_ptr theObs); }; -#endif -- 2.39.2