return builder->GetBuilder();
}
+/*
+SALOMEDS_EXPORT
+ SALOMEDSClient_Observer* ObserverFactory(SALOME::Observer_ptr theObserver)
+{
+ if(CORBA::is_nil(theObserver)) return NULL;
+ return new SALOMEDS_Observer(theObserver);
+}
+*/
}
}
return _PTR(AttributeParameter)(AP);
}
+
+void SALOMEDS_Study::attach(SALOME::Observer_ptr theObserver)
+{
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ _local_impl->attach(theObserver);
+ }
+ else {
+ _corba_impl->attach(theObserver);
+ }
+}
+
virtual bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
virtual bool IsVariableUsed(const std::string& theVarName);
virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars);
+ virtual void attach(SALOME::Observer_ptr theObserver);
std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);
SALOMEDSClient_UseCaseIterator.hxx \
SALOMEDSClient_ClientFactory.hxx \
SALOMEDSClient_IParameters.hxx \
+ SALOMEDSClient_Observer.hxx \
SALOMEDSClient.hxx
#
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SALOMEDSClient_Observer.hxx
+// Author : Nicolas GEIMER
+// Module : SALOME
+//
+#ifndef __SALOMEDSClient_OBSERVER_H__
+#define __SALOMEDSClient_OBSERVER_H__
+
+#include <string>
+
+class SALOMEDSClient_Observer
+{
+
+ public:
+ virtual void notifyObserver(const std::string& theID,const std::string& event) = 0;
+
+};
+
+
+#endif
#include "SALOMEDSClient_UseCaseBuilder.hxx"
#include "SALOMEDSClient_AttributeStudyProperties.hxx"
#include "SALOMEDSClient_ChildIterator.hxx"
+#include "SALOMEDSClient_Observer.hxx"
+#include CORBA_CLIENT_HEADER(SALOME_Observer)
class SALOMEDSClient_Study
{
virtual bool IsVariableUsed(const std::string& theVarName) = 0;
virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars) = 0;
-
+
+ virtual void attach(SALOME::Observer_ptr theObserver) = 0;
+
};
#include <fstream>
#include <sstream>
+#include "utilities.h"
+
#define DIRECTORYID 16661
#define FILELOCALID 26662
#define FILEID "FILE: "
*/
//============================================================================
bool SALOMEDSImpl_Study::addSO_Notification (const SALOMEDSImpl_SObject& theSObject) {
+ MESSAGE("Notification ADD called")
CORBA::String_var event="ADD";
CORBA::String_var anID=theSObject.GetID().c_str();
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
*/
//============================================================================
bool SALOMEDSImpl_Study::removeSO_Notification (const SALOMEDSImpl_SObject& theSObject) {
+ MESSAGE("Notification REMOVE called")
CORBA::String_var event="REMOVE";
CORBA::String_var anID=theSObject.GetID().c_str();
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
*/
//============================================================================
bool SALOMEDSImpl_Study::modifySO_Notification (const SALOMEDSImpl_SObject& theSObject) {
+ MESSAGE("Notification MODIFY called")
CORBA::String_var event="MODIFY";
CORBA::String_var anID=theSObject.GetID().c_str();
for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
SALOMEDSImpl_SComponent so = _study->GetSComponent (NL);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
+ _study->addSO_Notification(so);
_doc->SetModified(true);
SALOMEDSImpl_SObject so = _study->GetSObject(NewLab);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
+ _study->addSO_Notification(so);
_doc->SetModified(true);
return so;
SALOMEDSImpl_SObject so = _study->GetSObject(NewLab);
if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so);
+ _study->addSO_Notification(so);
_doc->SetModified(true);
return so;
}
if(_callbackOnRemove) _callbackOnRemove->OnRemoveSObject(anObject);
+ _study->removeSO_Notification(anObject);
DF_Label Lab = anObject.GetLabel();
}
if(_callbackOnRemove) _callbackOnRemove->OnRemoveSObject(anObject);
+ _study->removeSO_Notification(anObject);
DF_Label Lab = anObject.GetLabel();
SALOMEDSImpl_AttributeTarget::Set(RefLab)->Add(SALOMEDSImpl_Study::SObject(Lab));
if(_callbackOnRemove && Lab.IsDescendant(_doc->Main())) _callbackOnRemove->OnRemoveSObject(me);
+ _study->removeSO_Notification(me);
return true;
}
SALOMEDSImpl_AttributeName::Set(theSO.GetLabel(), theValue);
_doc->SetModified(true);
+ _study->modifySO_Notification(theSO);
return true;
}
SALOMEDSImpl_AttributeComment::Set(theSO.GetLabel(), theValue);
_doc->SetModified(true);
+ _study->modifySO_Notification(theSO);
return true;
}
SALOMEDSImpl_AttributeIOR::Set(theSO.GetLabel(), theValue);
_doc->SetModified(true);
+ _study->modifySO_Notification(theSO);
return true;
}