-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SALOMEDS_Driver_i.hxx"
#include "SALOMEDS_Study_i.hxx"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
#include "Basics_Utils.hxx"
_isLocal = true;
_local_impl = theStudy;
_corba_impl = SALOMEDS::Study::_nil();
+
+ pthread_mutex_init( &SALOMEDS_StudyBuilder::_remoteBuilderMutex, 0 );
+
InitORB();
}
long pid = (long)getpid();
#endif
- long addr = theStudy->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
+ pthread_mutex_init( &SALOMEDS_StudyBuilder::_remoteBuilderMutex, 0 );
+
+ CORBA::LongLong addr = theStudy->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
_local_impl = reinterpret_cast<SALOMEDSImpl_Study*>(addr);
_corba_impl = SALOMEDS::Study::_duplicate(theStudy);
void SALOMEDS_Study::InitORB()
{
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- _orb = init(0 , 0 ) ;
+ _orb = KERNEL::GetRefToORB();
}
void SALOMEDS_Study::Init()
{
if(CORBA::is_nil(_corba_impl))
return false;
- std::wstring wtheStudyUrl = std::wstring(theStudyUrl.begin(), theStudyUrl.end());
+ std::wstring wtheStudyUrl = Kernel_Utils::decode_s( theStudyUrl );
- if (!_corba_impl->Open( (wchar_t*)wtheStudyUrl.c_str() ) )
- return false;
+ return _corba_impl->Open( (wchar_t*)wtheStudyUrl.c_str() );
+}
- return true;
+bool SALOMEDS_Study::CanOpen(const std::string& theStudyUrl)
+{
+ if(CORBA::is_nil(_corba_impl))
+ return false;
+ std::wstring wtheStudyUrl = Kernel_Utils::decode_s( theStudyUrl );
+
+ return _corba_impl->CanOpen( (wchar_t*)wtheStudyUrl.c_str() );
}
bool SALOMEDS_Study::Save(bool theMultiFile, bool theASCII)
SALOMEDS::Locker lock;
std::vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName);
- aLength = aSeq.size();
+ aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int
for (i = 0; i< aLength; i++)
aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
}
std::vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl()));
if (aSeq.size()) {
- aLength = aSeq.size();
+ aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int
for (i = 0; i < aLength; i++)
aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i])));
}