From 451aaf210a7234ee4a01f2aa64b4f536772c708f Mon Sep 17 00:00:00 2001 From: srn Date: Fri, 8 Apr 2005 08:58:08 +0000 Subject: [PATCH] Added method GetStudy, which return a CORBA SALOMEDS::Study --- src/SALOMEDS/SALOMEDS_Study.cxx | 15 +++++++++++++++ src/SALOMEDS/SALOMEDS_Study.hxx | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 58bbd189a..ac5b4c063 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -23,6 +23,7 @@ using namespace std; #include "SALOMEDSImpl_UseCaseBuilder.hxx" #include "SALOMEDS_Driver_i.hxx" +#include "SALOMEDS_Study_i.hxx" #include #include @@ -532,3 +533,17 @@ void SALOMEDS_Study::init_orb() ASSERT(SINGLETON_::IsAlreadyExisting()) ; _orb = init(0 , 0 ) ; } + +SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy() +{ + if(_isLocal) { + SALOMEDS_Study_i *Study_servant = new SALOMEDS_Study_i(_local_impl, _orb); + SALOMEDS::Study_var Study = Study_servant->_this(); + return Study; + } + else { + return _corba_impl; + } + + return SALOMEDS::Study::_nil(); +} diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index 68f390ad7..686c3f8dc 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -80,6 +80,8 @@ public: std::string ConvertObjectToIOR(CORBA::Object_ptr theObject); CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR); + SALOMEDS::Study_ptr GetStudy(); + private: void init_orb(); -- 2.39.2