OLD | NEW |
1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
2 // pump.py bind.h.pump | 2 // pump.py bind.h.pump |
3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
4 | 4 |
5 | 5 |
| 6 |
6 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 7 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
7 // Use of this source code is governed by a BSD-style license that can be | 8 // Use of this source code is governed by a BSD-style license that can be |
8 // found in the LICENSE file. | 9 // found in the LICENSE file. |
9 | 10 |
10 #ifndef BASE_BIND_H_ | 11 #ifndef BASE_BIND_H_ |
11 #define BASE_BIND_H_ | 12 #define BASE_BIND_H_ |
12 #pragma once | 13 #pragma once |
13 | 14 |
14 #include "base/bind_internal.h" | 15 #include "base/bind_internal.h" |
15 #include "base/callback_internal.h" | 16 #include "base/callback_internal.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 typename P5, typename P6> | 88 typename P5, typename P6> |
88 internal::InvokerStorageHolder<internal::InvokerStorage6<Sig,P1, P2, P3, P4, | 89 internal::InvokerStorageHolder<internal::InvokerStorage6<Sig,P1, P2, P3, P4, |
89 P5, P6> > | 90 P5, P6> > |
90 Bind(Sig f, const P1& p1, const P2& p2, const P3& p3, const P4& p4, | 91 Bind(Sig f, const P1& p1, const P2& p2, const P3& p3, const P4& p4, |
91 const P5& p5, const P6& p6) { | 92 const P5& p5, const P6& p6) { |
92 return internal::MakeInvokerStorageHolder( | 93 return internal::MakeInvokerStorageHolder( |
93 new internal::InvokerStorage6<Sig, P1, P2, P3, P4, P5, P6>( | 94 new internal::InvokerStorage6<Sig, P1, P2, P3, P4, P5, P6>( |
94 f, p1, p2, p3, p4, p5, p6)); | 95 f, p1, p2, p3, p4, p5, p6)); |
95 } | 96 } |
96 | 97 |
| 98 // Specializations to allow binding all the free arguments in a |
| 99 // pre-existing base::Callback<>. This does not give full support for |
| 100 // currying, but is significantly simpler and addresses the use case |
| 101 // where a base::Callback<> needs to be invoked on another context/thread. |
| 102 template <typename Sig, typename P1> |
| 103 base::Closure Bind(const base::Callback<Sig>& callback, const P1& p1) { |
| 104 return base::Bind(&internal::BindMoreFunc1<Sig, P1>, callback, p1); |
| 105 } |
| 106 |
| 107 template <typename Sig, typename P1, typename P2> |
| 108 base::Closure Bind(const base::Callback<Sig>& callback, const P1& p1, |
| 109 const P2& p2) { |
| 110 return base::Bind(&internal::BindMoreFunc2<Sig, P1, P2>, callback, p1, p2); |
| 111 } |
| 112 |
| 113 template <typename Sig, typename P1, typename P2, typename P3> |
| 114 base::Closure Bind(const base::Callback<Sig>& callback, const P1& p1, |
| 115 const P2& p2, const P3& p3) { |
| 116 return base::Bind(&internal::BindMoreFunc3<Sig, P1, P2, P3>, callback, p1, |
| 117 p2, p3); |
| 118 } |
| 119 |
| 120 template <typename Sig, typename P1, typename P2, typename P3, typename P4> |
| 121 base::Closure Bind(const base::Callback<Sig>& callback, const P1& p1, |
| 122 const P2& p2, const P3& p3, const P4& p4) { |
| 123 return base::Bind(&internal::BindMoreFunc4<Sig, P1, P2, P3, P4>, callback, |
| 124 p1, p2, p3, p4); |
| 125 } |
| 126 |
| 127 template <typename Sig, typename P1, typename P2, typename P3, typename P4, |
| 128 typename P5> |
| 129 base::Closure Bind(const base::Callback<Sig>& callback, const P1& p1, |
| 130 const P2& p2, const P3& p3, const P4& p4, const P5& p5) { |
| 131 return base::Bind(&internal::BindMoreFunc5<Sig, P1, P2, P3, P4, P5>, |
| 132 callback, p1, p2, p3, p4, p5); |
| 133 } |
| 134 |
| 135 template <typename Sig, typename P1, typename P2, typename P3, typename P4, |
| 136 typename P5, typename P6> |
| 137 base::Closure Bind(const base::Callback<Sig>& callback, const P1& p1, |
| 138 const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6) { |
| 139 return base::Bind(&internal::BindMoreFunc6<Sig, P1, P2, P3, P4, P5, P6>, |
| 140 callback, p1, p2, p3, p4, p5, p6); |
| 141 } |
| 142 |
97 } // namespace base | 143 } // namespace base |
98 | 144 |
99 #endif // BASE_BIND_H_ | 145 #endif // BASE_BIND_H_ |
OLD | NEW |