From: vsr Date: Mon, 6 Jun 2005 07:49:07 +0000 (+0000) Subject: Implement lcc() method in SalomeApp_Application class to get instance of SALOME_LifeC... X-Git-Tag: T3_0_0_a2~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=68208c677c6ee9ad7d3943c482dcd9c6dc1caf38;p=modules%2Fgui.git Implement lcc() method in SalomeApp_Application class to get instance of SALOME_LifeCycleCORBA class. --- diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index bf2e7a342..e95d3b11f 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -816,24 +817,26 @@ void SalomeApp_Application::afterCloseDoc() CORBA::ORB_var SalomeApp_Application::orb() { ORB_INIT& init = *SINGLETON_::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() diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 10283e970..8617be9c9 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -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: