#pragma once #define RESULT(x) SC_ARGS_1 = (x) template class binder_func_0 : public func_caller { typedef TR (*func_t)(); const func_t m_call; public: binder_func_0(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call()); } }; template<> class binder_func_0 : public func_caller { typedef void (*func_t)(); const func_t m_call; public: binder_func_0(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(); } }; template class binder_func_1 : public func_caller { typedef TR (*func_t)(T1); const func_t m_call; public: binder_func_1(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_1)); } }; template class binder_func_1 : public func_caller { typedef void (*func_t)(T1); const func_t m_call; public: binder_func_1(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_1); } }; template class binder_func_2 : public func_caller { typedef TR (*func_t)(T1, T2); const func_t m_call; public: binder_func_2(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_2)); } }; template class binder_func_2 : public func_caller { typedef void (*func_t)(T1, T2); const func_t m_call; public: binder_func_2(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_2); } }; template class binder_func_3 : public func_caller { typedef TR (*func_t)(T1, T2, T3); const func_t m_call; public: binder_func_3(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_3)); } }; template class binder_func_3 : public func_caller { typedef void (*func_t)(T1, T2, T3); const func_t m_call; public: binder_func_3(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_3); } }; template class binder_func_4 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4); const func_t m_call; public: binder_func_4(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_4)); } }; template class binder_func_4 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4); const func_t m_call; public: binder_func_4(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_4); } }; template class binder_func_5 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5); const func_t m_call; public: binder_func_5(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_5)); } }; template class binder_func_5 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5); const func_t m_call; public: binder_func_5(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_5); } }; template class binder_func_6 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6); const func_t m_call; public: binder_func_6(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_6)); } }; template class binder_func_6 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6); const func_t m_call; public: binder_func_6(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_6); } }; template class binder_func_7 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6, T7); const func_t m_call; public: binder_func_7(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_7)); } }; template class binder_func_7 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6, T7); const func_t m_call; public: binder_func_7(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_7); } }; template class binder_func_8 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8); const func_t m_call; public: binder_func_8(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_8)); } }; template class binder_func_8 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8); const func_t m_call; public: binder_func_8(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_8); } }; template class binder_func_9 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9); const func_t m_call; public: binder_func_9(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_9)); } }; template class binder_func_9 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9); const func_t m_call; public: binder_func_9(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_9); } }; template class binder_func_10 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10); const func_t m_call; public: binder_func_10(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_10)); } }; template class binder_func_10 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10); const func_t m_call; public: binder_func_10(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_10); } }; template class binder_func_11 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11); const func_t m_call; public: binder_func_11(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_11)); } }; template class binder_func_11 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11); const func_t m_call; public: binder_func_11(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_11); } }; template class binder_func_12 : public func_caller { typedef TR (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12); const func_t m_call; public: binder_func_12(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); RESULT(m_call(SC_ARGS_12)); } }; template class binder_func_12 : public func_caller { typedef void (*func_t)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12); const func_t m_call; public: binder_func_12(func_t call) : func_caller(), m_call(call) {} virtual void operator()() { declCPU(); m_call(SC_ARGS_12); } }; template func_caller* bind_func(TR (*call)()) { return new binder_func_0(call); } template func_caller* bind_func(TR (*call)(T1)) { return new binder_func_1(call); } template func_caller* bind_func(TR (*call)(T1, T2)) { return new binder_func_2(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3)) { return new binder_func_3(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4)) { return new binder_func_4(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5)) { return new binder_func_5(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6)) { return new binder_func_6(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6, T7)) { return new binder_func_7(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6, T7, T8)) { return new binder_func_8(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6, T7, T8, T9)) { return new binder_func_9(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)) { return new binder_func_10(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)) { return new binder_func_11(call); } template func_caller* bind_func(TR (*call)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)) { return new binder_func_12(call); }