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_
16 // 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)
24 template <typename Functor
>
25 class RunnableAdapter
;
27 // __stdcall Function: Arity 0.
29 class RunnableAdapter
<R(__stdcall
*)()> {
31 typedef R (RunType
)();
33 explicit RunnableAdapter(R(__stdcall
*function
)())
34 : function_(function
) {
42 R (__stdcall
*function_
)();
45 // __fastcall Function: Arity 0.
47 class RunnableAdapter
<R(__fastcall
*)()> {
49 typedef R (RunType
)();
51 explicit RunnableAdapter(R(__fastcall
*function
)())
52 : function_(function
) {
60 R (__fastcall
*function_
)();
63 // __stdcall Function: Arity 1.
64 template <typename R
, typename A1
>
65 class RunnableAdapter
<R(__stdcall
*)(A1
)> {
67 typedef R (RunType
)(A1
);
69 explicit RunnableAdapter(R(__stdcall
*function
)(A1
))
70 : function_(function
) {
73 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
) {
78 R (__stdcall
*function_
)(A1
);
81 // __fastcall Function: Arity 1.
82 template <typename R
, typename A1
>
83 class RunnableAdapter
<R(__fastcall
*)(A1
)> {
85 typedef R (RunType
)(A1
);
87 explicit RunnableAdapter(R(__fastcall
*function
)(A1
))
88 : function_(function
) {
91 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
) {
96 R (__fastcall
*function_
)(A1
);
99 // __stdcall Function: Arity 2.
100 template <typename R
, typename A1
, typename A2
>
101 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
)> {
103 typedef R (RunType
)(A1
, A2
);
105 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
))
106 : function_(function
) {
109 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
110 typename CallbackParamTraits
<A2
>::ForwardType a2
) {
111 return function_(a1
, a2
);
115 R (__stdcall
*function_
)(A1
, A2
);
118 // __fastcall Function: Arity 2.
119 template <typename R
, typename A1
, typename A2
>
120 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
)> {
122 typedef R (RunType
)(A1
, A2
);
124 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
))
125 : function_(function
) {
128 R
Run(typename CallbackParamTraits
<A1
>::ForwardType a1
,
129 typename CallbackParamTraits
<A2
>::ForwardType a2
) {
130 return function_(a1
, a2
);
134 R (__fastcall
*function_
)(A1
, A2
);
137 // __stdcall Function: Arity 3.
138 template <typename R
, typename A1
, typename A2
, typename A3
>
139 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
)> {
141 typedef R (RunType
)(A1
, A2
, A3
);
143 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
))
144 : function_(function
) {
147 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
);
154 R (__stdcall
*function_
)(A1
, A2
, A3
);
157 // __fastcall Function: Arity 3.
158 template <typename R
, typename A1
, typename A2
, typename A3
>
159 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
)> {
161 typedef R (RunType
)(A1
, A2
, A3
);
163 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
))
164 : function_(function
) {
167 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
);
174 R (__fastcall
*function_
)(A1
, A2
, A3
);
177 // __stdcall Function: Arity 4.
178 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
>
179 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
)> {
181 typedef R (RunType
)(A1
, A2
, A3
, A4
);
183 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
))
184 : function_(function
) {
187 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
);
195 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
);
198 // __fastcall Function: Arity 4.
199 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
>
200 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
)> {
202 typedef R (RunType
)(A1
, A2
, A3
, A4
);
204 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
))
205 : function_(function
) {
208 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
);
216 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
);
219 // __stdcall Function: Arity 5.
220 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
222 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
, A5
)> {
224 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
);
226 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
, A5
))
227 : function_(function
) {
230 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
);
239 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
, A5
);
242 // __fastcall Function: Arity 5.
243 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
245 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
, A5
)> {
247 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
);
249 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
, A5
))
250 : function_(function
) {
253 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
);
262 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
, A5
);
265 // __stdcall Function: Arity 6.
266 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
267 typename A5
, typename A6
>
268 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
, A5
, A6
)> {
270 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
);
272 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
))
273 : function_(function
) {
276 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
);
286 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
);
289 // __fastcall Function: Arity 6.
290 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
291 typename A5
, typename A6
>
292 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
, A5
, A6
)> {
294 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
);
296 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
))
297 : function_(function
) {
300 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
);
310 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
);
313 // __stdcall Function: Arity 7.
314 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
315 typename A5
, typename A6
, typename A7
>
316 class RunnableAdapter
<R(__stdcall
*)(A1
, A2
, A3
, A4
, A5
, A6
, A7
)> {
318 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
320 explicit RunnableAdapter(R(__stdcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
))
321 : function_(function
) {
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
);
335 R (__stdcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
338 // __fastcall Function: Arity 7.
339 template <typename R
, typename A1
, typename A2
, typename A3
, typename A4
,
340 typename A5
, typename A6
, typename A7
>
341 class RunnableAdapter
<R(__fastcall
*)(A1
, A2
, A3
, A4
, A5
, A6
, A7
)> {
343 typedef R (RunType
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
345 explicit RunnableAdapter(R(__fastcall
*function
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
))
346 : function_(function
) {
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
);
360 R (__fastcall
*function_
)(A1
, A2
, A3
, A4
, A5
, A6
, A7
);
363 } // namespace internal
366 #endif // !defined(ARCH_CPU_X86_64)
368 #endif // BASE_BIND_INTERNAL_WIN_H_