| 555 | typedef typename Super::ListenerList ListenerList; |
| 556 | |
| 557 | void Send(T t) const |
| 558 | { |
| 559 | ListenerList listeners; |
| 560 | |
| 561 | { |
| 562 | this->m_Mutex.lock(); |
| 563 | listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end()); |
| 564 | this->m_Mutex.unlock(); |
| 565 | } |
| 566 | |
| 567 | for (auto iter = listeners.begin(); iter != listeners.end(); ++iter) |
| 568 | { |
| 569 | // notify each listener |
| 570 | (*iter)->Execute(t); |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | void operator() (T t) const { this->Send(t); } |
| 575 | }; |