1 // This file was GENERATED by command:
2 // pump.py bind_internal_win.h.pump
3 // DO NOT EDIT BY HAND!!!
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.
10 // Specializations of RunnableAdapter<> for Windows specific calling
11 // conventions. Please see base/bind_internal.h for more info.
13 #ifndef BASE_BIND_INTERNAL_WIN_H_
14 #define BASE_BIND_INTERNAL_WIN_H_
17 // In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all
18 // the same as __cdecl which would turn the following specializations into
19 // multiple definitions.
20 #if !defined(ARCH_CPU_X86_64)
25 template <typename Functor
>
26 class RunnableAdapter
;
28 // __stdcall Function: Arity 0.
30 class RunnableAdapter
<R(__stdcall
*)()> {
32 typedef R (RunType
)();
34 explicit RunnableAdapter(R(__stdcall
*function
)())
35 : function_(function
) {
43 R (__stdcall
*function_
)();
46 // __fastcall Function: Arity 0.
48 class RunnableAdapter
<R(__fastcall
*)()> {
50 typedef R (RunType
)();
52 explicit RunnableAdapter(R(__fastcall
*function
)())
53 : function_(function
) {
61 R (__fastcall
*function_
)();
64 // __stdcall Function: Arity 1.
65 template <typename R
, typename A1
>
66 class RunnableAdapter
<R(__stdcall
*)(A1
)> {
68 typedef R (RunType
)(A1
);
70 explicit RunnableAdapter(R(__stdcall
*function
)(A1
))
71 : function_(function
) {
74 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
) {
79 R (__stdcall
*function_
)(A1
);
82 // __fastcall Function: Arity 1.
83 template <typename R
, typename A1
>
84 class RunnableAdapter
<R(__fastcall
*)(A1
)> {
86 typedef R (RunType
)(A1
);
88 explicit RunnableAdapter(R(__fastcall
*function
)(A1
))
89 : function_(function
) {
92 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
) {
97 R (__fastcall
*function_
)(A1
);
100 // __stdcall Function: Arity 2.
101 template <typename R
, typename A1
, typename A2
>
102 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
)> {
104 typedef R (RunType
)(A1
, A2
);
106 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
))
107 : function_(function
) {
110 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
111 typename CallbackParamTraits
<A2
>::ForwardType a2
) {
112 return function_(a1
, a2
);
116 R (__stdcall
*function_
)(A1
, A2
);
119 // __fastcall Function: Arity 2.
120 template <typename R
, typename A1
, typename A2
>
121 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
)> {
123 typedef R (RunType
)(A1
, A2
);
125 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
))
126 : function_(function
) {
129 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
130 typename CallbackParamTraits
<A2
>::ForwardType a2
) {
131 return function_(a1
, a2
);
135 R (__fastcall
*function_
)(A1
, A2
);
138 // __stdcall Function: Arity 3.
139 template <typename R
, typename A1
, typename A2
, typename A3
>
140 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
)> {
142 typedef R (RunType
)(A1
, A2
, A3
);
144 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
))
145 : function_(function
) {
148 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
149 typename CallbackParamTraits
<A2
>::ForwardType a2
,
150 typename CallbackParamTraits
<A3
>::ForwardType a3
) {
151 return function_(a1
, a2
, a3
);
155 R (__stdcall
*function_
)(A1
, A2
, A3
);
158 // __fastcall Function: Arity 3.
159 template <typename R
, typename A1
, typename A2
, typename A3
>
160 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
)> {
162 typedef R (RunType
)(A1
, A2
, A3
);
164 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
))
165 : function_(function
) {
168 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
169 typename CallbackParamTraits
<A2
>::ForwardType a2
,
170 typename CallbackParamTraits
<A3
>::ForwardType a3
) {
171 return function_(a1
, a2
, a3
);
175 R (__fastcall
*function_
)(A1
, A2
, A3
);
178 // __stdcall Function: Arity 4.
179 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
>
180 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
)> {
182 typedef R (RunType
)(A1
, A2
, A3
, A4
);
184 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
))
185 : function_(function
) {
188 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
189 typename CallbackParamTraits
<A2
>::ForwardType a2
,
190 typename CallbackParamTraits
<A3
>::ForwardType a3
,
191 typename CallbackParamTraits
<A4
>::ForwardType a4
) {
192 return function_(a1
, a2
, a3
, a4
);
196 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
);
199 // __fastcall Function: Arity 4.
200 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
>
201 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
)> {
203 typedef R (RunType
)(A1
, A2
, A3
, A4
);
205 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
))
206 : function_(function
) {
209 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
210 typename CallbackParamTraits
<A2
>::ForwardType a2
,
211 typename CallbackParamTraits
<A3
>::ForwardType a3
,
212 typename CallbackParamTraits
<A4
>::ForwardType a4
) {
213 return function_(a1
, a2
, a3
, a4
);
217 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
);
220 // __stdcall Function: Arity 5.
221 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
223 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
, A5
)> {
225 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
);
227 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
, A5
))
228 : function_(function
) {
231 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
232 typename CallbackParamTraits
<A2
>::ForwardType a2
,
233 typename CallbackParamTraits
<A3
>::ForwardType a3
,
234 typename CallbackParamTraits
<A4
>::ForwardType a4
,
235 typename CallbackParamTraits
<A5
>::ForwardType a5
) {
236 return function_(a1
, a2
, a3
, a4
, a5
);
240 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
, A5
);
243 // __fastcall Function: Arity 5.
244 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
246 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
, A5
)> {
248 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
);
250 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
, A5
))
251 : function_(function
) {
254 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
255 typename CallbackParamTraits
<A2
>::ForwardType a2
,
256 typename CallbackParamTraits
<A3
>::ForwardType a3
,
257 typename CallbackParamTraits
<A4
>::ForwardType a4
,
258 typename CallbackParamTraits
<A5
>::ForwardType a5
) {
259 return function_(a1
, a2
, a3
, a4
, a5
);
263 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
, A5
);
266 // __stdcall Function: Arity 6.
267 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
268 typename A5
, typename A6
>
269 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
, A5
, A6
)> {
271 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
);
273 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
))
274 : function_(function
) {
277 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
278 typename CallbackParamTraits
<A2
>::ForwardType a2
,
279 typename CallbackParamTraits
<A3
>::ForwardType a3
,
280 typename CallbackParamTraits
<A4
>::ForwardType a4
,
281 typename CallbackParamTraits
<A5
>::ForwardType a5
,
282 typename CallbackParamTraits
<A6
>::ForwardType a6
) {
283 return function_(a1
, a2
, a3
, a4
, a5
, a6
);
287 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
);
290 // __fastcall Function: Arity 6.
291 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
292 typename A5
, typename A6
>
293 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
, A5
, A6
)> {
295 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
);
297 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
))
298 : function_(function
) {
301 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
302 typename CallbackParamTraits
<A2
>::ForwardType a2
,
303 typename CallbackParamTraits
<A3
>::ForwardType a3
,
304 typename CallbackParamTraits
<A4
>::ForwardType a4
,
305 typename CallbackParamTraits
<A5
>::ForwardType a5
,
306 typename CallbackParamTraits
<A6
>::ForwardType a6
) {
307 return function_(a1
, a2
, a3
, a4
, a5
, a6
);
311 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
);
314 // __stdcall Function: Arity 7.
315 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
316 typename A5
, typename A6
, typename A7
>
317 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
, A5
, A6
, A7
)> {
319 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
321 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
))
322 : function_(function
) {
325 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
326 typename CallbackParamTraits
<A2
>::ForwardType a2
,
327 typename CallbackParamTraits
<A3
>::ForwardType a3
,
328 typename CallbackParamTraits
<A4
>::ForwardType a4
,
329 typename CallbackParamTraits
<A5
>::ForwardType a5
,
330 typename CallbackParamTraits
<A6
>::ForwardType a6
,
331 typename CallbackParamTraits
<A7
>::ForwardType a7
) {
332 return function_(a1
, a2
, a3
, a4
, a5
, a6
, a7
);
336 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
339 // __fastcall Function: Arity 7.
340 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
341 typename A5
, typename A6
, typename A7
>
342 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
, A5
, A6
, A7
)> {
344 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
346 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
))
347 : function_(function
) {
350 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
351 typename CallbackParamTraits
<A2
>::ForwardType a2
,
352 typename CallbackParamTraits
<A3
>::ForwardType a3
,
353 typename CallbackParamTraits
<A4
>::ForwardType a4
,
354 typename CallbackParamTraits
<A5
>::ForwardType a5
,
355 typename CallbackParamTraits
<A6
>::ForwardType a6
,
356 typename CallbackParamTraits
<A7
>::ForwardType a7
) {
357 return function_(a1
, a2
, a3
, a4
, a5
, a6
, a7
);
361 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
364 } // namespace internal
367 #endif // !defined(ARCH_CPU_X86_64)
369 #endif // BASE_BIND_INTERNAL_WIN_H_