1 // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it
2 // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it
3 // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it
4 // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it
5 // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it
6 // THIS IS A GENERATED FILE, RUN callback.pl to regenerate it
9 callback.h -- C++ callback mechanism
10 Copyright (C) 2003 Marc Lehmann <pcg@goof.com>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 /* a proxy is a kind of recipe on how to call a specific class method */
39 virtual R call (void *obj, R (object::*meth) ()) = 0;
41 template<class O1, class O2>
42 struct proxy : proxy_base {
43 virtual R call (void *obj, R (object::*meth) ())
45 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) ()> (meth)))
53 template<class O1, class O2>
54 callback0 (O1 *object, R (O2::*method) ())
56 static proxy<O1,O2> p;
57 obj = reinterpret_cast<void *> (object);
58 meth = reinterpret_cast<R (object::*) ()> (method);
64 return prxy->call (obj, meth);
67 R operator () () const
73 template<class R, class A1>
78 R (object::*meth) (A1);
80 /* a proxy is a kind of recipe on how to call a specific class method */
82 virtual R call (void *obj, R (object::*meth) (A1), A1 a1) = 0;
84 template<class O1, class O2>
85 struct proxy : proxy_base {
86 virtual R call (void *obj, R (object::*meth) (A1), A1 a1)
88 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1)> (meth)))
96 template<class O1, class O2>
97 callback1 (O1 *object, R (O2::*method) (A1))
99 static proxy<O1,O2> p;
100 obj = reinterpret_cast<void *> (object);
101 meth = reinterpret_cast<R (object::*) (A1)> (method);
107 return prxy->call (obj, meth, a1);
110 R operator () (A1 a1) const
116 template<class R, class A1, class A2>
121 R (object::*meth) (A1, A2);
123 /* a proxy is a kind of recipe on how to call a specific class method */
125 virtual R call (void *obj, R (object::*meth) (A1, A2), A1 a1, A2 a2) = 0;
127 template<class O1, class O2>
128 struct proxy : proxy_base {
129 virtual R call (void *obj, R (object::*meth) (A1, A2), A1 a1, A2 a2)
131 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1, A2)> (meth)))
139 template<class O1, class O2>
140 callback2 (O1 *object, R (O2::*method) (A1, A2))
142 static proxy<O1,O2> p;
143 obj = reinterpret_cast<void *> (object);
144 meth = reinterpret_cast<R (object::*) (A1, A2)> (method);
148 R call (A1 a1, A2 a2) const
150 return prxy->call (obj, meth, a1, a2);
153 R operator () (A1 a1, A2 a2) const
155 return call (a1, a2);
159 template<class R, class A1, class A2, class A3>
164 R (object::*meth) (A1, A2, A3);
166 /* a proxy is a kind of recipe on how to call a specific class method */
168 virtual R call (void *obj, R (object::*meth) (A1, A2, A3), A1 a1, A2 a2, A3 a3) = 0;
170 template<class O1, class O2>
171 struct proxy : proxy_base {
172 virtual R call (void *obj, R (object::*meth) (A1, A2, A3), A1 a1, A2 a2, A3 a3)
174 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1, A2, A3)> (meth)))
182 template<class O1, class O2>
183 callback3 (O1 *object, R (O2::*method) (A1, A2, A3))
185 static proxy<O1,O2> p;
186 obj = reinterpret_cast<void *> (object);
187 meth = reinterpret_cast<R (object::*) (A1, A2, A3)> (method);
191 R call (A1 a1, A2 a2, A3 a3) const
193 return prxy->call (obj, meth, a1, a2, a3);
196 R operator () (A1 a1, A2 a2, A3 a3) const
198 return call (a1, a2, a3);
202 template<class R, class A1, class A2, class A3, class A4>
207 R (object::*meth) (A1, A2, A3, A4);
209 /* a proxy is a kind of recipe on how to call a specific class method */
211 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4), A1 a1, A2 a2, A3 a3, A4 a4) = 0;
213 template<class O1, class O2>
214 struct proxy : proxy_base {
215 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4), A1 a1, A2 a2, A3 a3, A4 a4)
217 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1, A2, A3, A4)> (meth)))
225 template<class O1, class O2>
226 callback4 (O1 *object, R (O2::*method) (A1, A2, A3, A4))
228 static proxy<O1,O2> p;
229 obj = reinterpret_cast<void *> (object);
230 meth = reinterpret_cast<R (object::*) (A1, A2, A3, A4)> (method);
234 R call (A1 a1, A2 a2, A3 a3, A4 a4) const
236 return prxy->call (obj, meth, a1, a2, a3, a4);
239 R operator () (A1 a1, A2 a2, A3 a3, A4 a4) const
241 return call (a1, a2, a3, a4);
245 template<class R, class A1, class A2, class A3, class A4, class A5>
250 R (object::*meth) (A1, A2, A3, A4, A5);
252 /* a proxy is a kind of recipe on how to call a specific class method */
254 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4, A5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) = 0;
256 template<class O1, class O2>
257 struct proxy : proxy_base {
258 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4, A5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
260 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1, A2, A3, A4, A5)> (meth)))
261 (a1, a2, a3, a4, a5);
268 template<class O1, class O2>
269 callback5 (O1 *object, R (O2::*method) (A1, A2, A3, A4, A5))
271 static proxy<O1,O2> p;
272 obj = reinterpret_cast<void *> (object);
273 meth = reinterpret_cast<R (object::*) (A1, A2, A3, A4, A5)> (method);
277 R call (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
279 return prxy->call (obj, meth, a1, a2, a3, a4, a5);
282 R operator () (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
284 return call (a1, a2, a3, a4, a5);
288 template<class R, class A1, class A2, class A3, class A4, class A5, class A6>
293 R (object::*meth) (A1, A2, A3, A4, A5, A6);
295 /* a proxy is a kind of recipe on how to call a specific class method */
297 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4, A5, A6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) = 0;
299 template<class O1, class O2>
300 struct proxy : proxy_base {
301 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4, A5, A6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
303 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1, A2, A3, A4, A5, A6)> (meth)))
304 (a1, a2, a3, a4, a5, a6);
311 template<class O1, class O2>
312 callback6 (O1 *object, R (O2::*method) (A1, A2, A3, A4, A5, A6))
314 static proxy<O1,O2> p;
315 obj = reinterpret_cast<void *> (object);
316 meth = reinterpret_cast<R (object::*) (A1, A2, A3, A4, A5, A6)> (method);
320 R call (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
322 return prxy->call (obj, meth, a1, a2, a3, a4, a5, a6);
325 R operator () (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
327 return call (a1, a2, a3, a4, a5, a6);
331 template<class R, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
336 R (object::*meth) (A1, A2, A3, A4, A5, A6, A7);
338 /* a proxy is a kind of recipe on how to call a specific class method */
340 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4, A5, A6, A7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) = 0;
342 template<class O1, class O2>
343 struct proxy : proxy_base {
344 virtual R call (void *obj, R (object::*meth) (A1, A2, A3, A4, A5, A6, A7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
346 ((reinterpret_cast<O1 *> (obj)) ->* (reinterpret_cast<R (O2::*) (A1, A2, A3, A4, A5, A6, A7)> (meth)))
347 (a1, a2, a3, a4, a5, a6, a7);
354 template<class O1, class O2>
355 callback7 (O1 *object, R (O2::*method) (A1, A2, A3, A4, A5, A6, A7))
357 static proxy<O1,O2> p;
358 obj = reinterpret_cast<void *> (object);
359 meth = reinterpret_cast<R (object::*) (A1, A2, A3, A4, A5, A6, A7)> (method);
363 R call (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
365 return prxy->call (obj, meth, a1, a2, a3, a4, a5, a6, a7);
368 R operator () (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
370 return call (a1, a2, a3, a4, a5, a6, a7);