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