14 virtual void operator()()
const = 0;
17 template <
typename TCallbackContext>
21 typedef void (TCallbackContext::*TCallTarget)();
23 TCallback0(TCallbackContext* context, TCallTarget callback)
24 : m_callback(callback)
29 virtual void operator()()
const
31 (*m_pContext.*m_callback)();
34 TCallTarget m_callback;
35 TCallbackContext* m_pContext;
43 virtual void operator()(T& item)
const = 0;
46 template <
typename TCallbackContext,
typename TItem>
50 typedef void (TCallbackContext::*TCallTarget)(TItem& item);
52 TCallback1(TCallbackContext* context, TCallTarget callback)
53 : m_callback(callback)
58 virtual ~TCallback1() { }
60 virtual void operator()(TItem& item)
const
62 (*m_pContext.*m_callback)(item);
65 TCallTarget m_callback;
66 TCallbackContext* m_pContext;
69 template <
typename TItem1,
typename TItem2>
74 virtual void operator()(TItem1& item1, TItem2& item2)
const = 0;
77 template <
typename TCallbackContext,
typename TItem1,
typename TItem2>
81 typedef void (TCallbackContext::*TCallTarget)(TItem1& item1, TItem2& item2);
83 TCallback2(TCallbackContext* context, TCallTarget callback)
84 : m_callback(callback)
89 virtual ~TCallback2() { }
91 virtual void operator()(TItem1& item1, TItem2& item2)
const
93 (*m_pContext.*m_callback)(item1, item2);
96 TCallTarget m_callback;
97 TCallbackContext* m_pContext;
100 template <
typename TItem1,
typename TItem2,
typename TItem3>
105 virtual void operator()(TItem1& item1, TItem2& item2, TItem3& item3)
const = 0;
108 template <
typename TCallbackContext,
typename TItem1,
typename TItem2,
typename TItem3>
112 typedef void (TCallbackContext::*TCallTarget)(TItem1& item1, TItem2& item2, TItem3& item3);
114 TCallback3(TCallbackContext* context, TCallTarget callback)
115 : m_callback(callback)
116 , m_pContext(context)
120 virtual ~TCallback3() { }
122 virtual void operator()(TItem1& item1, TItem2& item2, TItem3& item3)
const
124 (*m_pContext.*m_callback)(item1, item2, item3);
127 TCallTarget m_callback;
128 TCallbackContext* m_pContext;