blob: 7a8486a30927f481f0df7a1d5d235af6b9218def [file] [log] [blame]
[email protected]054ac7542011-02-27 01:25:591// This file was GENERATED by command:
2// pump.py bind_internal_win.h.pump
3// DO NOT EDIT BY HAND!!!
4
5
6// Copyright (c) 2011 The Chromium Authors. All rights reserved.
7// Use of this source code is governed by a BSD-style license that can be
8// found in the LICENSE file.
9
[email protected]7296f2762011-11-21 19:23:4410// Specializations of RunnableAdapter<> for Windows specific calling
[email protected]054ac7542011-02-27 01:25:5911// conventions. Please see base/bind_internal.h for more info.
12
13#ifndef BASE_BIND_INTERNAL_WIN_H_
14#define BASE_BIND_INTERNAL_WIN_H_
[email protected]054ac7542011-02-27 01:25:5915
[email protected]b224f792011-04-20 16:02:2316// In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all
17// the same as __cdecl which would turn the following specializations into
18// multiple definitions.
19#if !defined(ARCH_CPU_X86_64)
20
[email protected]054ac7542011-02-27 01:25:5921namespace base {
22namespace internal {
23
[email protected]7296f2762011-11-21 19:23:4424template <typename Functor>
25class RunnableAdapter;
[email protected]054ac7542011-02-27 01:25:5926
27// __stdcall Function: Arity 0.
28template <typename R>
[email protected]7296f2762011-11-21 19:23:4429class RunnableAdapter<R(__stdcall *)()> {
30 public:
31 typedef R (RunType)();
[email protected]93540582011-05-16 22:35:1432
[email protected]7296f2762011-11-21 19:23:4433 explicit RunnableAdapter(R(__stdcall *function)())
34 : function_(function) {
35 }
36
37 R Run() {
38 return function_();
39 }
40
41 private:
42 R (__stdcall *function_)();
[email protected]054ac7542011-02-27 01:25:5943};
44
45// __fastcall Function: Arity 0.
46template <typename R>
[email protected]7296f2762011-11-21 19:23:4447class RunnableAdapter<R(__fastcall *)()> {
48 public:
49 typedef R (RunType)();
[email protected]93540582011-05-16 22:35:1450
[email protected]7296f2762011-11-21 19:23:4451 explicit RunnableAdapter(R(__fastcall *function)())
52 : function_(function) {
53 }
54
55 R Run() {
56 return function_();
57 }
58
59 private:
60 R (__fastcall *function_)();
[email protected]054ac7542011-02-27 01:25:5961};
62
63// __stdcall Function: Arity 1.
[email protected]7296f2762011-11-21 19:23:4464template <typename R, typename A1>
65class RunnableAdapter<R(__stdcall *)(A1)> {
66 public:
67 typedef R (RunType)(A1);
[email protected]93540582011-05-16 22:35:1468
[email protected]7296f2762011-11-21 19:23:4469 explicit RunnableAdapter(R(__stdcall *function)(A1))
70 : function_(function) {
71 }
[email protected]93540582011-05-16 22:35:1472
[email protected]7296f2762011-11-21 19:23:4473 R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
74 return function_(a1);
75 }
76
77 private:
78 R (__stdcall *function_)(A1);
[email protected]054ac7542011-02-27 01:25:5979};
80
81// __fastcall Function: Arity 1.
[email protected]7296f2762011-11-21 19:23:4482template <typename R, typename A1>
83class RunnableAdapter<R(__fastcall *)(A1)> {
84 public:
85 typedef R (RunType)(A1);
[email protected]93540582011-05-16 22:35:1486
[email protected]7296f2762011-11-21 19:23:4487 explicit RunnableAdapter(R(__fastcall *function)(A1))
88 : function_(function) {
89 }
[email protected]93540582011-05-16 22:35:1490
[email protected]7296f2762011-11-21 19:23:4491 R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
92 return function_(a1);
93 }
94
95 private:
96 R (__fastcall *function_)(A1);
[email protected]054ac7542011-02-27 01:25:5997};
98
99// __stdcall Function: Arity 2.
[email protected]7296f2762011-11-21 19:23:44100template <typename R, typename A1, typename A2>
101class RunnableAdapter<R(__stdcall *)(A1, A2)> {
102 public:
103 typedef R (RunType)(A1, A2);
[email protected]93540582011-05-16 22:35:14104
[email protected]7296f2762011-11-21 19:23:44105 explicit RunnableAdapter(R(__stdcall *function)(A1, A2))
106 : function_(function) {
107 }
[email protected]93540582011-05-16 22:35:14108
[email protected]7296f2762011-11-21 19:23:44109 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
110 typename CallbackParamTraits<A2>::ForwardType a2) {
111 return function_(a1, a2);
112 }
113
114 private:
115 R (__stdcall *function_)(A1, A2);
[email protected]054ac7542011-02-27 01:25:59116};
117
118// __fastcall Function: Arity 2.
[email protected]7296f2762011-11-21 19:23:44119template <typename R, typename A1, typename A2>
120class RunnableAdapter<R(__fastcall *)(A1, A2)> {
121 public:
122 typedef R (RunType)(A1, A2);
[email protected]93540582011-05-16 22:35:14123
[email protected]7296f2762011-11-21 19:23:44124 explicit RunnableAdapter(R(__fastcall *function)(A1, A2))
125 : function_(function) {
126 }
[email protected]93540582011-05-16 22:35:14127
[email protected]7296f2762011-11-21 19:23:44128 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
129 typename CallbackParamTraits<A2>::ForwardType a2) {
130 return function_(a1, a2);
131 }
132
133 private:
134 R (__fastcall *function_)(A1, A2);
[email protected]054ac7542011-02-27 01:25:59135};
136
137// __stdcall Function: Arity 3.
[email protected]7296f2762011-11-21 19:23:44138template <typename R, typename A1, typename A2, typename A3>
139class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> {
140 public:
141 typedef R (RunType)(A1, A2, A3);
[email protected]93540582011-05-16 22:35:14142
[email protected]7296f2762011-11-21 19:23:44143 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3))
144 : function_(function) {
145 }
[email protected]93540582011-05-16 22:35:14146
[email protected]7296f2762011-11-21 19:23:44147 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
148 typename CallbackParamTraits<A2>::ForwardType a2,
149 typename CallbackParamTraits<A3>::ForwardType a3) {
150 return function_(a1, a2, a3);
151 }
152
153 private:
154 R (__stdcall *function_)(A1, A2, A3);
[email protected]054ac7542011-02-27 01:25:59155};
156
157// __fastcall Function: Arity 3.
[email protected]7296f2762011-11-21 19:23:44158template <typename R, typename A1, typename A2, typename A3>
159class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> {
160 public:
161 typedef R (RunType)(A1, A2, A3);
[email protected]93540582011-05-16 22:35:14162
[email protected]7296f2762011-11-21 19:23:44163 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3))
164 : function_(function) {
165 }
[email protected]93540582011-05-16 22:35:14166
[email protected]7296f2762011-11-21 19:23:44167 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
168 typename CallbackParamTraits<A2>::ForwardType a2,
169 typename CallbackParamTraits<A3>::ForwardType a3) {
170 return function_(a1, a2, a3);
171 }
172
173 private:
174 R (__fastcall *function_)(A1, A2, A3);
[email protected]054ac7542011-02-27 01:25:59175};
176
177// __stdcall Function: Arity 4.
[email protected]7296f2762011-11-21 19:23:44178template <typename R, typename A1, typename A2, typename A3, typename A4>
179class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> {
180 public:
181 typedef R (RunType)(A1, A2, A3, A4);
[email protected]93540582011-05-16 22:35:14182
[email protected]7296f2762011-11-21 19:23:44183 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4))
184 : function_(function) {
185 }
[email protected]93540582011-05-16 22:35:14186
[email protected]7296f2762011-11-21 19:23:44187 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
188 typename CallbackParamTraits<A2>::ForwardType a2,
189 typename CallbackParamTraits<A3>::ForwardType a3,
190 typename CallbackParamTraits<A4>::ForwardType a4) {
191 return function_(a1, a2, a3, a4);
192 }
193
194 private:
195 R (__stdcall *function_)(A1, A2, A3, A4);
[email protected]054ac7542011-02-27 01:25:59196};
197
198// __fastcall Function: Arity 4.
[email protected]7296f2762011-11-21 19:23:44199template <typename R, typename A1, typename A2, typename A3, typename A4>
200class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
201 public:
202 typedef R (RunType)(A1, A2, A3, A4);
[email protected]93540582011-05-16 22:35:14203
[email protected]7296f2762011-11-21 19:23:44204 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4))
205 : function_(function) {
206 }
[email protected]93540582011-05-16 22:35:14207
[email protected]7296f2762011-11-21 19:23:44208 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
209 typename CallbackParamTraits<A2>::ForwardType a2,
210 typename CallbackParamTraits<A3>::ForwardType a3,
211 typename CallbackParamTraits<A4>::ForwardType a4) {
212 return function_(a1, a2, a3, a4);
213 }
214
215 private:
216 R (__fastcall *function_)(A1, A2, A3, A4);
[email protected]054ac7542011-02-27 01:25:59217};
218
219// __stdcall Function: Arity 5.
[email protected]7296f2762011-11-21 19:23:44220template <typename R, typename A1, typename A2, typename A3, typename A4,
221 typename A5>
222class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> {
223 public:
224 typedef R (RunType)(A1, A2, A3, A4, A5);
[email protected]93540582011-05-16 22:35:14225
[email protected]7296f2762011-11-21 19:23:44226 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5))
227 : function_(function) {
228 }
[email protected]93540582011-05-16 22:35:14229
[email protected]7296f2762011-11-21 19:23:44230 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
231 typename CallbackParamTraits<A2>::ForwardType a2,
232 typename CallbackParamTraits<A3>::ForwardType a3,
233 typename CallbackParamTraits<A4>::ForwardType a4,
234 typename CallbackParamTraits<A5>::ForwardType a5) {
235 return function_(a1, a2, a3, a4, a5);
236 }
237
238 private:
239 R (__stdcall *function_)(A1, A2, A3, A4, A5);
[email protected]054ac7542011-02-27 01:25:59240};
241
242// __fastcall Function: Arity 5.
[email protected]7296f2762011-11-21 19:23:44243template <typename R, typename A1, typename A2, typename A3, typename A4,
244 typename A5>
245class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> {
246 public:
247 typedef R (RunType)(A1, A2, A3, A4, A5);
[email protected]93540582011-05-16 22:35:14248
[email protected]7296f2762011-11-21 19:23:44249 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5))
250 : function_(function) {
251 }
[email protected]93540582011-05-16 22:35:14252
[email protected]7296f2762011-11-21 19:23:44253 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
254 typename CallbackParamTraits<A2>::ForwardType a2,
255 typename CallbackParamTraits<A3>::ForwardType a3,
256 typename CallbackParamTraits<A4>::ForwardType a4,
257 typename CallbackParamTraits<A5>::ForwardType a5) {
258 return function_(a1, a2, a3, a4, a5);
259 }
260
261 private:
262 R (__fastcall *function_)(A1, A2, A3, A4, A5);
[email protected]054ac7542011-02-27 01:25:59263};
264
265// __stdcall Function: Arity 6.
[email protected]7296f2762011-11-21 19:23:44266template <typename R, typename A1, typename A2, typename A3, typename A4,
267 typename A5, typename A6>
268class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> {
269 public:
270 typedef R (RunType)(A1, A2, A3, A4, A5, A6);
[email protected]93540582011-05-16 22:35:14271
[email protected]7296f2762011-11-21 19:23:44272 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6))
273 : function_(function) {
274 }
[email protected]93540582011-05-16 22:35:14275
[email protected]7296f2762011-11-21 19:23:44276 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
277 typename CallbackParamTraits<A2>::ForwardType a2,
278 typename CallbackParamTraits<A3>::ForwardType a3,
279 typename CallbackParamTraits<A4>::ForwardType a4,
280 typename CallbackParamTraits<A5>::ForwardType a5,
281 typename CallbackParamTraits<A6>::ForwardType a6) {
282 return function_(a1, a2, a3, a4, a5, a6);
283 }
284
285 private:
286 R (__stdcall *function_)(A1, A2, A3, A4, A5, A6);
[email protected]054ac7542011-02-27 01:25:59287};
288
289// __fastcall Function: Arity 6.
[email protected]7296f2762011-11-21 19:23:44290template <typename R, typename A1, typename A2, typename A3, typename A4,
291 typename A5, typename A6>
292class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> {
293 public:
294 typedef R (RunType)(A1, A2, A3, A4, A5, A6);
[email protected]93540582011-05-16 22:35:14295
[email protected]7296f2762011-11-21 19:23:44296 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6))
297 : function_(function) {
298 }
[email protected]93540582011-05-16 22:35:14299
[email protected]7296f2762011-11-21 19:23:44300 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
301 typename CallbackParamTraits<A2>::ForwardType a2,
302 typename CallbackParamTraits<A3>::ForwardType a3,
303 typename CallbackParamTraits<A4>::ForwardType a4,
304 typename CallbackParamTraits<A5>::ForwardType a5,
305 typename CallbackParamTraits<A6>::ForwardType a6) {
306 return function_(a1, a2, a3, a4, a5, a6);
307 }
308
309 private:
310 R (__fastcall *function_)(A1, A2, A3, A4, A5, A6);
[email protected]054ac7542011-02-27 01:25:59311};
312
[email protected]fccef1552011-11-28 22:13:54313// __stdcall Function: Arity 7.
314template <typename R, typename A1, typename A2, typename A3, typename A4,
315 typename A5, typename A6, typename A7>
316class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> {
317 public:
318 typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
319
320 explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7))
321 : function_(function) {
322 }
323
324 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
325 typename CallbackParamTraits<A2>::ForwardType a2,
326 typename CallbackParamTraits<A3>::ForwardType a3,
327 typename CallbackParamTraits<A4>::ForwardType a4,
328 typename CallbackParamTraits<A5>::ForwardType a5,
329 typename CallbackParamTraits<A6>::ForwardType a6,
330 typename CallbackParamTraits<A7>::ForwardType a7) {
331 return function_(a1, a2, a3, a4, a5, a6, a7);
332 }
333
334 private:
335 R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7);
336};
337
338// __fastcall Function: Arity 7.
339template <typename R, typename A1, typename A2, typename A3, typename A4,
340 typename A5, typename A6, typename A7>
341class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> {
342 public:
343 typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
344
345 explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7))
346 : function_(function) {
347 }
348
349 R Run(typename CallbackParamTraits<A1>::ForwardType a1,
350 typename CallbackParamTraits<A2>::ForwardType a2,
351 typename CallbackParamTraits<A3>::ForwardType a3,
352 typename CallbackParamTraits<A4>::ForwardType a4,
353 typename CallbackParamTraits<A5>::ForwardType a5,
354 typename CallbackParamTraits<A6>::ForwardType a6,
355 typename CallbackParamTraits<A7>::ForwardType a7) {
356 return function_(a1, a2, a3, a4, a5, a6, a7);
357 }
358
359 private:
360 R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7);
361};
362
[email protected]054ac7542011-02-27 01:25:59363} // namespace internal
364} // namespace base
365
[email protected]b224f792011-04-20 16:02:23366#endif // !defined(ARCH_CPU_X86_64)
367
[email protected]054ac7542011-02-27 01:25:59368#endif // BASE_BIND_INTERNAL_WIN_H_