X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FObservable.cxx;h=a70219e52422dc8f71d51feb369fb87977194f8b;hb=148148d87a5ed486b321de977e8bb64f39e1e49c;hp=b169cc43b0e737cd74a3646d680b1d293d4959a7;hpb=0b3b25440d23eabf549ebdfa0a4a39ea91ea2f23;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.cxx index b169cc4..a70219e 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.cxx @@ -43,47 +43,30 @@ namespace bbtk //========================================================================= Observable::Observable() { - _changed=false; } //========================================================================= + Observable::~Observable() { } - //========================================================================= - - bool Observable::hasChanged() - { - return _changed; - } //========================================================================= - void Observable::notifyObservers(int command) + void Observable::notifyObservers(int idCaller,int command) { - if(_changed) + + int i; + for(i=0;i<_observers.size();i++) { - int i; - for(i=0;i<_observers.size();i++) - { - _observers[i]->update(command); - } - _changed=false; + _observers[i]->update(idCaller,command); } } - //========================================================================= - - void Observable::setChanged() - { - _changed=true; - } - //========================================================================= void Observable::addObserver(Observer *observer) { - std::cout<<"RaC Observable::addObserver "<