Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
| 2 // pump.py bind_internal.h.pump | 2 // pump.py bind_internal.h.pump |
| 3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
| 4 | 4 |
| 5 | 5 |
| 6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 7 // Use of this source code is governed by a BSD-style license that can be |
| 8 // found in the LICENSE file. | 8 // found in the LICENSE file. |
| 9 | 9 |
| 10 #ifndef BASE_BIND_INTERNAL_H_ | 10 #ifndef BASE_BIND_INTERNAL_H_ |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 // | 60 // |
| 61 // By normalizing the function signature, we reduce function_type to exactly 2. | 61 // By normalizing the function signature, we reduce function_type to exactly 2. |
| 62 | 62 |
| 63 template <typename Sig> | 63 template <typename Sig> |
| 64 struct FunctionTraits; | 64 struct FunctionTraits; |
| 65 | 65 |
| 66 // Function: Arity 0. | 66 // Function: Arity 0. |
| 67 template <typename R> | 67 template <typename R> |
| 68 struct FunctionTraits<R(*)()> { | 68 struct FunctionTraits<R(*)()> { |
| 69 typedef R (*NormalizedSig)(); | 69 typedef R (*NormalizedSig)(); |
| 70 typedef base::false_type IsMethod; | 70 typedef false_type IsMethod; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // Method: Arity 0. | 73 // Method: Arity 0. |
| 74 template <typename R, typename T> | 74 template <typename R, typename T> |
| 75 struct FunctionTraits<R(T::*)()> { | 75 struct FunctionTraits<R(T::*)()> { |
| 76 typedef R (T::*NormalizedSig)(); | 76 typedef R (T::*NormalizedSig)(); |
| 77 typedef base::true_type IsMethod; | 77 typedef true_type IsMethod; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 // Const Method: Arity 0. | 80 // Const Method: Arity 0. |
| 81 template <typename R, typename T> | 81 template <typename R, typename T> |
| 82 struct FunctionTraits<R(T::*)() const> { | 82 struct FunctionTraits<R(T::*)() const> { |
| 83 typedef R (T::*NormalizedSig)(); | 83 typedef R (T::*NormalizedSig)(); |
| 84 typedef base::true_type IsMethod; | 84 typedef true_type IsMethod; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 // Function: Arity 1. | 87 // Function: Arity 1. |
| 88 template <typename R, typename X1> | 88 template <typename R, typename X1> |
| 89 struct FunctionTraits<R(*)(X1)> { | 89 struct FunctionTraits<R(*)(X1)> { |
| 90 typedef R (*NormalizedSig)(X1); | 90 typedef R (*NormalizedSig)(X1); |
| 91 typedef base::false_type IsMethod; | 91 typedef false_type IsMethod; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 // Method: Arity 1. | 94 // Method: Arity 1. |
| 95 template <typename R, typename T, typename X1> | 95 template <typename R, typename T, typename X1> |
| 96 struct FunctionTraits<R(T::*)(X1)> { | 96 struct FunctionTraits<R(T::*)(X1)> { |
| 97 typedef R (T::*NormalizedSig)(X1); | 97 typedef R (T::*NormalizedSig)(X1); |
| 98 typedef base::true_type IsMethod; | 98 typedef true_type IsMethod; |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 // Const Method: Arity 1. | 101 // Const Method: Arity 1. |
| 102 template <typename R, typename T, typename X1> | 102 template <typename R, typename T, typename X1> |
| 103 struct FunctionTraits<R(T::*)(X1) const> { | 103 struct FunctionTraits<R(T::*)(X1) const> { |
| 104 typedef R (T::*NormalizedSig)(X1); | 104 typedef R (T::*NormalizedSig)(X1); |
| 105 typedef base::true_type IsMethod; | 105 typedef true_type IsMethod; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 // Function: Arity 2. | 108 // Function: Arity 2. |
| 109 template <typename R, typename X1, typename X2> | 109 template <typename R, typename X1, typename X2> |
| 110 struct FunctionTraits<R(*)(X1, X2)> { | 110 struct FunctionTraits<R(*)(X1, X2)> { |
| 111 typedef R (*NormalizedSig)(X1, X2); | 111 typedef R (*NormalizedSig)(X1, X2); |
| 112 typedef base::false_type IsMethod; | 112 typedef false_type IsMethod; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 // Method: Arity 2. | 115 // Method: Arity 2. |
| 116 template <typename R, typename T, typename X1, typename X2> | 116 template <typename R, typename T, typename X1, typename X2> |
| 117 struct FunctionTraits<R(T::*)(X1, X2)> { | 117 struct FunctionTraits<R(T::*)(X1, X2)> { |
| 118 typedef R (T::*NormalizedSig)(X1, X2); | 118 typedef R (T::*NormalizedSig)(X1, X2); |
| 119 typedef base::true_type IsMethod; | 119 typedef true_type IsMethod; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 // Const Method: Arity 2. | 122 // Const Method: Arity 2. |
| 123 template <typename R, typename T, typename X1, typename X2> | 123 template <typename R, typename T, typename X1, typename X2> |
| 124 struct FunctionTraits<R(T::*)(X1, X2) const> { | 124 struct FunctionTraits<R(T::*)(X1, X2) const> { |
| 125 typedef R (T::*NormalizedSig)(X1, X2); | 125 typedef R (T::*NormalizedSig)(X1, X2); |
| 126 typedef base::true_type IsMethod; | 126 typedef true_type IsMethod; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 // Function: Arity 3. | 129 // Function: Arity 3. |
| 130 template <typename R, typename X1, typename X2, typename X3> | 130 template <typename R, typename X1, typename X2, typename X3> |
| 131 struct FunctionTraits<R(*)(X1, X2, X3)> { | 131 struct FunctionTraits<R(*)(X1, X2, X3)> { |
| 132 typedef R (*NormalizedSig)(X1, X2, X3); | 132 typedef R (*NormalizedSig)(X1, X2, X3); |
| 133 typedef base::false_type IsMethod; | 133 typedef false_type IsMethod; |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 // Method: Arity 3. | 136 // Method: Arity 3. |
| 137 template <typename R, typename T, typename X1, typename X2, typename X3> | 137 template <typename R, typename T, typename X1, typename X2, typename X3> |
| 138 struct FunctionTraits<R(T::*)(X1, X2, X3)> { | 138 struct FunctionTraits<R(T::*)(X1, X2, X3)> { |
| 139 typedef R (T::*NormalizedSig)(X1, X2, X3); | 139 typedef R (T::*NormalizedSig)(X1, X2, X3); |
| 140 typedef base::true_type IsMethod; | 140 typedef true_type IsMethod; |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 // Const Method: Arity 3. | 143 // Const Method: Arity 3. |
| 144 template <typename R, typename T, typename X1, typename X2, typename X3> | 144 template <typename R, typename T, typename X1, typename X2, typename X3> |
| 145 struct FunctionTraits<R(T::*)(X1, X2, X3) const> { | 145 struct FunctionTraits<R(T::*)(X1, X2, X3) const> { |
| 146 typedef R (T::*NormalizedSig)(X1, X2, X3); | 146 typedef R (T::*NormalizedSig)(X1, X2, X3); |
| 147 typedef base::true_type IsMethod; | 147 typedef true_type IsMethod; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 // Function: Arity 4. | 150 // Function: Arity 4. |
| 151 template <typename R, typename X1, typename X2, typename X3, typename X4> | 151 template <typename R, typename X1, typename X2, typename X3, typename X4> |
| 152 struct FunctionTraits<R(*)(X1, X2, X3, X4)> { | 152 struct FunctionTraits<R(*)(X1, X2, X3, X4)> { |
| 153 typedef R (*NormalizedSig)(X1, X2, X3, X4); | 153 typedef R (*NormalizedSig)(X1, X2, X3, X4); |
| 154 typedef base::false_type IsMethod; | 154 typedef false_type IsMethod; |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 // Method: Arity 4. | 157 // Method: Arity 4. |
| 158 template <typename R, typename T, typename X1, typename X2, typename X3, | 158 template <typename R, typename T, typename X1, typename X2, typename X3, |
| 159 typename X4> | 159 typename X4> |
| 160 struct FunctionTraits<R(T::*)(X1, X2, X3, X4)> { | 160 struct FunctionTraits<R(T::*)(X1, X2, X3, X4)> { |
| 161 typedef R (T::*NormalizedSig)(X1, X2, X3, X4); | 161 typedef R (T::*NormalizedSig)(X1, X2, X3, X4); |
| 162 typedef base::true_type IsMethod; | 162 typedef true_type IsMethod; |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 // Const Method: Arity 4. | 165 // Const Method: Arity 4. |
| 166 template <typename R, typename T, typename X1, typename X2, typename X3, | 166 template <typename R, typename T, typename X1, typename X2, typename X3, |
| 167 typename X4> | 167 typename X4> |
| 168 struct FunctionTraits<R(T::*)(X1, X2, X3, X4) const> { | 168 struct FunctionTraits<R(T::*)(X1, X2, X3, X4) const> { |
| 169 typedef R (T::*NormalizedSig)(X1, X2, X3, X4); | 169 typedef R (T::*NormalizedSig)(X1, X2, X3, X4); |
| 170 typedef base::true_type IsMethod; | 170 typedef true_type IsMethod; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 // Function: Arity 5. | 173 // Function: Arity 5. |
| 174 template <typename R, typename X1, typename X2, typename X3, typename X4, | 174 template <typename R, typename X1, typename X2, typename X3, typename X4, |
| 175 typename X5> | 175 typename X5> |
| 176 struct FunctionTraits<R(*)(X1, X2, X3, X4, X5)> { | 176 struct FunctionTraits<R(*)(X1, X2, X3, X4, X5)> { |
| 177 typedef R (*NormalizedSig)(X1, X2, X3, X4, X5); | 177 typedef R (*NormalizedSig)(X1, X2, X3, X4, X5); |
| 178 typedef base::false_type IsMethod; | 178 typedef false_type IsMethod; |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 // Method: Arity 5. | 181 // Method: Arity 5. |
| 182 template <typename R, typename T, typename X1, typename X2, typename X3, | 182 template <typename R, typename T, typename X1, typename X2, typename X3, |
| 183 typename X4, typename X5> | 183 typename X4, typename X5> |
| 184 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5)> { | 184 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5)> { |
| 185 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5); | 185 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5); |
| 186 typedef base::true_type IsMethod; | 186 typedef true_type IsMethod; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 // Const Method: Arity 5. | 189 // Const Method: Arity 5. |
| 190 template <typename R, typename T, typename X1, typename X2, typename X3, | 190 template <typename R, typename T, typename X1, typename X2, typename X3, |
| 191 typename X4, typename X5> | 191 typename X4, typename X5> |
| 192 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5) const> { | 192 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5) const> { |
| 193 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5); | 193 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5); |
| 194 typedef base::true_type IsMethod; | 194 typedef true_type IsMethod; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 // Function: Arity 6. | 197 // Function: Arity 6. |
| 198 template <typename R, typename X1, typename X2, typename X3, typename X4, | 198 template <typename R, typename X1, typename X2, typename X3, typename X4, |
| 199 typename X5, typename X6> | 199 typename X5, typename X6> |
| 200 struct FunctionTraits<R(*)(X1, X2, X3, X4, X5, X6)> { | 200 struct FunctionTraits<R(*)(X1, X2, X3, X4, X5, X6)> { |
| 201 typedef R (*NormalizedSig)(X1, X2, X3, X4, X5, X6); | 201 typedef R (*NormalizedSig)(X1, X2, X3, X4, X5, X6); |
| 202 typedef base::false_type IsMethod; | 202 typedef false_type IsMethod; |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 // Method: Arity 6. | 205 // Method: Arity 6. |
| 206 template <typename R, typename T, typename X1, typename X2, typename X3, | 206 template <typename R, typename T, typename X1, typename X2, typename X3, |
| 207 typename X4, typename X5, typename X6> | 207 typename X4, typename X5, typename X6> |
| 208 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5, X6)> { | 208 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5, X6)> { |
| 209 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5, X6); | 209 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5, X6); |
| 210 typedef base::true_type IsMethod; | 210 typedef true_type IsMethod; |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 // Const Method: Arity 6. | 213 // Const Method: Arity 6. |
| 214 template <typename R, typename T, typename X1, typename X2, typename X3, | 214 template <typename R, typename T, typename X1, typename X2, typename X3, |
| 215 typename X4, typename X5, typename X6> | 215 typename X4, typename X5, typename X6> |
| 216 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5, X6) const> { | 216 struct FunctionTraits<R(T::*)(X1, X2, X3, X4, X5, X6) const> { |
| 217 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5, X6); | 217 typedef R (T::*NormalizedSig)(X1, X2, X3, X4, X5, X6); |
| 218 typedef base::true_type IsMethod; | 218 typedef true_type IsMethod; |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 #if defined(OS_WIN) | |
|
willchan no longer on Chromium
2011/02/24 08:00:30
Won't this include it within the base::internal na
awong
2011/02/25 02:07:52
Whoa...crap...yes it does. I have no clue how thi
| |
| 222 #include "base/bind_internal_win.h" | |
| 223 #endif | |
| 224 | |
| 221 // InvokerN<> | 225 // InvokerN<> |
| 222 // | 226 // |
| 223 // The InvokerN templates contain a static DoInvoke() function that is the key | 227 // The InvokerN templates contain a static DoInvoke() function that is the key |
| 224 // to implementing type erasure in the Callback() classes. | 228 // to implementing type erasure in the Callback() classes. |
| 225 // | 229 // |
| 226 // DoInvoke() is a static function with a fixed signature that is independent | 230 // DoInvoke() is a static function with a fixed signature that is independent |
| 227 // of StorageType; its first argument is a pointer to the non-templated common | 231 // of StorageType; its first argument is a pointer to the non-templated common |
| 228 // baseclass of StorageType. This lets us store pointer to DoInvoke() in a | 232 // baseclass of StorageType. This lets us store pointer to DoInvoke() in a |
| 229 // function pointer that has knowledge of the specific StorageType, and thus | 233 // function pointer that has knowledge of the specific StorageType, and thus |
| 230 // no knowledge of the bound function and bound parameter types. | 234 // no knowledge of the bound function and bound parameter types. |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1378 typename BindType<P3>::StorageType p3_; | 1382 typename BindType<P3>::StorageType p3_; |
| 1379 typename BindType<P4>::StorageType p4_; | 1383 typename BindType<P4>::StorageType p4_; |
| 1380 typename BindType<P5>::StorageType p5_; | 1384 typename BindType<P5>::StorageType p5_; |
| 1381 typename BindType<P6>::StorageType p6_; | 1385 typename BindType<P6>::StorageType p6_; |
| 1382 }; | 1386 }; |
| 1383 | 1387 |
| 1384 } // namespace internal | 1388 } // namespace internal |
| 1385 } // namespace base | 1389 } // namespace base |
| 1386 | 1390 |
| 1387 #endif // BASE_BIND_INTERNAL_H_ | 1391 #endif // BASE_BIND_INTERNAL_H_ |
| OLD | NEW |