From 5f6d89ef23214f5ce1c242b6490294f2691b7776 Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 12 May 2005 09:17:48 +0000 Subject: [PATCH] Added empty constructor --- src/SALOMEDS/SALOMEDS_StudyManager.cxx | 26 ++++++++++++++++++++++++++ src/SALOMEDS/SALOMEDS_StudyManager.hxx | 1 + 2 files changed, 27 insertions(+) diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 640c76b99..d55eeb809 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -50,6 +50,32 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManag init_orb(); } +SALOMEDS_StudyManager::SALOMEDS_StudyManager() +{ + init_orb(); + + SALOME_NamingService namingService(_orb); + CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" ); + SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj ); + ASSERT( !CORBA::is_nil(theManager) ); + +#ifdef WIN32 + long pid = (long)_getpid(); +#else + long pid = (long)getpid(); +#endif + + long addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal); + if(_isLocal) { + _local_impl = ((SALOMEDSImpl_StudyManager*)(addr)); + _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager); + } + else { + _local_impl = NULL; + _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager); + } +} + SALOMEDS_StudyManager::~SALOMEDS_StudyManager() { } diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.hxx b/src/SALOMEDS/SALOMEDS_StudyManager.hxx index 84ef897ca..9321d9ad6 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.hxx @@ -27,6 +27,7 @@ private: public: SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager); + SALOMEDS_StudyManager(); ~SALOMEDS_StudyManager(); virtual _PTR(Study) NewStudy(const std::string& study_name); -- 2.39.2