Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: base/bind_internal.h.pump

Issue 6561004: Callback support for __fastcall and __stdcall functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: endif Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 $$ This is a pump file for generating file templates. Pump is a python 1 $$ This is a pump file for generating file templates. Pump is a python
2 $$ script that is part of the Google Test suite of utilities. Description 2 $$ script that is part of the Google Test suite of utilities. Description
3 $$ can be found here: 3 $$ can be found here:
4 $$ 4 $$
5 $$ http://code.google.com/p/googletest/wiki/PumpManual 5 $$ http://code.google.com/p/googletest/wiki/PumpManual
6 $$ 6 $$
7 7
8 $var MAX_ARITY = 6 8 $var MAX_ARITY = 6
9 9
10 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 10 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 $range ARITY 0..MAX_ARITY 70 $range ARITY 0..MAX_ARITY
71 $for ARITY [[ 71 $for ARITY [[
72 $range ARG 1..ARITY 72 $range ARG 1..ARITY
73 73
74 // Function: Arity $(ARITY). 74 // Function: Arity $(ARITY).
75 template <typename R[[]] 75 template <typename R[[]]
76 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]> 76 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]>
77 struct FunctionTraits<R(*)($for ARG , [[X$(ARG)]])> { 77 struct FunctionTraits<R(*)($for ARG , [[X$(ARG)]])> {
78 typedef R (*NormalizedSig)($for ARG , [[X$(ARG)]]); 78 typedef R (*NormalizedSig)($for ARG , [[X$(ARG)]]);
79 typedef base::false_type IsMethod; 79 typedef false_type IsMethod;
80 }; 80 };
81 81
82 // Method: Arity $(ARITY). 82 // Method: Arity $(ARITY).
83 template <typename R, typename T[[]] 83 template <typename R, typename T[[]]
84 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]> 84 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]>
85 struct FunctionTraits<R(T::*)($for ARG , [[X$(ARG)]])> { 85 struct FunctionTraits<R(T::*)($for ARG , [[X$(ARG)]])> {
86 typedef R (T::*NormalizedSig)($for ARG , [[X$(ARG)]]); 86 typedef R (T::*NormalizedSig)($for ARG , [[X$(ARG)]]);
87 typedef base::true_type IsMethod; 87 typedef true_type IsMethod;
88 }; 88 };
89 89
90 // Const Method: Arity $(ARITY). 90 // Const Method: Arity $(ARITY).
91 template <typename R, typename T[[]] 91 template <typename R, typename T[[]]
92 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]> 92 $if ARITY > 0[[, ]] $for ARG , [[typename X$(ARG)]]>
93 struct FunctionTraits<R(T::*)($for ARG , [[X$(ARG)]]) const> { 93 struct FunctionTraits<R(T::*)($for ARG , [[X$(ARG)]]) const> {
94 typedef R (T::*NormalizedSig)($for ARG , [[X$(ARG)]]); 94 typedef R (T::*NormalizedSig)($for ARG , [[X$(ARG)]]);
95 typedef base::true_type IsMethod; 95 typedef true_type IsMethod;
96 }; 96 };
97 97
98 ]] $$for ARITY 98 ]] $$for ARITY
99 99
100 #if defined(OS_WIN)
101 #include "base/bind_internal_win.h"
102 #endif
103
100 // InvokerN<> 104 // InvokerN<>
101 // 105 //
102 // The InvokerN templates contain a static DoInvoke() function that is the key 106 // The InvokerN templates contain a static DoInvoke() function that is the key
103 // to implementing type erasure in the Callback() classes. 107 // to implementing type erasure in the Callback() classes.
104 // 108 //
105 // DoInvoke() is a static function with a fixed signature that is independent 109 // DoInvoke() is a static function with a fixed signature that is independent
106 // of StorageType; its first argument is a pointer to the non-templated common 110 // of StorageType; its first argument is a pointer to the non-templated common
107 // baseclass of StorageType. This lets us store pointer to DoInvoke() in a 111 // baseclass of StorageType. This lets us store pointer to DoInvoke() in a
108 // function pointer that has knowledge of the specific StorageType, and thus 112 // function pointer that has knowledge of the specific StorageType, and thus
109 // no knowledge of the bound function and bound parameter types. 113 // no knowledge of the bound function and bound parameter types.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 276
273 ]] 277 ]]
274 }; 278 };
275 279
276 ]] $$ for BOUND 280 ]] $$ for BOUND
277 281
278 } // namespace internal 282 } // namespace internal
279 } // namespace base 283 } // namespace base
280 284
281 #endif // BASE_BIND_INTERNAL_H_ 285 #endif // BASE_BIND_INTERNAL_H_
OLDNEW
« base/bind_internal.h ('K') | « base/bind_internal.h ('k') | base/bind_internal_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698