/**
  * Notify all the observers.
  */
 void notify()
 {
     ObsVector::iterator it = observers.begin();
     for (; it != observers.end(); ++it) {
         Observer *o = *it;
         o->notify();
     }
 }
예제 #2
0
//---------------------------------------------------------------------------------------
void EventsDispatcher::dispatch_next_event()
{
    pair<SpEventInfo, Observer*> event;

    {
        QueueLock lock(m_mutex);
        event = m_events.front();
        m_events.pop();
    }

    SpEventInfo pEvent = event.first;
    Observer* pObserver = event.second;
    pObserver->notify(pEvent);
}