SALOMEDS_GenericAttribute::~SALOMEDS_GenericAttribute()
{
- //if(!_isLocal) CORBA::release(_corba_impl);
}
void SALOMEDS_GenericAttribute::CheckLocked()
else {
CORBA::String_var anIOR;
ret = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentIOR(anIOR.out());
- theID = std::string(anIOR.in());
-
+ theID = std::string(anIOR.in());
}
return ret;
{
if(_isLocal) {
if(!CORBA::is_nil(_corba_impl)) return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
- return SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()), _orb);
+ SALOMEDS::SComponent_var aSCO = SALOMEDS_SComponent_i::New(Handle(SALOMEDSImpl_SComponent)::DownCast(GetLocalImpl()),
+ _orb);
+ return aSCO._retn();
}
else {
return SALOMEDS::SComponent::_narrow(GetCORBAImpl());
SALOMEDS_SObject::~SALOMEDS_SObject()
{
- //if(!_isLocal) CORBA::release(_corba_impl);
}
std::string SALOMEDS_SObject::GetID()
CORBA::Object_ptr SALOMEDS_SObject::GetObject()
{
+ CORBA::Object_var obj;
if(_isLocal) {
std::string anIOR = GetIOR();
- return _orb->string_to_object(anIOR.c_str());
+ obj = _orb->string_to_object(anIOR.c_str());
+ return obj._retn();
+ }
+ else {
+ obj = _corba_impl->GetObject();
+ return obj._retn();
}
- else return _corba_impl->GetObject();
return CORBA::Object::_nil();
}
{
if(_isLocal) {
if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
- return SALOMEDS_SObject_i::New(_local_impl, _orb);
+ SALOMEDS::SObject_var aSO = SALOMEDS_SObject_i::New(_local_impl, _orb);
+ return aSO._retn();
}
else {
return _corba_impl;
SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy()
{
- if(_isLocal) {
- if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
- 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;
- }
+ if(_isLocal) {
+ if(!CORBA::is_nil(_corba_impl)) return _corba_impl;
+ std::string anIOR = _local_impl->GetTransientReference().ToCString();
+ SALOMEDS::Study_var aStudy;
+ if(!_local_impl->IsError() && anIOR != "") {
+ aStudy = SALOMEDS::Study::_narrow(_orb->string_to_object(anIOR.c_str()));
+ }
+ else {
+ SALOMEDS_Study_i *aStudy_servant = new SALOMEDS_Study_i(_local_impl, _orb);
+ aStudy = aStudy_servant->_this();
+ _local_impl->SetTransientReference(_orb->object_to_string(aStudy));
+ }
+ return aStudy._retn();
+ }
+ else {
+ return _corba_impl;
+ }
- return SALOMEDS::Study::_nil();
+ return SALOMEDS::Study::_nil();
}
_isLocal = true;
_local_impl = theBuilder;
_corba_impl = SALOMEDS::StudyBuilder::_nil();
+
init_orb();
}
_isLocal = false;
_local_impl = NULL;
_corba_impl = SALOMEDS::StudyBuilder::_duplicate(theBuilder);
+
init_orb();
}
SALOMEDS_StudyBuilder::~SALOMEDS_StudyBuilder()
{
- //if(!_isLocal) CORBA::release(_corba_impl);
}
SALOMEDSClient_SComponent* SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType)
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
if(_isLocal) {
- SALOMEDS_Driver_i* drv = new SALOMEDS_Driver_i(aDriver, _orb);
- bool isDone = _local_impl->LoadWith(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()), drv);
+ SALOMEDS_Driver_i* drv = new SALOMEDS_Driver_i(aDriver, _orb);
+ Handle(SALOMEDSImpl_SComponent) aSCO_impl = Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl());
+ bool isDone = _local_impl->LoadWith(aSCO_impl, drv);
delete drv;
if(!isDone && _local_impl->IsError())
THROW_SALOME_CORBA_EXCEPTION(_local_impl->GetErrorCode().ToCString(),SALOME::BAD_PARAM);
SALOMEDS_StudyManager::~SALOMEDS_StudyManager()
{
- //if(!_isLocal) CORBA::release(_corba_impl);
}
SALOMEDSClient_Study* SALOMEDS_StudyManager::NewStudy(const std::string& study_name)