ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/callback.h
(Generate patch)

Comparing gvpe/src/callback.h (file contents):
Revision 1.5 by pcg, Thu Mar 3 16:54:34 2005 UTC vs.
Revision 1.9 by pcg, Sat Jan 14 11:21:12 2006 UTC

1// THIS IS A GENERATED FILE, RUN callback.pl to regenerate it 1// THIS IS A GENERATED FILE: RUN callback.pl to regenerate it
2// THIS IS A GENERATED FILE, RUN callback.pl to regenerate it 2// THIS IS A GENERATED FILE: callback.pl is part of the GVPE
3// THIS IS A GENERATED FILE, RUN callback.pl to regenerate it 3// THIS IS A GENERATED FILE: distribution.
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
7 4
8/* 5/*
9 callback.h -- C++ callback mechanism 6 callback.h -- C++ callback mechanism
10 Copyright (C) 2003-2005 Marc Lehmann <gvpe@schmorp.de> 7 Copyright (C) 2003-2006 Marc Lehmann <pcg@goof.com>
11 8
12 This file is part of GVPE. 9 This file is part of GVPE.
13 10
14 GVPE is free software; you can redistribute it and/or modify 11 GVPE is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by 12 it under the terms of the GNU General Public License as published by
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details. 19 GNU General Public License for more details.
23 20
24 You should have received a copy of the GNU General Public License 21 You should have received a copy of the GNU General Public License
25 along with gvpe; if not, write to the Free Software 22 along with gvpe; if not, write to the Free Software
26 Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27*/ 24*/
28 25
29#ifndef CALLBACK_H__ 26#ifndef CALLBACK_H__
30#define CALLBACK_H__ 27#define CALLBACK_H__
31 28
36 void *obj; 33 void *obj;
37 R (object::*meth)(); 34 R (object::*meth)();
38 35
39 /* a proxy is a kind of recipe on how to call a specific class method */ 36 /* a proxy is a kind of recipe on how to call a specific class method */
40 struct proxy_base { 37 struct proxy_base {
41 virtual R call (void *obj, R (object::*meth)()) = 0; 38 virtual R call (void *obj, R (object::*meth)()) const = 0;
42 }; 39 };
43 template<class O1, class O2> 40 template<class O1, class O2>
44 struct proxy : proxy_base { 41 struct proxy : proxy_base {
45 virtual R call (void *obj, R (object::*meth)()) 42 virtual R call (void *obj, R (object::*meth)()) const
46 { 43 {
47 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)()>(meth))) 44 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)()>(meth)))
48 (); 45 ();
49 } 46 }
50 }; 47 };
51 48
52 proxy_base *prxy; 49 proxy_base *prxy;
53 50
54public: 51public:
55 template<class O1, class O2> 52 template<class O1, class O2>
56 callback0 (O1 *object, R (O2::*method)()) 53 explicit callback0 (O1 *object, R (O2::*method)())
57 { 54 {
58 static proxy<O1,O2> p; 55 static proxy<O1,O2> p;
59 obj = reinterpret_cast<void *>(object); 56 obj = reinterpret_cast<void *>(object);
60 meth = reinterpret_cast<R (object::*)()>(method); 57 meth = reinterpret_cast<R (object::*)()>(method);
61 prxy = &p; 58 prxy = &p;
79 void *obj; 76 void *obj;
80 R (object::*meth)(A1); 77 R (object::*meth)(A1);
81 78
82 /* a proxy is a kind of recipe on how to call a specific class method */ 79 /* a proxy is a kind of recipe on how to call a specific class method */
83 struct proxy_base { 80 struct proxy_base {
84 virtual R call (void *obj, R (object::*meth)(A1), A1 a1) = 0; 81 virtual R call (void *obj, R (object::*meth)(A1), A1 a1) const = 0;
85 }; 82 };
86 template<class O1, class O2> 83 template<class O1, class O2>
87 struct proxy : proxy_base { 84 struct proxy : proxy_base {
88 virtual R call (void *obj, R (object::*meth)(A1), A1 a1) 85 virtual R call (void *obj, R (object::*meth)(A1), A1 a1) const
89 { 86 {
90 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1)>(meth))) 87 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1)>(meth)))
91 (a1); 88 (a1);
92 } 89 }
93 }; 90 };
94 91
95 proxy_base *prxy; 92 proxy_base *prxy;
96 93
97public: 94public:
98 template<class O1, class O2> 95 template<class O1, class O2>
99 callback1 (O1 *object, R (O2::*method)(A1)) 96 explicit callback1 (O1 *object, R (O2::*method)(A1))
100 { 97 {
101 static proxy<O1,O2> p; 98 static proxy<O1,O2> p;
102 obj = reinterpret_cast<void *>(object); 99 obj = reinterpret_cast<void *>(object);
103 meth = reinterpret_cast<R (object::*)(A1)>(method); 100 meth = reinterpret_cast<R (object::*)(A1)>(method);
104 prxy = &p; 101 prxy = &p;
122 void *obj; 119 void *obj;
123 R (object::*meth)(A1, A2); 120 R (object::*meth)(A1, A2);
124 121
125 /* a proxy is a kind of recipe on how to call a specific class method */ 122 /* a proxy is a kind of recipe on how to call a specific class method */
126 struct proxy_base { 123 struct proxy_base {
127 virtual R call (void *obj, R (object::*meth)(A1, A2), A1 a1, A2 a2) = 0; 124 virtual R call (void *obj, R (object::*meth)(A1, A2), A1 a1, A2 a2) const = 0;
128 }; 125 };
129 template<class O1, class O2> 126 template<class O1, class O2>
130 struct proxy : proxy_base { 127 struct proxy : proxy_base {
131 virtual R call (void *obj, R (object::*meth)(A1, A2), A1 a1, A2 a2) 128 virtual R call (void *obj, R (object::*meth)(A1, A2), A1 a1, A2 a2) const
132 { 129 {
133 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2)>(meth))) 130 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2)>(meth)))
134 (a1, a2); 131 (a1, a2);
135 } 132 }
136 }; 133 };
137 134
138 proxy_base *prxy; 135 proxy_base *prxy;
139 136
140public: 137public:
141 template<class O1, class O2> 138 template<class O1, class O2>
142 callback2 (O1 *object, R (O2::*method)(A1, A2)) 139 explicit callback2 (O1 *object, R (O2::*method)(A1, A2))
143 { 140 {
144 static proxy<O1,O2> p; 141 static proxy<O1,O2> p;
145 obj = reinterpret_cast<void *>(object); 142 obj = reinterpret_cast<void *>(object);
146 meth = reinterpret_cast<R (object::*)(A1, A2)>(method); 143 meth = reinterpret_cast<R (object::*)(A1, A2)>(method);
147 prxy = &p; 144 prxy = &p;
165 void *obj; 162 void *obj;
166 R (object::*meth)(A1, A2, A3); 163 R (object::*meth)(A1, A2, A3);
167 164
168 /* a proxy is a kind of recipe on how to call a specific class method */ 165 /* a proxy is a kind of recipe on how to call a specific class method */
169 struct proxy_base { 166 struct proxy_base {
170 virtual R call (void *obj, R (object::*meth)(A1, A2, A3), A1 a1, A2 a2, A3 a3) = 0; 167 virtual R call (void *obj, R (object::*meth)(A1, A2, A3), A1 a1, A2 a2, A3 a3) const = 0;
171 }; 168 };
172 template<class O1, class O2> 169 template<class O1, class O2>
173 struct proxy : proxy_base { 170 struct proxy : proxy_base {
174 virtual R call (void *obj, R (object::*meth)(A1, A2, A3), A1 a1, A2 a2, A3 a3) 171 virtual R call (void *obj, R (object::*meth)(A1, A2, A3), A1 a1, A2 a2, A3 a3) const
175 { 172 {
176 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3)>(meth))) 173 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3)>(meth)))
177 (a1, a2, a3); 174 (a1, a2, a3);
178 } 175 }
179 }; 176 };
180 177
181 proxy_base *prxy; 178 proxy_base *prxy;
182 179
183public: 180public:
184 template<class O1, class O2> 181 template<class O1, class O2>
185 callback3 (O1 *object, R (O2::*method)(A1, A2, A3)) 182 explicit callback3 (O1 *object, R (O2::*method)(A1, A2, A3))
186 { 183 {
187 static proxy<O1,O2> p; 184 static proxy<O1,O2> p;
188 obj = reinterpret_cast<void *>(object); 185 obj = reinterpret_cast<void *>(object);
189 meth = reinterpret_cast<R (object::*)(A1, A2, A3)>(method); 186 meth = reinterpret_cast<R (object::*)(A1, A2, A3)>(method);
190 prxy = &p; 187 prxy = &p;
208 void *obj; 205 void *obj;
209 R (object::*meth)(A1, A2, A3, A4); 206 R (object::*meth)(A1, A2, A3, A4);
210 207
211 /* a proxy is a kind of recipe on how to call a specific class method */ 208 /* a proxy is a kind of recipe on how to call a specific class method */
212 struct proxy_base { 209 struct proxy_base {
213 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4), A1 a1, A2 a2, A3 a3, A4 a4) = 0; 210 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4), A1 a1, A2 a2, A3 a3, A4 a4) const = 0;
214 }; 211 };
215 template<class O1, class O2> 212 template<class O1, class O2>
216 struct proxy : proxy_base { 213 struct proxy : proxy_base {
217 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4), A1 a1, A2 a2, A3 a3, A4 a4) 214 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4), A1 a1, A2 a2, A3 a3, A4 a4) const
218 { 215 {
219 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4)>(meth))) 216 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4)>(meth)))
220 (a1, a2, a3, a4); 217 (a1, a2, a3, a4);
221 } 218 }
222 }; 219 };
223 220
224 proxy_base *prxy; 221 proxy_base *prxy;
225 222
226public: 223public:
227 template<class O1, class O2> 224 template<class O1, class O2>
228 callback4 (O1 *object, R (O2::*method)(A1, A2, A3, A4)) 225 explicit callback4 (O1 *object, R (O2::*method)(A1, A2, A3, A4))
229 { 226 {
230 static proxy<O1,O2> p; 227 static proxy<O1,O2> p;
231 obj = reinterpret_cast<void *>(object); 228 obj = reinterpret_cast<void *>(object);
232 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4)>(method); 229 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4)>(method);
233 prxy = &p; 230 prxy = &p;
251 void *obj; 248 void *obj;
252 R (object::*meth)(A1, A2, A3, A4, A5); 249 R (object::*meth)(A1, A2, A3, A4, A5);
253 250
254 /* a proxy is a kind of recipe on how to call a specific class method */ 251 /* a proxy is a kind of recipe on how to call a specific class method */
255 struct proxy_base { 252 struct proxy_base {
256 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4, A5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) = 0; 253 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4, A5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const = 0;
257 }; 254 };
258 template<class O1, class O2> 255 template<class O1, class O2>
259 struct proxy : proxy_base { 256 struct proxy : proxy_base {
260 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4, A5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) 257 virtual R call (void *obj, R (object::*meth)(A1, A2, A3, A4, A5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
261 { 258 {
262 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4, A5)>(meth))) 259 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4, A5)>(meth)))
263 (a1, a2, a3, a4, a5); 260 (a1, a2, a3, a4, a5);
264 } 261 }
265 }; 262 };
266 263
267 proxy_base *prxy; 264 proxy_base *prxy;
268 265
269public: 266public:
270 template<class O1, class O2> 267 template<class O1, class O2>
271 callback5 (O1 *object, R (O2::*method)(A1, A2, A3, A4, A5)) 268 explicit callback5 (O1 *object, R (O2::*method)(A1, A2, A3, A4, A5))
272 { 269 {
273 static proxy<O1,O2> p; 270 static proxy<O1,O2> p;
274 obj = reinterpret_cast<void *>(object); 271 obj = reinterpret_cast<void *>(object);
275 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4, A5)>(method); 272 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4, A5)>(method);
276 prxy = &p; 273 prxy = &p;
294 void *obj; 291 void *obj;
295 R (object::*meth)(A1, A2, A3, A4, A5, A6); 292 R (object::*meth)(A1, A2, A3, A4, A5, A6);
296 293
297 /* a proxy is a kind of recipe on how to call a specific class method */ 294 /* a proxy is a kind of recipe on how to call a specific class method */
298 struct proxy_base { 295 struct proxy_base {
299 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; 296 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) const = 0;
300 }; 297 };
301 template<class O1, class O2> 298 template<class O1, class O2>
302 struct proxy : proxy_base { 299 struct proxy : proxy_base {
303 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) 300 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) const
304 { 301 {
305 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4, A5, A6)>(meth))) 302 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4, A5, A6)>(meth)))
306 (a1, a2, a3, a4, a5, a6); 303 (a1, a2, a3, a4, a5, a6);
307 } 304 }
308 }; 305 };
309 306
310 proxy_base *prxy; 307 proxy_base *prxy;
311 308
312public: 309public:
313 template<class O1, class O2> 310 template<class O1, class O2>
314 callback6 (O1 *object, R (O2::*method)(A1, A2, A3, A4, A5, A6)) 311 explicit callback6 (O1 *object, R (O2::*method)(A1, A2, A3, A4, A5, A6))
315 { 312 {
316 static proxy<O1,O2> p; 313 static proxy<O1,O2> p;
317 obj = reinterpret_cast<void *>(object); 314 obj = reinterpret_cast<void *>(object);
318 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4, A5, A6)>(method); 315 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4, A5, A6)>(method);
319 prxy = &p; 316 prxy = &p;
337 void *obj; 334 void *obj;
338 R (object::*meth)(A1, A2, A3, A4, A5, A6, A7); 335 R (object::*meth)(A1, A2, A3, A4, A5, A6, A7);
339 336
340 /* a proxy is a kind of recipe on how to call a specific class method */ 337 /* a proxy is a kind of recipe on how to call a specific class method */
341 struct proxy_base { 338 struct proxy_base {
342 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; 339 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) const = 0;
343 }; 340 };
344 template<class O1, class O2> 341 template<class O1, class O2>
345 struct proxy : proxy_base { 342 struct proxy : proxy_base {
346 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) 343 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) const
347 { 344 {
348 ((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4, A5, A6, A7)>(meth))) 345 return (R)((reinterpret_cast<O1 *>(obj)) ->* (reinterpret_cast<R (O2::*)(A1, A2, A3, A4, A5, A6, A7)>(meth)))
349 (a1, a2, a3, a4, a5, a6, a7); 346 (a1, a2, a3, a4, a5, a6, a7);
350 } 347 }
351 }; 348 };
352 349
353 proxy_base *prxy; 350 proxy_base *prxy;
354 351
355public: 352public:
356 template<class O1, class O2> 353 template<class O1, class O2>
357 callback7 (O1 *object, R (O2::*method)(A1, A2, A3, A4, A5, A6, A7)) 354 explicit callback7 (O1 *object, R (O2::*method)(A1, A2, A3, A4, A5, A6, A7))
358 { 355 {
359 static proxy<O1,O2> p; 356 static proxy<O1,O2> p;
360 obj = reinterpret_cast<void *>(object); 357 obj = reinterpret_cast<void *>(object);
361 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4, A5, A6, A7)>(method); 358 meth = reinterpret_cast<R (object::*)(A1, A2, A3, A4, A5, A6, A7)>(method);
362 prxy = &p; 359 prxy = &p;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines