OLD | NEW |
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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 $for M_UNBOUND_ARG , [[x$(M_UNBOUND_ARG)]]); | 259 $for M_UNBOUND_ARG , [[x$(M_UNBOUND_ARG)]]); |
260 } | 260 } |
261 }; | 261 }; |
262 | 262 |
263 ]] $$ if BOUND | 263 ]] $$ if BOUND |
264 | 264 |
265 ]] $$ if UNBOUND | 265 ]] $$ if UNBOUND |
266 ]] $$ for ARITY | 266 ]] $$ for ARITY |
267 ]] $$ for BOUND | 267 ]] $$ for BOUND |
268 | 268 |
| 269 // BindMoreFuncN<> |
| 270 // |
| 271 // This set of functions help in fully binding the free parameters in a |
| 272 // Callback<>. |
| 273 $for BOUND [[ |
| 274 $range BOUND_ARG 1..BOUND |
| 275 $if BOUND != 0 [[ |
| 276 |
| 277 template <typename Sig, $for BOUND_ARG , [[typename P$(BOUND_ARG)]]> |
| 278 void BindMoreFunc$(BOUND)(const base::Callback<Sig>& callback, [[]] |
| 279 $for BOUND_ARG , [[const P$(BOUND_ARG)& p$(BOUND_ARG)]]) { |
| 280 callback.Run($for BOUND_ARG , [[p$(BOUND_ARG)]]); |
| 281 } |
| 282 |
| 283 ]] $$ if BOUND |
| 284 ]] $$ for BOUND |
| 285 |
269 // InvokerStorageN<> | 286 // InvokerStorageN<> |
270 // | 287 // |
271 // These are the actual storage classes for the Invokers. | 288 // These are the actual storage classes for the Invokers. |
272 // | 289 // |
273 // Though these types are "classes", they are being used as structs with | 290 // Though these types are "classes", they are being used as structs with |
274 // all member variable public. We cannot make it a struct because it inherits | 291 // all member variable public. We cannot make it a struct because it inherits |
275 // from a class which causes a compiler warning. We cannot add a "Run()" method | 292 // from a class which causes a compiler warning. We cannot add a "Run()" method |
276 // that forwards the unbound arguments because that would require we unwrap the | 293 // that forwards the unbound arguments because that would require we unwrap the |
277 // Sig type like in InvokerN above to know the return type, and the arity | 294 // Sig type like in InvokerN above to know the return type, and the arity |
278 // of Run(). | 295 // of Run(). |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 389 |
373 ]] | 390 ]] |
374 }; | 391 }; |
375 | 392 |
376 ]] $$ for BOUND | 393 ]] $$ for BOUND |
377 | 394 |
378 } // namespace internal | 395 } // namespace internal |
379 } // namespace base | 396 } // namespace base |
380 | 397 |
381 #endif // BASE_BIND_INTERNAL_H_ | 398 #endif // BASE_BIND_INTERNAL_H_ |
OLD | NEW |