| 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 10 matching lines...) Expand all Loading... |
| 21 // New, super-duper, unified Callback system. This will eventually replace | 21 // New, super-duper, unified Callback system. This will eventually replace |
| 22 // NewRunnableMethod, NewRunnableFunction, CreateFunctor, and CreateCallback | 22 // NewRunnableMethod, NewRunnableFunction, CreateFunctor, and CreateCallback |
| 23 // systems currently in the Chromium code base. | 23 // systems currently in the Chromium code base. |
| 24 // | 24 // |
| 25 // WHAT IS THIS: | 25 // WHAT IS THIS: |
| 26 // | 26 // |
| 27 // The templated Callback class is a generalized function object. Together | 27 // The templated Callback class is a generalized function object. Together |
| 28 // with the Bind() function in bind.h, they provide a type-safe method for | 28 // with the Bind() function in bind.h, they provide a type-safe method for |
| 29 // performing currying of arguments, and creating a "closure." | 29 // performing currying of arguments, and creating a "closure." |
| 30 // | 30 // |
| 31 // In programing languages, a closure is a first-class function where all its | 31 // In programming languages, a closure is a first-class function where all its |
| 32 // parameters have been bound (usually via currying). Closures are well | 32 // parameters have been bound (usually via currying). Closures are well |
| 33 // suited for representing, and passing around a unit of delayed execution. | 33 // suited for representing, and passing around a unit of delayed execution. |
| 34 // They are used in Chromium code to schedule tasks on different MessageLoops. | 34 // They are used in Chromium code to schedule tasks on different MessageLoops. |
| 35 // | 35 // |
| 36 // | 36 // |
| 37 // MEMORY MANAGEMENT AND PASSING | 37 // MEMORY MANAGEMENT AND PASSING |
| 38 // | 38 // |
| 39 // The Callback objects themselves should be passed by const-reference, and | 39 // The Callback objects themselves should be passed by const-reference, and |
| 40 // stored by copy. They internally store their state via a refcounted class | 40 // stored by copy. They internally store their state via a refcounted class |
| 41 // and thus do not need to be deleted. | 41 // and thus do not need to be deleted. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 ]] $$ for ARITY | 294 ]] $$ for ARITY |
| 295 | 295 |
| 296 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it | 296 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it |
| 297 // will be used in a lot of APIs with delayed execution. | 297 // will be used in a lot of APIs with delayed execution. |
| 298 typedef Callback<void(void)> Closure; | 298 typedef Callback<void(void)> Closure; |
| 299 | 299 |
| 300 } // namespace base | 300 } // namespace base |
| 301 | 301 |
| 302 #endif // BASE_CALLBACK_H | 302 #endif // BASE_CALLBACK_H |
| OLD | NEW |