OLD | NEW |
1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
2 // pump.py callback.h.pump | 2 // pump.py callback.h.pump |
3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
4 | 4 |
5 /* | 5 /* |
6 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 6 * Copyright 2012 The WebRTC Project Authors. All rights reserved. |
7 * | 7 * |
8 * Use of this source code is governed by a BSD-style license | 8 * Use of this source code is governed by a BSD-style license |
9 * that can be found in the LICENSE file in the root of the source | 9 * that can be found in the LICENSE file in the root of the source |
10 * tree. An additional intellectual property rights grant can be found | 10 * tree. An additional intellectual property rights grant can be found |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // my_callback = Callback1<int, int>(&sqr); | 52 // my_callback = Callback1<int, int>(&sqr); |
53 // cout << my_callback.empty() << endl; // false | 53 // cout << my_callback.empty() << endl; // false |
54 // cout << my_callback(3) << endl; // 9 | 54 // cout << my_callback(3) << endl; // 9 |
55 // | 55 // |
56 // my_callback = Callback1<int, int>(add_k); | 56 // my_callback = Callback1<int, int>(add_k); |
57 // cout << my_callback(10) << endl; // 15 | 57 // cout << my_callback(10) << endl; // 15 |
58 // | 58 // |
59 // my_callback = Callback1<int, int>(); | 59 // my_callback = Callback1<int, int>(); |
60 // cout << my_callback.empty() << endl; // true | 60 // cout << my_callback.empty() << endl; // true |
61 | 61 |
62 #ifndef WEBRTC_BASE_CALLBACK_H_ | 62 #ifndef WEBRTC_RTC_BASE_CALLBACK_H_ |
63 #define WEBRTC_BASE_CALLBACK_H_ | 63 #define WEBRTC_RTC_BASE_CALLBACK_H_ |
64 | 64 |
65 #include "webrtc/base/refcount.h" | 65 #include "webrtc/base/refcount.h" |
66 #include "webrtc/base/scoped_ref_ptr.h" | 66 #include "webrtc/base/scoped_ref_ptr.h" |
67 | 67 |
68 namespace rtc { | 68 namespace rtc { |
69 | 69 |
70 template <class R> | 70 template <class R> |
71 class Callback0 { | 71 class Callback0 { |
72 public: | 72 public: |
73 // Default copy operations are appropriate for this class. | 73 // Default copy operations are appropriate for this class. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 explicit HelperImpl(const T& functor) : functor_(functor) {} | 250 explicit HelperImpl(const T& functor) : functor_(functor) {} |
251 virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { | 251 virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { |
252 return functor_(p1, p2, p3, p4, p5); | 252 return functor_(p1, p2, p3, p4, p5); |
253 } | 253 } |
254 T functor_; | 254 T functor_; |
255 }; | 255 }; |
256 scoped_refptr<Helper> helper_; | 256 scoped_refptr<Helper> helper_; |
257 }; | 257 }; |
258 } // namespace rtc | 258 } // namespace rtc |
259 | 259 |
260 #endif // WEBRTC_BASE_CALLBACK_H_ | 260 #endif // WEBRTC_RTC_BASE_CALLBACK_H_ |
OLD | NEW |