--- gvpe/src/callback.h 2007/12/04 17:17:19 1.13 +++ gvpe/src/callback.h 2007/12/05 18:19:50 1.14 @@ -36,30 +36,6 @@ { typedef R (*ptr_type)(void *self); -private: - - void *self; - ptr_type func; - -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self) - { - klass *obj = static_cast(self); - return (obj->*method) (); - } - -public: template void set (K *object) { @@ -76,37 +52,25 @@ { return call (); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1) + template + static R thunk (void *self) { klass *obj = static_cast(self); - return (obj->*method) (a1); + return (obj->*method) (); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1); -public: template void set (K *object) { @@ -123,37 +87,25 @@ { return call (a1); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2) + template + static R thunk (void *self, A1 a1) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2); + return (obj->*method) (a1); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2); -public: template void set (K *object) { @@ -170,37 +122,25 @@ { return call (a1, a2); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3) + template + static R thunk (void *self, A1 a1, A2 a2) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3); + return (obj->*method) (a1, a2); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3); -public: template void set (K *object) { @@ -217,37 +157,25 @@ { return call (a1, a2, a3); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4); + return (obj->*method) (a1, a2, a3); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4); -public: template void set (K *object) { @@ -264,37 +192,25 @@ { return call (a1, a2, a3, a4); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4, a5); + return (obj->*method) (a1, a2, a3, a4); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5); -public: template void set (K *object) { @@ -311,37 +227,25 @@ { return call (a1, a2, a3, a4, a5); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4, a5, a6); + return (obj->*method) (a1, a2, a3, a4, a5); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6); -public: template void set (K *object) { @@ -358,37 +262,25 @@ { return call (a1, a2, a3, a4, a5, a6); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4, a5, a6, a7); + return (obj->*method) (a1, a2, a3, a4, a5, a6); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7); -public: template void set (K *object) { @@ -405,37 +297,25 @@ { return call (a1, a2, a3, a4, a5, a6, a7); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7, A8); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4, a5, a6, a7, a8); + return (obj->*method) (a1, a2, a3, a4, a5, a6, a7); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7, A8); -public: template void set (K *object) { @@ -452,37 +332,25 @@ { return call (a1, a2, a3, a4, a5, a6, a7, a8); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7, A8, A9); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4, a5, a6, a7, a8, a9); + return (obj->*method) (a1, a2, a3, a4, a5, a6, a7, a8); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7, A8, A9); -public: template void set (K *object) { @@ -499,37 +367,25 @@ { return call (a1, a2, a3, a4, a5, a6, a7, a8, a9); } -}; - -template -struct callback -{ - typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); private: void *self; ptr_type func; -protected: - - template - struct thunktype; - - template - struct thunktype - { - typedef klass K; - }; - - template - static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { klass *obj = static_cast(self); - return (obj->*method) (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + return (obj->*method) (a1, a2, a3, a4, a5, a6, a7, a8, a9); } +}; + +template +struct callback +{ + typedef R (*ptr_type)(void *self, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); -public: template void set (K *object) { @@ -546,6 +402,18 @@ { return call (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + +private: + + void *self; + ptr_type func; + + template + static R thunk (void *self, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) + { + klass *obj = static_cast(self); + return (obj->*method) (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } };