return true; // NGE return always true but can be modified if needed
}
+ //============================================================================
+ /*! Function : modifyNB_Notification
+ * Purpose : This function tells all the observers that
+ * a NoteBook variable has been added/modified/removed.
+ */
+ //============================================================================
+
+ virtual bool modifyNB_Notification(const char* theVarName)
+ {
+ for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
+ {
+ it->first->notifyObserverID(theVarName,6);
+ }
+ return true; // NGE return always true but can be modified if needed
+ }
+
//============================================================================
/*! Function : attach
* Purpose : register an Observer
_impl->SetVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::REAL_VAR);
+ if(_notifier)
+ _notifier->modifyNB_Notification(theVarName);
}
//============================================================================
_impl->SetVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::INTEGER_VAR);
+ if(_notifier)
+ _notifier->modifyNB_Notification(theVarName);
}
//============================================================================
_impl->SetVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
+ if(_notifier)
+ _notifier->modifyNB_Notification(theVarName);
}
//============================================================================
_impl->SetStringVariable(std::string(theVarName),
theValue,
SALOMEDSImpl_GenericVariable::STRING_VAR);
+ if(_notifier)
+ _notifier->modifyNB_Notification(theVarName);
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::RemoveVariable(const char* theVarName)
{
- return _impl->RemoveVariable(std::string(theVarName));
+ CORBA::Boolean res = _impl->RemoveVariable(std::string(theVarName));
+ if(res && _notifier)
+ _notifier->modifyNB_Notification(theVarName);
+ return res;
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::RenameVariable(const char* theVarName, const char* theNewVarName)
{
- return _impl->RenameVariable(std::string(theVarName), std::string(theNewVarName));
+ CORBA::Boolean res = _impl->RenameVariable(std::string(theVarName), std::string(theNewVarName));
+ if(res && _notifier)
+ _notifier->modifyNB_Notification(theVarName);
+ return res;
}
//============================================================================