]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Attempt to embed Study servant into current process
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 13 Jan 2021 11:00:14 +0000 (12:00 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 13 Jan 2021 11:00:14 +0000 (12:00 +0100)
src/KernelHelpers/SALOME_KernelServices.cxx
src/KernelHelpers/SALOME_KernelServices.hxx
src/SALOMEDS/CMakeLists.txt
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMEDS/SALOMEDS_Study_i.hxx

index 3bb6b144bd2107d86e01ca35066e677b4bd06542..b4fa7ad6e395366f9862c1f9c941c7e78e2967c4 100644 (file)
@@ -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;
index e03068d382bb6aba7dd6e3ee31516991a5824170..2e163429d0a40c7b937efc07ab63d13c8b18ed52 100644 (file)
@@ -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: "<<e) will log the data of the exception e
-
-#endif // KERNEL_SERVICES
index 5423648ec385d9eb5b1bf9af2a543f8270b0f149..165da98c045ba1adfaa1241fac3145c3201a5033 100644 (file)
@@ -165,6 +165,9 @@ INSTALL(TARGETS SALOMEDS_Server SALOMEDS_Client
 SALOME_INSTALL_SCRIPTS(SALOME_DriverPy.py ${SALOME_INSTALL_SCRIPT_PYTHON})
 
 SET(COMMON_HEADERS_HXX
+  SALOMEDS_SComponentIterator_i.hxx
+  SALOMEDS_StudyBuilder_i.hxx
+  SALOMEDS_UseCaseBuilder_i.hxx
   SALOMEDS_Driver_i.hxx
   SALOMEDS_Study_i.hxx
   SALOMEDS_Study.hxx
index f347a69e3f00c0225fe3b91a46aeee191b3edb24..0cef86ff875d355b2bfa3c6cdaff0995fd687a59 100644 (file)
@@ -66,6 +66,22 @@ static SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA
 
 static  PortableServer::POA_ptr _poa;
 
+/**
+ * Return a unique study obj but servant is embeded here.
+ * 
+ */
+SALOMEDS::Study_ptr KERNEL::getStudyServantSA()
+{
+  static SALOMEDS::Study_var aStudy;
+  if(CORBA::is_nil(aStudy))
+  {
+    CORBA::ORB_ptr orb = KERNEL::getORB();
+    SALOMEDS_Study_i *servant = new SALOMEDS_Study_i(orb);
+    aStudy = servant->_this();
+  }
+  return SALOMEDS::Study::_duplicate(aStudy);
+}
+
 namespace SALOMEDS
 {
   class Notifier: public SALOMEDSImpl_AbstractCallback
index 821414cc8a48c659832e1fe796434da5f4903f9c..856abdf45057398c695628dea92b097e37ecf504 100644 (file)
@@ -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 <iostream>
 #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