| 587 | typedef typename Super::ListenerList ListenerList; |
| 588 | |
| 589 | void Send(T t, U u) const |
| 590 | { |
| 591 | ListenerList listeners; |
| 592 | |
| 593 | { |
| 594 | this->m_Mutex.lock(); |
| 595 | listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end()); |
| 596 | this->m_Mutex.unlock(); |
| 597 | } |
| 598 | |
| 599 | for (auto iter = listeners.begin(); iter != listeners.end(); ++iter) |
| 600 | { |
| 601 | // notify each listener |
| 602 | (*iter)->Execute(t, u); |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | void operator()(T t, U u) const { this->Send(t, u); } |
| 607 | }; |