| 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 $$ See comment for MAX_ARITY in base/bind.h.pump. | 8 $$ See comment for MAX_ARITY in base/bind.h.pump. |
| 9 $var MAX_ARITY = 7 | 9 $var MAX_ARITY = 7 |
| 10 | 10 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 | 285 |
| 286 R Run($for ARG , | 286 R Run($for ARG , |
| 287 [[typename internal::CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]
) const { | 287 [[typename internal::CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]
) const { |
| 288 PolymorphicInvoke f = | 288 PolymorphicInvoke f = |
| 289 reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 289 reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
| 290 | 290 |
| 291 return f(bind_state_.get()[[]] | 291 return f(bind_state_.get()[[]] |
| 292 $if ARITY != 0 [[, ]] | 292 $if ARITY != 0 [[, ]] |
| 293 $for ARG , | 293 $for ARG , |
| 294 [[internal::CallbackForward(a$(ARG))]]); | 294 [[a$(ARG)]]); |
| 295 } | 295 } |
| 296 | 296 |
| 297 private: | 297 private: |
| 298 typedef R(*PolymorphicInvoke)( | 298 typedef R(*PolymorphicInvoke)( |
| 299 internal::BindStateBase*[[]] | 299 internal::BindStateBase*[[]] |
| 300 $if ARITY != 0 [[, ]] | 300 $if ARITY != 0 [[, ]] |
| 301 $for ARG , [[typename internal::CallbackParamTraits<A$(ARG)>::ForwardType]]); | 301 $for ARG , [[typename internal::CallbackParamTraits<A$(ARG)>::ForwardType]]); |
| 302 | 302 |
| 303 }; | 303 }; |
| 304 | 304 |
| 305 | 305 |
| 306 ]] $$ for ARITY | 306 ]] $$ for ARITY |
| 307 | 307 |
| 308 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it | 308 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it |
| 309 // will be used in a lot of APIs with delayed execution. | 309 // will be used in a lot of APIs with delayed execution. |
| 310 typedef Callback<void(void)> Closure; | 310 typedef Callback<void(void)> Closure; |
| 311 | 311 |
| 312 } // namespace base | 312 } // namespace base |
| 313 | 313 |
| 314 #endif // BASE_CALLBACK_H | 314 #endif // BASE_CALLBACK_H |
| OLD | NEW |