14 template <
typename TCallback>
18 std::set<TCallback*> m_callbacks;
21 void AddCallback(TCallback& callback)
23 TCallback* pCallback = &callback;
24 Eegeo_ASSERT(std::find(m_callbacks.begin(), m_callbacks.end(), pCallback) == m_callbacks.end());
25 m_callbacks.insert(pCallback);
28 void RemoveCallback(TCallback& callback)
30 TCallback* pCallback = &callback;
31 Eegeo_ASSERT(std::find(m_callbacks.begin(), m_callbacks.end(), pCallback) != m_callbacks.end());
32 m_callbacks.erase(pCallback);
39 void ExecuteCallbacks()
const
41 for(std::set<ICallback0*>::iterator it = this->m_callbacks.begin();
42 it != this->m_callbacks.end();
51 template <
typename TItem>
55 void ExecuteCallbacks(TItem& item)
const
57 for(
typename std::set<
ICallback1<TItem>*>::iterator it = this->m_callbacks.begin();
58 it != this->m_callbacks.end();
67 template <
typename TItem1,
typename TItem2>
71 void ExecuteCallbacks(TItem1& item1, TItem2& item2)
const
74 it != this->m_callbacks.end();
78 callback(item1, item2);
83 template <
typename TItem1,
typename TItem2,
typename TItem3>
87 void ExecuteCallbacks(TItem1& item1, TItem2& item2, TItem3& item3)
const
90 it != this->m_callbacks.end();
94 callback(item1, item2, item3);