]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Implement lcc() method in SalomeApp_Application class to get instance of SALOME_LifeC...
authorvsr <vsr@opencascade.com>
Mon, 6 Jun 2005 07:49:07 +0000 (07:49 +0000)
committervsr <vsr@opencascade.com>
Mon, 6 Jun 2005 07:49:07 +0000 (07:49 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index bf2e7a3423bed3fe131b7ff800e69f17c21ece72..e95d3b11fb0af6a6675e51ac1cde9146035e4cc1 100644 (file)
@@ -54,6 +54,7 @@
 #include <Utils_ORB_INIT.hxx>
 #include <Utils_SINGLETON.hxx>
 #include <SALOME_ModuleCatalog_impl.hxx>
+#include <SALOME_LifeCycleCORBA.hxx>
 
 #include <qmap.h>
 #include <qdir.h>
@@ -816,24 +817,26 @@ void SalomeApp_Application::afterCloseDoc()
 CORBA::ORB_var SalomeApp_Application::orb()
 {
   ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
-  CORBA::ORB_var& orb = init( qApp->argc(), qApp->argv() );
-
-  return orb;
+  static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+  return _orb;
 }
 
 SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr()
 {
-  static SALOMEDSClient_StudyManager* aStudyManager = NULL;
-  
-  if(!aStudyManager) {
-    aStudyManager = new SALOMEDS_StudyManager();
-  }
-  return aStudyManager;
+  static SALOMEDSClient_StudyManager* _sm = new SALOMEDS_StudyManager();
+  return _sm;
 }
 
 SALOME_NamingService* SalomeApp_Application::namingService()
 {
-  return new SALOME_NamingService( orb() );
+  static SALOME_NamingService* _ns = new SALOME_NamingService( orb() );
+  return _ns;
+}
+
+SALOME_LifeCycleCORBA* SalomeApp_Application::lcc()
+{
+  static SALOME_LifeCycleCORBA* _lcc = new SALOME_LifeCycleCORBA( namingService() );
+  return _lcc;
 }
 
 QString SalomeApp_Application::defaultEngineIOR()
index 10283e970fb1cbf1db8f25f2cd4f5a8963d936f2..8617be9c9d916e4eb8a41df33ddb2b9072756582 100644 (file)
@@ -30,6 +30,7 @@ class OB_Browser;
 class SalomeApp_Module;
 class SalomeApp_SelectionMgr;
 class SalomeApp_WidgetContainer;
+class SALOME_LifeCycleCORBA;
 
 #ifdef WIN32
 #pragma warning( disable:4251 )
@@ -84,6 +85,7 @@ public:
   static CORBA::ORB_var               orb();
   static SALOMEDSClient_StudyManager* studyMgr();
   static SALOME_NamingService*        namingService();
+  static SALOME_LifeCycleCORBA*       lcc();
   static QString                      defaultEngineIOR();
 
 signals: