| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 // We pass InvokerStorageHolder by const ref to avoid incurring an | 250 // We pass InvokerStorageHolder by const ref to avoid incurring an |
| 251 // unnecessary AddRef/Unref pair even though we will modify the object. | 251 // unnecessary AddRef/Unref pair even though we will modify the object. |
| 252 // We cannot use a normal reference because the compiler will warn | 252 // We cannot use a normal reference because the compiler will warn |
| 253 // since this is often used on a return value, which is a temporary. | 253 // since this is often used on a return value, which is a temporary. |
| 254 // | 254 // |
| 255 // Note that this constructor CANNOT be explicit, and that Bind() CANNOT | 255 // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
| 256 // return the exact Callback<> type. See base/bind.h for details. | 256 // return the exact Callback<> type. See base/bind.h for details. |
| 257 template <typename T> | 257 template <typename T> |
| 258 Callback(const internal::InvokerStorageHolder<T>& invoker_holder) | 258 Callback(const internal::InvokerStorageHolder<T>& invoker_holder) |
| 259 : polymorphic_invoke_(&T::FunctionTraits::DoInvoke) { | 259 : polymorphic_invoke_(&T::Invoker::DoInvoke) { |
| 260 invoker_storage_.swap(invoker_holder.invoker_storage_); | 260 invoker_storage_.swap(invoker_holder.invoker_storage_); |
| 261 } | 261 } |
| 262 | 262 |
| 263 | 263 |
| 264 $if ARITY == 0 [[ | 264 $if ARITY == 0 [[ |
| 265 R Run(void) const { | 265 R Run(void) const { |
| 266 ]] $else [[ | 266 ]] $else [[ |
| 267 R Run($for ARG , | 267 R Run($for ARG , |
| 268 [[const A$(ARG)& a$(ARG)]]) const { | 268 [[const A$(ARG)& a$(ARG)]]) const { |
| 269 ]] | 269 ]] |
| (...skipping 12 matching lines...) Expand all Loading... |
| 282 | 282 |
| 283 ]] $$ for ARITY | 283 ]] $$ for ARITY |
| 284 | 284 |
| 285 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it | 285 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it |
| 286 // will be used in a lot of APIs with delayed execution. | 286 // will be used in a lot of APIs with delayed execution. |
| 287 typedef Callback<void(void)> Closure; | 287 typedef Callback<void(void)> Closure; |
| 288 | 288 |
| 289 } // namespace base | 289 } // namespace base |
| 290 | 290 |
| 291 #endif // BASE_CALLBACK_H | 291 #endif // BASE_CALLBACK_H |
| OLD | NEW |