29 using namespace YACS::BASES;
30 using namespace YACS::ENGINE;
32 map< pair<int,string> , set<YACS_ORB::Observer_ptr> > SALOMEDispatcher::_observers;
35 SALOMEDispatcher::SALOMEDispatcher()
39 SALOMEDispatcher::~SALOMEDispatcher()
43 void SALOMEDispatcher::setSALOMEDispatcher()
45 DEBTRACE(
"SALOMEDispatcher::setSALOMEDispatcher");
55 void SALOMEDispatcher::dispatch(
Node*
object,
const std::string& event)
57 DEBTRACE(
"SALOMEDispatcher::dispatch " << event <<
" " << object->
getNumId());
58 CORBA::Long numId =
object->getNumId();
59 typedef set<YACS_ORB::Observer_ptr>::iterator jt;
60 std::pair<int,std::string> key(numId, event);
61 for(jt iter = _observers[key].begin(); iter!=_observers[key].end(); iter++)
63 if (! CORBA::is_nil(*iter))
65 DEBTRACE(
"numId, event " << numId <<
" " << event );
66 (*iter)->notifyObserver(numId, event.c_str());
69 DEBTRACE(
"************************** dispatch on a CORBA::nil *******************************");
73 void SALOMEDispatcher::addObserver(YACS_ORB::Observer_ptr observer,
77 _observers[std::pair<int,std::string>(numid,event)].insert(YACS_ORB::Observer::_duplicate(observer));