+void SALOMEDS_Study::SetStudyLock(const std::string& theLockerID)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetStudyLock(theLockerID.c_str());
+ }
+ else _corba_impl->SetStudyLock((char*)theLockerID.c_str());
+}
+
+bool SALOMEDS_Study::IsStudyLocked()
+{
+ bool isLocked;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ isLocked = _local_impl->IsStudyLocked();
+ }
+ else isLocked = _corba_impl->IsStudyLocked();
+ return isLocked;
+}
+
+void SALOMEDS_Study::UnLockStudy(const std::string& theLockerID)
+{
+ if(_isLocal) _local_impl->UnLockStudy(theLockerID.c_str());
+ else _corba_impl->UnLockStudy((char*)theLockerID.c_str());
+}
+
+std::vector<std::string> SALOMEDS_Study::GetLockerID()
+{
+ std::vector<std::string> aVector;
+ int aLength, i;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aVector = _local_impl->GetLockerID();
+ }
+ else {
+ SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetLockerID();
+ aLength = aSeq->length();
+ for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
+ }
+ return aVector;
+}
+
+
+void SALOMEDS_Study::SetReal(const std::string& theVarName, const double theValue)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetVariable(theVarName,
+ theValue,
+ SALOMEDSImpl_GenericVariable::REAL_VAR);
+ }
+ else
+ _corba_impl->SetReal((char*)theVarName.c_str(),theValue);
+}
+
+void SALOMEDS_Study::SetInteger(const std::string& theVarName, const int theValue)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetVariable(theVarName,
+ theValue,
+ SALOMEDSImpl_GenericVariable::INTEGER_VAR);
+ }
+ else
+ _corba_impl->SetInteger((char*)theVarName.c_str(),theValue);
+}
+
+void SALOMEDS_Study::SetBoolean(const std::string& theVarName, const bool theValue)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetVariable(theVarName,
+ theValue,
+ SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
+ }
+ else
+ _corba_impl->SetBoolean((char*)theVarName.c_str(),theValue);
+}
+
+void SALOMEDS_Study::SetString(const std::string& theVarName, const std::string& theValue)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetStringVariable(theVarName,
+ theValue,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
+ }
+ else
+ _corba_impl->SetString((char*)theVarName.c_str(),(char*)theValue.c_str());
+}
+
+void SALOMEDS_Study::SetStringAsDouble(const std::string& theVarName, const double theValue)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->SetStringVariableAsDouble(theVarName,
+ theValue,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
+ }
+ else
+ _corba_impl->SetStringAsDouble((char*)theVarName.c_str(),theValue);
+}
+
+double SALOMEDS_Study::GetReal(const std::string& theVarName)
+{
+ double aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->GetVariableValue(theVarName);
+ }
+ else
+ aResult = _corba_impl->GetReal((char*)theVarName.c_str());
+ return aResult;
+}
+
+int SALOMEDS_Study::GetInteger(const std::string& theVarName)
+{
+ int aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = (int) _local_impl->GetVariableValue(theVarName);
+ }
+ else
+ aResult = _corba_impl->GetInteger((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::GetBoolean(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = (bool) _local_impl->GetVariableValue(theVarName);
+ }
+ else
+ aResult = _corba_impl->GetBoolean((char*)theVarName.c_str());
+ return aResult;
+}
+
+std::string SALOMEDS_Study::GetString(const std::string& theVarName)
+{
+ std::string aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->GetStringVariableValue(theVarName);
+ }
+ else
+ aResult = _corba_impl->GetString((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::IsReal(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->IsTypeOf(theVarName,
+ SALOMEDSImpl_GenericVariable::REAL_VAR);
+ }
+ else
+ aResult = _corba_impl->IsReal((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::IsInteger(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->IsTypeOf(theVarName,
+ SALOMEDSImpl_GenericVariable::INTEGER_VAR);
+ }
+ else
+ aResult = _corba_impl->IsInteger((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::IsBoolean(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->IsTypeOf(theVarName,
+ SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
+ }
+ else
+ aResult = _corba_impl->IsBoolean((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::IsString(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->IsTypeOf(theVarName,
+ SALOMEDSImpl_GenericVariable::STRING_VAR);
+ }
+ else
+ aResult = _corba_impl->IsString((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::IsVariable(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->IsVariable(theVarName);
+ }
+ else
+ aResult = _corba_impl->IsVariable((char*)theVarName.c_str());
+ return aResult;
+}
+
+std::vector<std::string> SALOMEDS_Study::GetVariableNames()
+{
+ std::vector<std::string> aVector;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aVector = _local_impl->GetVariableNames();
+ }
+ else {
+ SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetVariableNames();
+ int aLength = aSeq->length();
+ for (int i = 0; i < aLength; i++)
+ aVector.push_back( std::string(aSeq[i].in()) );
+ }
+ return aVector;
+}
+
+bool SALOMEDS_Study::RemoveVariable(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->RemoveVariable(theVarName);
+ }
+ else
+ aResult = _corba_impl->RemoveVariable((char*)theVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::RenameVariable(const std::string& theVarName, const std::string& theNewVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->RenameVariable(theVarName, theNewVarName);
+ }
+ else
+ aResult = _corba_impl->RenameVariable((char*)theVarName.c_str(), (char*)theNewVarName.c_str());
+ return aResult;
+}
+
+bool SALOMEDS_Study::IsVariableUsed(const std::string& theVarName)
+{
+ bool aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->IsVariableUsed(theVarName);
+ }
+ else
+ aResult = _corba_impl->IsVariableUsed((char*)theVarName.c_str());
+ return aResult;
+}
+
+std::vector< std::vector<std::string> > SALOMEDS_Study::ParseVariables(const std::string& theVars)
+{
+ std::vector< std::vector<std::string> > aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->ParseVariables(theVars);
+ }
+ else {
+ SALOMEDS::ListOfListOfStrings_var aSeq = _corba_impl->ParseVariables(theVars.c_str());
+ for (int i = 0, n = aSeq->length(); i < n; i++) {
+ std::vector<std::string> aVector;
+ SALOMEDS::ListOfStrings aSection = aSeq[i];
+ for (int j = 0, m = aSection.length(); j < m; j++) {
+ aVector.push_back( std::string(aSection[j].in()) );
+ }
+ aResult.push_back( aVector );
+ }
+ }
+ return aResult;
+}
+