/Users/deen/code/yugabyte-db/src/yb/gutil/callback.h
Line | Count | Source (jump to first uncovered line) |
1 | | // This file was GENERATED by command: |
2 | | // pump.py callback.h.pump |
3 | | // DO NOT EDIT BY HAND!!! |
4 | | |
5 | | |
6 | | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
7 | | // Use of this source code is governed by a BSD-style license that can be |
8 | | // found in the LICENSE file. |
9 | | // |
10 | | // The following only applies to changes made to this file as part of YugaByte development. |
11 | | // |
12 | | // Portions Copyright (c) YugaByte, Inc. |
13 | | // |
14 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
15 | | // in compliance with the License. You may obtain a copy of the License at |
16 | | // |
17 | | // http://www.apache.org/licenses/LICENSE-2.0 |
18 | | // |
19 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
20 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
21 | | // or implied. See the License for the specific language governing permissions and limitations |
22 | | // under the License. |
23 | | // |
24 | | |
25 | | #ifndef YB_GUTIL_CALLBACK_H_ |
26 | | #define YB_GUTIL_CALLBACK_H_ |
27 | | |
28 | | #include "yb/gutil/callback_forward.h" |
29 | | #include "yb/gutil/callback_internal.h" |
30 | | #include "yb/gutil/template_util.h" |
31 | | |
32 | | // NOTE: Header files that do not require the full definition of Callback or |
33 | | // Closure should #include "yb/gutil/callback_forward.h" instead of this file. |
34 | | |
35 | | // ----------------------------------------------------------------------------- |
36 | | // Introduction |
37 | | // ----------------------------------------------------------------------------- |
38 | | // |
39 | | // The templated Callback class is a generalized function object. Together |
40 | | // with the Bind() function in bind.h, they provide a type-safe method for |
41 | | // performing partial application of functions. |
42 | | // |
43 | | // Partial application (or "currying") is the process of binding a subset of |
44 | | // a function's arguments to produce another function that takes fewer |
45 | | // arguments. This can be used to pass around a unit of delayed execution, |
46 | | // much like lexical closures are used in other languages. For example, it |
47 | | // is used in Chromium code to schedule tasks on different MessageLoops. |
48 | | // |
49 | | // A callback with no unbound input parameters (yb::Callback<void(void)>) |
50 | | // is called a yb::Closure. Note that this is NOT the same as what other |
51 | | // languages refer to as a closure -- it does not retain a reference to its |
52 | | // enclosing environment. |
53 | | // |
54 | | // MEMORY MANAGEMENT AND PASSING |
55 | | // |
56 | | // The Callback objects themselves should be passed by const-reference, and |
57 | | // stored by copy. They internally store their state via a refcounted class |
58 | | // and thus do not need to be deleted. |
59 | | // |
60 | | // The reason to pass via a const-reference is to avoid unnecessary |
61 | | // AddRef/Release pairs to the internal state. |
62 | | // |
63 | | // |
64 | | // ----------------------------------------------------------------------------- |
65 | | // Quick reference for basic stuff |
66 | | // ----------------------------------------------------------------------------- |
67 | | // |
68 | | // BINDING A BARE FUNCTION |
69 | | // |
70 | | // int Return5() { return 5; } |
71 | | // yb::Callback<int(void)> func_cb = yb::Bind(&Return5); |
72 | | // LOG(INFO) << func_cb.Run(); // Prints 5. |
73 | | // |
74 | | // BINDING A CLASS METHOD |
75 | | // |
76 | | // The first argument to bind is the member function to call, the second is |
77 | | // the object on which to call it. |
78 | | // |
79 | | // class Ref : public yb::RefCountedThreadSafe<Ref> { |
80 | | // public: |
81 | | // int Foo() { return 3; } |
82 | | // void PrintBye() { LOG(INFO) << "bye."; } |
83 | | // }; |
84 | | // scoped_refptr<Ref> ref = new Ref(); |
85 | | // yb::Callback<void(void)> ref_cb = yb::Bind(&Ref::Foo, ref); |
86 | | // LOG(INFO) << ref_cb.Run(); // Prints out 3. |
87 | | // |
88 | | // By default the object must support RefCounted or you will get a compiler |
89 | | // error. If you're passing between threads, be sure it's |
90 | | // RefCountedThreadSafe! See "Advanced binding of member functions" below if |
91 | | // you don't want to use reference counting. |
92 | | // |
93 | | // RUNNING A CALLBACK |
94 | | // |
95 | | // Callbacks can be run with their "Run" method, which has the same |
96 | | // signature as the template argument to the callback. |
97 | | // |
98 | | // void DoSomething(const yb::Callback<void(int, std::string)>& callback) { |
99 | | // callback.Run(5, "hello"); |
100 | | // } |
101 | | // |
102 | | // Callbacks can be run more than once (they don't get deleted or marked when |
103 | | // run). However, this precludes using yb::Passed (see below). |
104 | | // |
105 | | // void DoSomething(const yb::Callback<double(double)>& callback) { |
106 | | // double myresult = callback.Run(3.14159); |
107 | | // myresult += callback.Run(2.71828); |
108 | | // } |
109 | | // |
110 | | // PASSING UNBOUND INPUT PARAMETERS |
111 | | // |
112 | | // Unbound parameters are specified at the time a callback is Run(). They are |
113 | | // specified in the Callback template type: |
114 | | // |
115 | | // void MyFunc(int i, const std::string& str) {} |
116 | | // yb::Callback<void(int, const std::string&)> cb = yb::Bind(&MyFunc); |
117 | | // cb.Run(23, "hello, world"); |
118 | | // |
119 | | // PASSING BOUND INPUT PARAMETERS |
120 | | // |
121 | | // Bound parameters are specified when you create the callback as arguments |
122 | | // to Bind(). They will be passed to the function and the Run()ner of the |
123 | | // callback doesn't see those values or even know that the function it's |
124 | | // calling. |
125 | | // |
126 | | // void MyFunc(int i, const std::string& str) {} |
127 | | // yb::Callback<void(void)> cb = yb::Bind(&MyFunc, 23, "hello world"); |
128 | | // cb.Run(); |
129 | | // |
130 | | // A callback with no unbound input parameters (yb::Callback<void(void)>) |
131 | | // is called a yb::Closure. So we could have also written: |
132 | | // |
133 | | // yb::Closure cb = yb::Bind(&MyFunc, 23, "hello world"); |
134 | | // |
135 | | // When calling member functions, bound parameters just go after the object |
136 | | // pointer. |
137 | | // |
138 | | // yb::Closure cb = yb::Bind(&MyClass::MyFunc, this, 23, "hello world"); |
139 | | // |
140 | | // PARTIAL BINDING OF PARAMETERS |
141 | | // |
142 | | // You can specify some parameters when you create the callback, and specify |
143 | | // the rest when you execute the callback. |
144 | | // |
145 | | // void MyFunc(int i, const std::string& str) {} |
146 | | // yb::Callback<void(const std::string&)> cb = yb::Bind(&MyFunc, 23); |
147 | | // cb.Run("hello world"); |
148 | | // |
149 | | // When calling a function bound parameters are first, followed by unbound |
150 | | // parameters. |
151 | | // |
152 | | // |
153 | | // ----------------------------------------------------------------------------- |
154 | | // Quick reference for advanced binding |
155 | | // ----------------------------------------------------------------------------- |
156 | | // |
157 | | // BINDING A CLASS METHOD WITH WEAK POINTERS |
158 | | // |
159 | | // yb::Bind(&MyClass::Foo, GetWeakPtr()); |
160 | | // |
161 | | // The callback will not be issued if the object is destroyed at the time |
162 | | // it's issued. DANGER: weak pointers are not threadsafe, so don't use this |
163 | | // when passing between threads! |
164 | | // |
165 | | // BINDING A CLASS METHOD WITH MANUAL LIFETIME MANAGEMENT |
166 | | // |
167 | | // yb::Bind(&MyClass::Foo, yb::Unretained(this)); |
168 | | // |
169 | | // This disables all lifetime management on the object. You're responsible |
170 | | // for making sure the object is alive at the time of the call. You break it, |
171 | | // you own it! |
172 | | // |
173 | | // BINDING A CLASS METHOD AND HAVING THE CALLBACK OWN THE CLASS |
174 | | // |
175 | | // MyClass* myclass = new MyClass; |
176 | | // yb::Bind(&MyClass::Foo, yb::Owned(myclass)); |
177 | | // |
178 | | // The object will be deleted when the callback is destroyed, even if it's |
179 | | // not run (like if you post a task during shutdown). Potentially useful for |
180 | | // "fire and forget" cases. |
181 | | // |
182 | | // IGNORING RETURN VALUES |
183 | | // |
184 | | // Sometimes you want to call a function that returns a value in a callback |
185 | | // that doesn't expect a return value. |
186 | | // |
187 | | // int DoSomething(int arg) { cout << arg << endl; } |
188 | | // yb::Callback<void<int>) cb = |
189 | | // yb::Bind(yb::IgnoreResult(&DoSomething)); |
190 | | // |
191 | | // |
192 | | // ----------------------------------------------------------------------------- |
193 | | // Quick reference for binding parameters to Bind() |
194 | | // ----------------------------------------------------------------------------- |
195 | | // |
196 | | // Bound parameters are specified as arguments to Bind() and are passed to the |
197 | | // function. A callback with no parameters or no unbound parameters is called a |
198 | | // Closure (yb::Callback<void(void)> and yb::Closure are the same thing). |
199 | | // |
200 | | // PASSING PARAMETERS OWNED BY THE CALLBACK |
201 | | // |
202 | | // void Foo(int* arg) { cout << *arg << endl; } |
203 | | // int* pn = new int(1); |
204 | | // yb::Closure foo_callback = yb::Bind(&foo, yb::Owned(pn)); |
205 | | // |
206 | | // The parameter will be deleted when the callback is destroyed, even if it's |
207 | | // not run (like if you post a task during shutdown). |
208 | | // |
209 | | // PASSING PARAMETERS AS A scoped_ptr |
210 | | // |
211 | | // void TakesOwnership(scoped_ptr<Foo> arg) {} |
212 | | // scoped_ptr<Foo> f(new Foo); |
213 | | // // f becomes null during the following call. |
214 | | // yb::Closure cb = yb::Bind(&TakesOwnership, yb::Passed(&f)); |
215 | | // |
216 | | // Ownership of the parameter will be with the callback until the it is run, |
217 | | // when ownership is passed to the callback function. This means the callback |
218 | | // can only be run once. If the callback is never run, it will delete the |
219 | | // object when it's destroyed. |
220 | | // |
221 | | // PASSING PARAMETERS AS A scoped_refptr |
222 | | // |
223 | | // void TakesOneRef(scoped_refptr<Foo> arg) {} |
224 | | // scoped_refptr<Foo> f(new Foo) |
225 | | // yb::Closure cb = yb::Bind(&TakesOneRef, f); |
226 | | // |
227 | | // This should "just work." The closure will take a reference as long as it |
228 | | // is alive, and another reference will be taken for the called function. |
229 | | // |
230 | | // PASSING PARAMETERS BY REFERENCE |
231 | | // |
232 | | // void foo(int arg) { cout << arg << endl } |
233 | | // int n = 1; |
234 | | // yb::Closure has_ref = yb::Bind(&foo, yb::ConstRef(n)); |
235 | | // n = 2; |
236 | | // has_ref.Run(); // Prints "2" |
237 | | // |
238 | | // Normally parameters are copied in the closure. DANGER: ConstRef stores a |
239 | | // const reference instead, referencing the original parameter. This means |
240 | | // that you must ensure the object outlives the callback! |
241 | | // |
242 | | // |
243 | | // ----------------------------------------------------------------------------- |
244 | | // Implementation notes |
245 | | // ----------------------------------------------------------------------------- |
246 | | // |
247 | | // WHERE IS THIS DESIGN FROM: |
248 | | // |
249 | | // The design Callback and Bind is heavily influenced by C++'s |
250 | | // tr1::function/tr1::bind, and by the "Google Callback" system used inside |
251 | | // Google. |
252 | | // |
253 | | // |
254 | | // HOW THE IMPLEMENTATION WORKS: |
255 | | // |
256 | | // There are three main components to the system: |
257 | | // 1) The Callback classes. |
258 | | // 2) The Bind() functions. |
259 | | // 3) The arguments wrappers (e.g., Unretained() and ConstRef()). |
260 | | // |
261 | | // The Callback classes represent a generic function pointer. Internally, |
262 | | // it stores a refcounted piece of state that represents the target function |
263 | | // and all its bound parameters. Each Callback specialization has a templated |
264 | | // constructor that takes an BindState<>*. In the context of the constructor, |
265 | | // the static type of this BindState<> pointer uniquely identifies the |
266 | | // function it is representing, all its bound parameters, and a Run() method |
267 | | // that is capable of invoking the target. |
268 | | // |
269 | | // Callback's constructor takes the BindState<>* that has the full static type |
270 | | // and erases the target function type as well as the types of the bound |
271 | | // parameters. It does this by storing a pointer to the specific Run() |
272 | | // function, and upcasting the state of BindState<>* to a |
273 | | // BindStateBase*. This is safe as long as this BindStateBase pointer |
274 | | // is only used with the stored Run() pointer. |
275 | | // |
276 | | // To BindState<> objects are created inside the Bind() functions. |
277 | | // These functions, along with a set of internal templates, are responsible for |
278 | | // |
279 | | // - Unwrapping the function signature into return type, and parameters |
280 | | // - Determining the number of parameters that are bound |
281 | | // - Creating the BindState storing the bound parameters |
282 | | // - Performing compile-time asserts to avoid error-prone behavior |
283 | | // - Returning an Callback<> with an arity matching the number of unbound |
284 | | // parameters and that knows the correct refcounting semantics for the |
285 | | // target object if we are binding a method. |
286 | | // |
287 | | // The Bind functions do the above using type-inference, and template |
288 | | // specializations. |
289 | | // |
290 | | // By default Bind() will store copies of all bound parameters, and attempt |
291 | | // to refcount a target object if the function being bound is a class method. |
292 | | // These copies are created even if the function takes parameters as const |
293 | | // references. (Binding to non-const references is forbidden, see bind.h.) |
294 | | // |
295 | | // To change this behavior, we introduce a set of argument wrappers |
296 | | // (e.g., Unretained(), and ConstRef()). These are simple container templates |
297 | | // that are passed by value, and wrap a pointer to argument. See the |
298 | | // file-level comment in yb/gutil/bind_helpers.h for more info. |
299 | | // |
300 | | // These types are passed to the Unwrap() functions, and the MaybeRefcount() |
301 | | // functions respectively to modify the behavior of Bind(). The Unwrap() |
302 | | // and MaybeRefcount() functions change behavior by doing partial |
303 | | // specialization based on whether or not a parameter is a wrapper type. |
304 | | // |
305 | | // ConstRef() is similar to tr1::cref. Unretained() is specific to Chromium. |
306 | | // |
307 | | // |
308 | | // WHY NOT TR1 FUNCTION/BIND? |
309 | | // |
310 | | // Direct use of tr1::function and tr1::bind was considered, but ultimately |
311 | | // rejected because of the number of copy constructors invocations involved |
312 | | // in the binding of arguments during construction, and the forwarding of |
313 | | // arguments during invocation. These copies will no longer be an issue in |
314 | | // C++0x because C++0x will support rvalue reference allowing for the compiler |
315 | | // to avoid these copies. However, waiting for C++0x is not an option. |
316 | | // |
317 | | // Measured with valgrind on gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5), the |
318 | | // tr1::bind call itself will invoke a non-trivial copy constructor three times |
319 | | // for each bound parameter. Also, each when passing a tr1::function, each |
320 | | // bound argument will be copied again. |
321 | | // |
322 | | // In addition to the copies taken at binding and invocation, copying a |
323 | | // tr1::function causes a copy to be made of all the bound parameters and |
324 | | // state. |
325 | | // |
326 | | // Furthermore, in Chromium, it is desirable for the Callback to take a |
327 | | // reference on a target object when representing a class method call. This |
328 | | // is not supported by tr1. |
329 | | // |
330 | | // Lastly, tr1::function and tr1::bind has a more general and flexible API. |
331 | | // This includes things like argument reordering by use of |
332 | | // tr1::bind::placeholder, support for non-const reference parameters, and some |
333 | | // limited amount of subtyping of the tr1::function object (e.g., |
334 | | // tr1::function<int(int)> is convertible to tr1::function<void(int)>). |
335 | | // |
336 | | // These are not features that are required in Chromium. Some of them, such as |
337 | | // allowing for reference parameters, and subtyping of functions, may actually |
338 | | // become a source of errors. Removing support for these features actually |
339 | | // allows for a simpler implementation, and a terser Currying API. |
340 | | // |
341 | | // |
342 | | // WHY NOT GOOGLE CALLBACKS? |
343 | | // |
344 | | // The Google callback system also does not support refcounting. Furthermore, |
345 | | // its implementation has a number of strange edge cases with respect to type |
346 | | // conversion of its arguments. In particular, the argument's constness must |
347 | | // at times match exactly the function signature, or the type-inference might |
348 | | // break. Given the above, writing a custom solution was easier. |
349 | | // |
350 | | // |
351 | | // MISSING FUNCTIONALITY |
352 | | // - Invoking the return of Bind. Bind(&foo).Run() does not work; |
353 | | // - Binding arrays to functions that take a non-const pointer. |
354 | | // Example: |
355 | | // void Foo(const char* ptr); |
356 | | // void Bar(char* ptr); |
357 | | // Bind(&Foo, "test"); |
358 | | // Bind(&Bar, "test"); // This fails because ptr is not const. |
359 | | |
360 | | namespace yb { |
361 | | |
362 | | // First, we forward declare the Callback class template. This informs the |
363 | | // compiler that the template only has 1 type parameter which is the function |
364 | | // signature that the Callback is representing. |
365 | | // |
366 | | // After this, create template specializations for 0-7 parameters. Note that |
367 | | // even though the template typelist grows, the specialization still |
368 | | // only has one type: the function signature. |
369 | | // |
370 | | // If you are thinking of forward declaring Callback in your own header file, |
371 | | // please include "base/callback_forward.h" instead. |
372 | | template <typename Sig> |
373 | | class Callback; |
374 | | |
375 | | namespace internal { |
376 | | template <typename Runnable, typename RunType, typename BoundArgsType> |
377 | | struct BindState; |
378 | | } // namespace internal |
379 | | |
380 | | template <typename R> |
381 | | class Callback<R(void)> : public internal::CallbackBase { |
382 | | public: |
383 | | typedef R(RunType)(); |
384 | | |
385 | 23.8k | Callback() : CallbackBase(NULL) { } |
386 | | |
387 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
388 | | // return the exact Callback<> type. See base/bind.h for details. |
389 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
390 | | Callback(internal::BindState<Runnable, BindRunType, |
391 | | BoundArgsType>* bind_state) |
392 | 35.4M | : CallbackBase(bind_state) { |
393 | | |
394 | | // Force the assignment to a local variable of PolymorphicInvoke |
395 | | // so the compiler will typecheck that the passed in Run() method has |
396 | | // the correct type. |
397 | 35.4M | PolymorphicInvoke invoke_func = |
398 | 35.4M | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
399 | 35.4M | ::InvokerType::Run; |
400 | 35.4M | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
401 | 35.4M | } yb::Callback<unsigned long long ()>::Callback<yb::internal::RunnableAdapter<unsigned long long (yb::server::HybridClock::*)()>, unsigned long long (yb::server::HybridClock*), void (yb::internal::UnretainedWrapper<yb::server::HybridClock>)>(yb::internal::BindState<yb::internal::RunnableAdapter<unsigned long long (yb::server::HybridClock::*)()>, unsigned long long (yb::server::HybridClock*), void (yb::internal::UnretainedWrapper<yb::server::HybridClock>)>*) Line | Count | Source | 392 | 51.5k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 51.5k | PolymorphicInvoke invoke_func = | 398 | 51.5k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 51.5k | ::InvokerType::Run; | 400 | 51.5k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 51.5k | } |
yb::Callback<unsigned long long ()>::Callback<yb::internal::RunnableAdapter<unsigned long long (*)(unsigned long long)>, unsigned long long (unsigned long long), void (unsigned long long)>(yb::internal::BindState<yb::internal::RunnableAdapter<unsigned long long (*)(unsigned long long)>, unsigned long long (unsigned long long), void (unsigned long long)>*) Line | Count | Source | 392 | 331 | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 331 | PolymorphicInvoke invoke_func = | 398 | 331 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 331 | ::InvokerType::Run; | 400 | 331 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 331 | } |
yb::Callback<long long ()>::Callback<yb::internal::RunnableAdapter<long long (yb::server::HybridClock::*)()>, long long (yb::server::HybridClock*), void (yb::internal::UnretainedWrapper<yb::server::HybridClock>)>(yb::internal::BindState<yb::internal::RunnableAdapter<long long (yb::server::HybridClock::*)()>, long long (yb::server::HybridClock*), void (yb::internal::UnretainedWrapper<yb::server::HybridClock>)>*) Line | Count | Source | 392 | 25.7k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 25.7k | PolymorphicInvoke invoke_func = | 398 | 25.7k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 25.7k | ::InvokerType::Run; | 400 | 25.7k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 25.7k | } |
yb::Callback<long long ()>::Callback<yb::internal::RunnableAdapter<long long (*)(long long)>, long long (long long), void (long long)>(yb::internal::BindState<yb::internal::RunnableAdapter<long long (*)(long long)>, long long (long long), void (long long)>*) Line | Count | Source | 392 | 164 | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 164 | PolymorphicInvoke invoke_func = | 398 | 164 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 164 | ::InvokerType::Run; | 400 | 164 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 164 | } |
yb::Callback<unsigned long long ()>::Callback<yb::internal::RunnableAdapter<unsigned long long (yb::server::LogicalClock::*)()>, unsigned long long (yb::server::LogicalClock*), void (yb::internal::UnretainedWrapper<yb::server::LogicalClock>)>(yb::internal::BindState<yb::internal::RunnableAdapter<unsigned long long (yb::server::LogicalClock::*)()>, unsigned long long (yb::server::LogicalClock*), void (yb::internal::UnretainedWrapper<yb::server::LogicalClock>)>*) Line | Count | Source | 392 | 72 | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 72 | PolymorphicInvoke invoke_func = | 398 | 72 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 72 | ::InvokerType::Run; | 400 | 72 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 72 | } |
read_query.cc:yb::Callback<void ()>::Callback<yb::internal::RunnableAdapter<void (*)(yb::tablet::AbstractTablet*, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::RedisReadRequestPB const&, yb::RedisResponsePB*, std::__1::function<void (yb::Status const&)> const&)>, void (yb::tablet::AbstractTablet*, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::RedisReadRequestPB const&, yb::RedisResponsePB*, std::__1::function<void (yb::Status const&)> const&), void (yb::internal::UnretainedWrapper<yb::tablet::AbstractTablet>, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime, yb::RedisReadRequestPB, yb::internal::UnretainedWrapper<yb::RedisResponsePB>, yb::tserver::(anonymous namespace)::ReadQuery::DoReadImpl()::$_1)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(yb::tablet::AbstractTablet*, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::RedisReadRequestPB const&, yb::RedisResponsePB*, std::__1::function<void (yb::Status const&)> const&)>, void (yb::tablet::AbstractTablet*, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::RedisReadRequestPB const&, yb::RedisResponsePB*, std::__1::function<void (yb::Status const&)> const&), void (yb::internal::UnretainedWrapper<yb::tablet::AbstractTablet>, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime, yb::RedisReadRequestPB, yb::internal::UnretainedWrapper<yb::RedisResponsePB>, yb::tserver::(anonymous namespace)::ReadQuery::DoReadImpl()::$_1)>*) Line | Count | Source | 392 | 84.6k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 84.6k | PolymorphicInvoke invoke_func = | 398 | 84.6k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 84.6k | ::InvokerType::Run; | 400 | 84.6k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 84.6k | } |
yb::Callback<void ()>::Callback<yb::internal::RunnableAdapter<void (yb::consensus::PeerMessageQueue::*)(yb::consensus::MajorityReplicatedData const&)>, void (yb::consensus::PeerMessageQueue*, yb::consensus::MajorityReplicatedData const&), void (yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, yb::consensus::MajorityReplicatedData)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::consensus::PeerMessageQueue::*)(yb::consensus::MajorityReplicatedData const&)>, void (yb::consensus::PeerMessageQueue*, yb::consensus::MajorityReplicatedData const&), void (yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, yb::consensus::MajorityReplicatedData)>*) Line | Count | Source | 392 | 34.7M | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 34.7M | PolymorphicInvoke invoke_func = | 398 | 34.7M | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 34.7M | ::InvokerType::Run; | 400 | 34.7M | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 34.7M | } |
yb::Callback<unsigned long long ()>::Callback<yb::internal::RunnableAdapter<unsigned long long (*)(char const*)>, unsigned long long (char const*), void (yb::internal::UnretainedWrapper<char const>)>(yb::internal::BindState<yb::internal::RunnableAdapter<unsigned long long (*)(char const*)>, unsigned long long (char const*), void (yb::internal::UnretainedWrapper<char const>)>*) Line | Count | Source | 392 | 158k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 158k | PolymorphicInvoke invoke_func = | 398 | 158k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 158k | ::InvokerType::Run; | 400 | 158k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 158k | } |
yb::Callback<yb::Status ()>::Callback<yb::internal::RunnableAdapter<yb::Status (yb::master::CatalogManager::*)()>, yb::Status (yb::master::CatalogManager*), void (yb::internal::UnretainedWrapper<yb::master::CatalogManager>)>(yb::internal::BindState<yb::internal::RunnableAdapter<yb::Status (yb::master::CatalogManager::*)()>, yb::Status (yb::master::CatalogManager*), void (yb::internal::UnretainedWrapper<yb::master::CatalogManager>)>*) Line | Count | Source | 392 | 8.07k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 8.07k | PolymorphicInvoke invoke_func = | 398 | 8.07k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 8.07k | ::InvokerType::Run; | 400 | 8.07k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 8.07k | } |
yb::Callback<void ()>::Callback<yb::internal::RunnableAdapter<void (yb::master::CatalogManager::*)()>, void (yb::master::CatalogManager*), void (yb::internal::UnretainedWrapper<yb::master::CatalogManager>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::master::CatalogManager::*)()>, void (yb::master::CatalogManager*), void (yb::internal::UnretainedWrapper<yb::master::CatalogManager>)>*) Line | Count | Source | 392 | 3.02k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 3.02k | PolymorphicInvoke invoke_func = | 398 | 3.02k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 3.02k | ::InvokerType::Run; | 400 | 3.02k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 3.02k | } |
yb::Callback<void ()>::Callback<yb::internal::RunnableAdapter<void (yb::master::Master::*)()>, void (yb::master::Master*), void (yb::internal::UnretainedWrapper<yb::master::Master>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::master::Master::*)()>, void (yb::master::Master*), void (yb::internal::UnretainedWrapper<yb::master::Master>)>*) Line | Count | Source | 392 | 8.03k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 8.03k | PolymorphicInvoke invoke_func = | 398 | 8.03k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 8.03k | ::InvokerType::Run; | 400 | 8.03k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 8.03k | } |
yb::Callback<void ()>::Callback<yb::internal::RunnableAdapter<void (yb::debug::TraceLog::*)()>, void (yb::debug::TraceLog*), void (yb::internal::UnretainedWrapper<yb::debug::TraceLog>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::debug::TraceLog::*)()>, void (yb::debug::TraceLog*), void (yb::internal::UnretainedWrapper<yb::debug::TraceLog>)>*) Line | Count | Source | 392 | 8 | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 8 | PolymorphicInvoke invoke_func = | 398 | 8 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 8 | ::InvokerType::Run; | 400 | 8 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 8 | } |
yb::Callback<unsigned long long ()>::Callback<yb::internal::RunnableAdapter<unsigned long long (*)()>, unsigned long long (), void ()>(yb::internal::BindState<yb::internal::RunnableAdapter<unsigned long long (*)()>, unsigned long long (), void ()>*) Line | Count | Source | 392 | 132k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 132k | PolymorphicInvoke invoke_func = | 398 | 132k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 132k | ::InvokerType::Run; | 400 | 132k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 132k | } |
thread.cc:yb::Callback<unsigned long long ()>::Callback<yb::internal::RunnableAdapter<unsigned long long (yb::(anonymous namespace)::ThreadMgr::*)()>, unsigned long long (yb::(anonymous namespace)::ThreadMgr*), void (yb::internal::UnretainedWrapper<yb::(anonymous namespace)::ThreadMgr>)>(yb::internal::BindState<yb::internal::RunnableAdapter<unsigned long long (yb::(anonymous namespace)::ThreadMgr::*)()>, unsigned long long (yb::(anonymous namespace)::ThreadMgr*), void (yb::internal::UnretainedWrapper<yb::(anonymous namespace)::ThreadMgr>)>*) Line | Count | Source | 392 | 52.8k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 52.8k | PolymorphicInvoke invoke_func = | 398 | 52.8k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 52.8k | ::InvokerType::Run; | 400 | 52.8k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 52.8k | } |
yb::Callback<void ()>::Callback<yb::internal::RunnableAdapter<void (yb::log::Log::*)()>, void (yb::log::Log*), void (yb::internal::UnretainedWrapper<yb::log::Log>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::log::Log::*)()>, void (yb::log::Log*), void (yb::internal::UnretainedWrapper<yb::log::Log>)>*) Line | Count | Source | 392 | 159k | : CallbackBase(bind_state) { | 393 | | | 394 | | // Force the assignment to a local variable of PolymorphicInvoke | 395 | | // so the compiler will typecheck that the passed in Run() method has | 396 | | // the correct type. | 397 | 159k | PolymorphicInvoke invoke_func = | 398 | 159k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 399 | 159k | ::InvokerType::Run; | 400 | 159k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 401 | 159k | } |
|
402 | | |
403 | | bool Equals(const Callback& other) const { |
404 | | return CallbackBase::Equals(other); |
405 | | } |
406 | | |
407 | 35.2M | R Run() const { |
408 | 35.2M | PolymorphicInvoke f = |
409 | 35.2M | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
410 | | |
411 | 35.2M | return f(bind_state_.get()); |
412 | 35.2M | } yb::Callback<unsigned long long ()>::Run() const Line | Count | Source | 407 | 230k | R Run() const { | 408 | 230k | PolymorphicInvoke f = | 409 | 230k | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 410 | | | 411 | 230k | return f(bind_state_.get()); | 412 | 230k | } |
yb::Callback<long long ()>::Run() const Line | Count | Source | 407 | 15.5k | R Run() const { | 408 | 15.5k | PolymorphicInvoke f = | 409 | 15.5k | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 410 | | | 411 | 15.5k | return f(bind_state_.get()); | 412 | 15.5k | } |
yb::Callback<void ()>::Run() const Line | Count | Source | 407 | 35.0M | R Run() const { | 408 | 35.0M | PolymorphicInvoke f = | 409 | 35.0M | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 410 | | | 411 | 35.0M | return f(bind_state_.get()); | 412 | 35.0M | } |
yb::Callback<yb::Status ()>::Run() const Line | Count | Source | 407 | 3.01k | R Run() const { | 408 | 3.01k | PolymorphicInvoke f = | 409 | 3.01k | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 410 | | | 411 | 3.01k | return f(bind_state_.get()); | 412 | 3.01k | } |
|
413 | | |
414 | | private: |
415 | | typedef R(*PolymorphicInvoke)( |
416 | | internal::BindStateBase*); |
417 | | |
418 | | }; |
419 | | |
420 | | template <typename R, typename A1> |
421 | | class Callback<R(A1)> : public internal::CallbackBase { |
422 | | public: |
423 | | typedef R(RunType)(A1); |
424 | | |
425 | 26.4M | Callback() : CallbackBase(NULL) { } |
426 | | |
427 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
428 | | // return the exact Callback<> type. See base/bind.h for details. |
429 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
430 | | Callback(internal::BindState<Runnable, BindRunType, |
431 | | BoundArgsType>* bind_state) |
432 | 49.6M | : CallbackBase(bind_state) { |
433 | | |
434 | | // Force the assignment to a local variable of PolymorphicInvoke |
435 | | // so the compiler will typecheck that the passed in Run() method has |
436 | | // the correct type. |
437 | 49.6M | PolymorphicInvoke invoke_func = |
438 | 49.6M | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
439 | 49.6M | ::InvokerType::Run; |
440 | 49.6M | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
441 | 49.6M | } yb::Callback<void (std::__1::shared_ptr<yb::consensus::StateChangeContext>)>::Callback<yb::internal::RunnableAdapter<void (yb::tserver::TSTabletManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>)>, void (yb::tserver::TSTabletManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>), void (yb::internal::UnretainedWrapper<yb::tserver::TSTabletManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::tserver::TSTabletManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>)>, void (yb::tserver::TSTabletManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>), void (yb::internal::UnretainedWrapper<yb::tserver::TSTabletManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)>*) Line | Count | Source | 432 | 142k | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 142k | PolymorphicInvoke invoke_func = | 438 | 142k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 142k | ::InvokerType::Run; | 440 | 142k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 142k | } |
yb::Callback<void (std::__1::shared_ptr<yb::consensus::StateChangeContext>)>::Callback<yb::internal::RunnableAdapter<void (yb::tserver::RemoteBootstrapSessionTest::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>)>, void (yb::tserver::RemoteBootstrapSessionTest*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>), void (yb::internal::UnretainedWrapper<yb::tserver::RemoteBootstrapSessionTest>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::tserver::RemoteBootstrapSessionTest::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>)>, void (yb::tserver::RemoteBootstrapSessionTest*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>), void (yb::internal::UnretainedWrapper<yb::tserver::RemoteBootstrapSessionTest>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)>*) Line | Count | Source | 432 | 4 | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 4 | PolymorphicInvoke invoke_func = | 438 | 4 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 4 | ::InvokerType::Run; | 440 | 4 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 4 | } |
yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (yb::consensus::PeerMessageQueue::*)(yb::OpId const&, yb::Status const&)>, void (yb::consensus::PeerMessageQueue*, yb::OpId const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, yb::OpId)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::consensus::PeerMessageQueue::*)(yb::OpId const&, yb::Status const&)>, void (yb::consensus::PeerMessageQueue*, yb::OpId const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, yb::OpId)>*) Line | Count | Source | 432 | 24.2M | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 24.2M | PolymorphicInvoke invoke_func = | 438 | 24.2M | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 24.2M | ::InvokerType::Run; | 440 | 24.2M | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 24.2M | } |
yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (yb::consensus::LogCache::*)(long long, yb::Callback<void (yb::Status const&)> const&, yb::Status const&)>, void (yb::consensus::LogCache*, long long, yb::Callback<void (yb::Status const&)> const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::consensus::LogCache>, long long, yb::Callback<void (yb::Status const&)>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::consensus::LogCache::*)(long long, yb::Callback<void (yb::Status const&)> const&, yb::Status const&)>, void (yb::consensus::LogCache*, long long, yb::Callback<void (yb::Status const&)> const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::consensus::LogCache>, long long, yb::Callback<void (yb::Status const&)>)>*) Line | Count | Source | 432 | 24.3M | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 24.3M | PolymorphicInvoke invoke_func = | 438 | 24.3M | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 24.3M | ::InvokerType::Run; | 440 | 24.3M | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 24.3M | } |
yb::Callback<void (std::__1::shared_ptr<yb::consensus::StateChangeContext>)>::Callback<yb::internal::RunnableAdapter<void (yb::master::SysCatalogTable::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>)>, void (yb::master::SysCatalogTable*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>), void (yb::internal::UnretainedWrapper<yb::master::SysCatalogTable>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::master::SysCatalogTable::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>)>, void (yb::master::SysCatalogTable*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::consensus::StateChangeContext>), void (yb::internal::UnretainedWrapper<yb::master::SysCatalogTable>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)>*) Line | Count | Source | 432 | 7.94k | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 7.94k | PolymorphicInvoke invoke_func = | 438 | 7.94k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 7.94k | ::InvokerType::Run; | 440 | 7.94k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 7.94k | } |
Unexecuted instantiation: yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (yb::master::enterprise::CatalogManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&)>, void (yb::master::enterprise::CatalogManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > >, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::master::enterprise::CatalogManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&)>, void (yb::master::enterprise::CatalogManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > >, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >)>*) Unexecuted instantiation: yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (yb::master::enterprise::CatalogManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&)>, void (yb::master::enterprise::CatalogManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::master::enterprise::CatalogManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&)>, void (yb::master::enterprise::CatalogManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >)>*) Unexecuted instantiation: yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (yb::master::enterprise::CatalogManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::client::YBTableInfo> const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&)>, void (yb::master::enterprise::CatalogManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::client::YBTableInfo> const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<yb::client::YBTableInfo>, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::master::enterprise::CatalogManager::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::client::YBTableInfo> const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&)>, void (yb::master::enterprise::CatalogManager*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<yb::client::YBTableInfo> const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<yb::client::YBTableInfo>, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >)>*) yb::Callback<void (yb::debug::TraceBucketData*)>::Callback<yb::internal::RunnableAdapter<void (*)(yb::debug::TraceBucketData*)>, void (yb::debug::TraceBucketData*), void ()>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(yb::debug::TraceBucketData*)>, void (yb::debug::TraceBucketData*), void ()>*) Line | Count | Source | 432 | 3 | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 3 | PolymorphicInvoke invoke_func = | 438 | 3 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 3 | ::InvokerType::Run; | 440 | 3 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 3 | } |
yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (yb::Synchronizer::*)(yb::Status const&)>, void (yb::Synchronizer*, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::Synchronizer>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::Synchronizer::*)(yb::Status const&)>, void (yb::Synchronizer*, yb::Status const&), void (yb::internal::UnretainedWrapper<yb::Synchronizer>)>*) Line | Count | Source | 432 | 907k | : CallbackBase(bind_state) { | 433 | | | 434 | | // Force the assignment to a local variable of PolymorphicInvoke | 435 | | // so the compiler will typecheck that the passed in Run() method has | 436 | | // the correct type. | 437 | 907k | PolymorphicInvoke invoke_func = | 438 | 907k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 439 | 907k | ::InvokerType::Run; | 440 | 907k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 441 | 907k | } |
Unexecuted instantiation: yb::Callback<void (yb::Status const&)>::Callback<yb::internal::RunnableAdapter<void (*)(std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&)>, void (std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&), void (std::__1::weak_ptr<yb::Synchronizer>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&)>, void (std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&), void (std::__1::weak_ptr<yb::Synchronizer>)>*) |
442 | | |
443 | | bool Equals(const Callback& other) const { |
444 | | return CallbackBase::Equals(other); |
445 | | } |
446 | | |
447 | 50.1M | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1) const { |
448 | 50.1M | PolymorphicInvoke f = |
449 | 50.1M | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
450 | | |
451 | 50.1M | return f(bind_state_.get(), internal::CallbackForward(a1)); |
452 | 50.1M | } yb::Callback<void (yb::Status const&)>::Run(yb::Status const&) const Line | Count | Source | 447 | 49.5M | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1) const { | 448 | 49.5M | PolymorphicInvoke f = | 449 | 49.5M | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 450 | | | 451 | 49.5M | return f(bind_state_.get(), internal::CallbackForward(a1)); | 452 | 49.5M | } |
yb::Callback<void (std::__1::shared_ptr<yb::consensus::StateChangeContext>)>::Run(std::__1::shared_ptr<yb::consensus::StateChangeContext> const&) const Line | Count | Source | 447 | 621k | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1) const { | 448 | 621k | PolymorphicInvoke f = | 449 | 621k | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 450 | | | 451 | 621k | return f(bind_state_.get(), internal::CallbackForward(a1)); | 452 | 621k | } |
yb::Callback<void (yb::debug::TraceBucketData*)>::Run(yb::debug::TraceBucketData* const&) const Line | Count | Source | 447 | 300 | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1) const { | 448 | 300 | PolymorphicInvoke f = | 449 | 300 | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 450 | | | 451 | 300 | return f(bind_state_.get(), internal::CallbackForward(a1)); | 452 | 300 | } |
|
453 | | |
454 | | private: |
455 | | typedef R(*PolymorphicInvoke)( |
456 | | internal::BindStateBase*, |
457 | | typename internal::CallbackParamTraits<A1>::ForwardType); |
458 | | |
459 | | }; |
460 | | |
461 | | template <typename R, typename A1, typename A2> |
462 | | class Callback<R(A1, A2)> : public internal::CallbackBase { |
463 | | public: |
464 | | typedef R(RunType)(A1, A2); |
465 | | |
466 | 36.2k | Callback() : CallbackBase(NULL) { } yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Callback() Line | Count | Source | 466 | 36.2k | Callback() : CallbackBase(NULL) { } |
yb::Callback<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::Status const&)>::Callback() Line | Count | Source | 466 | 1 | Callback() : CallbackBase(NULL) { } |
|
467 | | |
468 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
469 | | // return the exact Callback<> type. See base/bind.h for details. |
470 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
471 | | Callback(internal::BindState<Runnable, BindRunType, |
472 | | BoundArgsType>* bind_state) |
473 | 999k | : CallbackBase(bind_state) { |
474 | | |
475 | | // Force the assignment to a local variable of PolymorphicInvoke |
476 | | // so the compiler will typecheck that the passed in Run() method has |
477 | | // the correct type. |
478 | 999k | PolymorphicInvoke invoke_func = |
479 | 999k | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
480 | 999k | ::InvokerType::Run; |
481 | 999k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
482 | 999k | } heartbeater.cc:yb::Callback<void (yb::Status const&, yb::HostPort const&)>::Callback<yb::internal::RunnableAdapter<void (*)(std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&)>, void (std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&), void (std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&)>, void (std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&), void (std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData>)>*) Line | Count | Source | 473 | 418k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 418k | PolymorphicInvoke invoke_func = | 479 | 418k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 418k | ::InvokerType::Run; | 481 | 418k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 418k | } |
Unexecuted instantiation: yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Callback<yb::internal::RunnableAdapter<void (yb::ql::TestQLProcessor::*)(yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::ql::TestQLProcessor*, yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::ql::TestQLProcessor>, yb::Callback<void (yb::Status const&)>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::ql::TestQLProcessor::*)(yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::ql::TestQLProcessor*, yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::ql::TestQLProcessor>, yb::Callback<void (yb::Status const&)>)>*) Unexecuted instantiation: yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Callback<yb::internal::RunnableAdapter<void (yb::ql::QLProcessor::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::ql::QLProcessor*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::ql::QLProcessor>, yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::internal::ConstRefWrapper<yb::ql::StatementParameters>, yb::internal::UnretainedWrapper<yb::ql::ParseTree>, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::ql::QLProcessor::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::ql::QLProcessor*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::ql::QLProcessor>, yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::internal::ConstRefWrapper<yb::ql::StatementParameters>, yb::internal::UnretainedWrapper<yb::ql::ParseTree>, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>)>*) yb::Callback<void (yb::Status const&, yb::HostPort const&)>::Callback<yb::internal::RunnableAdapter<void (yb::client::YBClient::Data::*)(yb::Status const&, yb::HostPort const&)>, void (yb::client::YBClient::Data*, yb::Status const&, yb::HostPort const&), void (yb::internal::UnretainedWrapper<yb::client::YBClient::Data>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::client::YBClient::Data::*)(yb::Status const&, yb::HostPort const&)>, void (yb::client::YBClient::Data*, yb::Status const&, yb::HostPort const&), void (yb::internal::UnretainedWrapper<yb::client::YBClient::Data>)>*) Line | Count | Source | 473 | 41.5k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 41.5k | PolymorphicInvoke invoke_func = | 479 | 41.5k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 41.5k | ::InvokerType::Run; | 481 | 41.5k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 41.5k | } |
yb::Callback<void (yb::Status const&, unsigned long long)>::Callback<yb::internal::RunnableAdapter<void (*)(scoped_refptr<yb::tools::ChecksumResultReporter> const&, std::__1::shared_ptr<yb::tools::YsckTabletServer> const&, std::__1::shared_ptr<yb::BlockingQueue<std::__1::pair<yb::Schema, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::DefaultLogicalSize> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::tools::ChecksumOptions const&, yb::Status const&, unsigned long long)>, void (scoped_refptr<yb::tools::ChecksumResultReporter> const&, std::__1::shared_ptr<yb::tools::YsckTabletServer> const&, std::__1::shared_ptr<yb::BlockingQueue<std::__1::pair<yb::Schema, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::DefaultLogicalSize> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::tools::ChecksumOptions const&, yb::Status const&, unsigned long long), void (scoped_refptr<yb::tools::ChecksumResultReporter>, std::__1::shared_ptr<yb::tools::YsckTabletServer>, std::__1::shared_ptr<yb::BlockingQueue<std::__1::pair<yb::Schema, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::DefaultLogicalSize> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, yb::tools::ChecksumOptions)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(scoped_refptr<yb::tools::ChecksumResultReporter> const&, std::__1::shared_ptr<yb::tools::YsckTabletServer> const&, std::__1::shared_ptr<yb::BlockingQueue<std::__1::pair<yb::Schema, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::DefaultLogicalSize> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::tools::ChecksumOptions const&, yb::Status const&, unsigned long long)>, void (scoped_refptr<yb::tools::ChecksumResultReporter> const&, std::__1::shared_ptr<yb::tools::YsckTabletServer> const&, std::__1::shared_ptr<yb::BlockingQueue<std::__1::pair<yb::Schema, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::DefaultLogicalSize> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::tools::ChecksumOptions const&, yb::Status const&, unsigned long long), void (scoped_refptr<yb::tools::ChecksumResultReporter>, std::__1::shared_ptr<yb::tools::YsckTabletServer>, std::__1::shared_ptr<yb::BlockingQueue<std::__1::pair<yb::Schema, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::DefaultLogicalSize> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, yb::tools::ChecksumOptions)>*) Line | Count | Source | 473 | 4.37k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 4.37k | PolymorphicInvoke invoke_func = | 479 | 4.37k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 4.37k | ::InvokerType::Run; | 481 | 4.37k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 4.37k | } |
yb::Callback<void (yb::Status const&, yb::HostPort const&)>::Callback<yb::internal::RunnableAdapter<void (*)(yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&)>, void (yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&), void (yb::HostPort*, yb::Synchronizer*)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&)>, void (yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&), void (yb::HostPort*, yb::Synchronizer*)>*) Line | Count | Source | 473 | 2.93k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 2.93k | PolymorphicInvoke invoke_func = | 479 | 2.93k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 2.93k | ::InvokerType::Run; | 481 | 2.93k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 2.93k | } |
yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Callback<yb::internal::RunnableAdapter<void (yb::ql::QLProcessor::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::ql::QLProcessor*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::ql::QLProcessor>, yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::internal::ConstRefWrapper<yb::ql::StatementParameters>, yb::internal::OwnedWrapper<yb::ql::ParseTree const>, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::ql::QLProcessor::*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::ql::QLProcessor*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::ql::StatementParameters const&, yb::ql::ParseTree const*, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::ql::QLProcessor>, yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, yb::internal::ConstRefWrapper<yb::ql::StatementParameters>, yb::internal::OwnedWrapper<yb::ql::ParseTree const>, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>)>*) Line | Count | Source | 473 | 336k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 336k | PolymorphicInvoke invoke_func = | 479 | 336k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 336k | ::InvokerType::Run; | 481 | 336k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 336k | } |
yb::Callback<void (scoped_refptr<yb::RefCountedString> const&, bool)>::Callback<yb::internal::RunnableAdapter<void (yb::debug::TraceResultBuffer::*)(scoped_refptr<yb::RefCountedString> const&, bool)>, void (yb::debug::TraceResultBuffer*, scoped_refptr<yb::RefCountedString> const&, bool), void (yb::internal::UnretainedWrapper<yb::debug::TraceResultBuffer>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::debug::TraceResultBuffer::*)(scoped_refptr<yb::RefCountedString> const&, bool)>, void (yb::debug::TraceResultBuffer*, scoped_refptr<yb::RefCountedString> const&, bool), void (yb::internal::UnretainedWrapper<yb::debug::TraceResultBuffer>)>*) Line | Count | Source | 473 | 23 | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 23 | PolymorphicInvoke invoke_func = | 479 | 23 | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 23 | ::InvokerType::Run; | 481 | 23 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 23 | } |
yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Callback<yb::internal::RunnableAdapter<void (yb::cqlserver::CQLProcessor::*)(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::cqlserver::CQLProcessor*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::cqlserver::CQLProcessor>)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (yb::cqlserver::CQLProcessor::*)(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::cqlserver::CQLProcessor*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::internal::UnretainedWrapper<yb::cqlserver::CQLProcessor>)>*) Line | Count | Source | 473 | 18.1k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 18.1k | PolymorphicInvoke invoke_func = | 479 | 18.1k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 18.1k | ::InvokerType::Run; | 481 | 18.1k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 18.1k | } |
yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Callback<yb::internal::RunnableAdapter<void (*)(yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*)>(yb::internal::BindState<yb::internal::RunnableAdapter<void (*)(yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, void (yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), void (yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*)>*) Line | Count | Source | 473 | 177k | : CallbackBase(bind_state) { | 474 | | | 475 | | // Force the assignment to a local variable of PolymorphicInvoke | 476 | | // so the compiler will typecheck that the passed in Run() method has | 477 | | // the correct type. | 478 | 177k | PolymorphicInvoke invoke_func = | 479 | 177k | &internal::BindState<Runnable, BindRunType, BoundArgsType> | 480 | 177k | ::InvokerType::Run; | 481 | 177k | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); | 482 | 177k | } |
|
483 | | |
484 | | bool Equals(const Callback& other) const { |
485 | | return CallbackBase::Equals(other); |
486 | | } |
487 | | |
488 | | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, |
489 | 10.3M | typename internal::CallbackParamTraits<A2>::ForwardType a2) const { |
490 | 10.3M | PolymorphicInvoke f = |
491 | 10.3M | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
492 | | |
493 | 10.3M | return f(bind_state_.get(), internal::CallbackForward(a1), |
494 | 10.3M | internal::CallbackForward(a2)); |
495 | 10.3M | } yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::Run(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&) const Line | Count | Source | 489 | 9.41M | typename internal::CallbackParamTraits<A2>::ForwardType a2) const { | 490 | 9.41M | PolymorphicInvoke f = | 491 | 9.41M | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 492 | | | 493 | 9.41M | return f(bind_state_.get(), internal::CallbackForward(a1), | 494 | 9.41M | internal::CallbackForward(a2)); | 495 | 9.41M | } |
yb::Callback<void (yb::Status const&, unsigned long long)>::Run(yb::Status const&, unsigned long long const&) const Line | Count | Source | 489 | 4.37k | typename internal::CallbackParamTraits<A2>::ForwardType a2) const { | 490 | 4.37k | PolymorphicInvoke f = | 491 | 4.37k | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 492 | | | 493 | 4.37k | return f(bind_state_.get(), internal::CallbackForward(a1), | 494 | 4.37k | internal::CallbackForward(a2)); | 495 | 4.37k | } |
yb::Callback<void (scoped_refptr<yb::RefCountedString> const&, bool)>::Run(scoped_refptr<yb::RefCountedString> const&, bool const&) const Line | Count | Source | 489 | 350 | typename internal::CallbackParamTraits<A2>::ForwardType a2) const { | 490 | 350 | PolymorphicInvoke f = | 491 | 350 | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 492 | | | 493 | 350 | return f(bind_state_.get(), internal::CallbackForward(a1), | 494 | 350 | internal::CallbackForward(a2)); | 495 | 350 | } |
yb::Callback<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::Status const&)>::Run(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, yb::Status const&) const Line | Count | Source | 489 | 1 | typename internal::CallbackParamTraits<A2>::ForwardType a2) const { | 490 | 1 | PolymorphicInvoke f = | 491 | 1 | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 492 | | | 493 | 1 | return f(bind_state_.get(), internal::CallbackForward(a1), | 494 | 1 | internal::CallbackForward(a2)); | 495 | 1 | } |
yb::Callback<void (yb::Status const&, yb::HostPort const&)>::Run(yb::Status const&, yb::HostPort const&) const Line | Count | Source | 489 | 880k | typename internal::CallbackParamTraits<A2>::ForwardType a2) const { | 490 | 880k | PolymorphicInvoke f = | 491 | 880k | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); | 492 | | | 493 | 880k | return f(bind_state_.get(), internal::CallbackForward(a1), | 494 | 880k | internal::CallbackForward(a2)); | 495 | 880k | } |
|
496 | | |
497 | | private: |
498 | | typedef R(*PolymorphicInvoke)( |
499 | | internal::BindStateBase*, |
500 | | typename internal::CallbackParamTraits<A1>::ForwardType, |
501 | | typename internal::CallbackParamTraits<A2>::ForwardType); |
502 | | |
503 | | }; |
504 | | |
505 | | template <typename R, typename A1, typename A2, typename A3> |
506 | | class Callback<R(A1, A2, A3)> : public internal::CallbackBase { |
507 | | public: |
508 | | typedef R(RunType)(A1, A2, A3); |
509 | | |
510 | | Callback() : CallbackBase(NULL) { } |
511 | | |
512 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
513 | | // return the exact Callback<> type. See base/bind.h for details. |
514 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
515 | | Callback(internal::BindState<Runnable, BindRunType, |
516 | | BoundArgsType>* bind_state) |
517 | | : CallbackBase(bind_state) { |
518 | | |
519 | | // Force the assignment to a local variable of PolymorphicInvoke |
520 | | // so the compiler will typecheck that the passed in Run() method has |
521 | | // the correct type. |
522 | | PolymorphicInvoke invoke_func = |
523 | | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
524 | | ::InvokerType::Run; |
525 | | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
526 | | } |
527 | | |
528 | | bool Equals(const Callback& other) const { |
529 | | return CallbackBase::Equals(other); |
530 | | } |
531 | | |
532 | | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, |
533 | | typename internal::CallbackParamTraits<A2>::ForwardType a2, |
534 | | typename internal::CallbackParamTraits<A3>::ForwardType a3) const { |
535 | | PolymorphicInvoke f = |
536 | | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
537 | | |
538 | | return f(bind_state_.get(), internal::CallbackForward(a1), |
539 | | internal::CallbackForward(a2), |
540 | | internal::CallbackForward(a3)); |
541 | | } |
542 | | |
543 | | private: |
544 | | typedef R(*PolymorphicInvoke)( |
545 | | internal::BindStateBase*, |
546 | | typename internal::CallbackParamTraits<A1>::ForwardType, |
547 | | typename internal::CallbackParamTraits<A2>::ForwardType, |
548 | | typename internal::CallbackParamTraits<A3>::ForwardType); |
549 | | |
550 | | }; |
551 | | |
552 | | template <typename R, typename A1, typename A2, typename A3, typename A4> |
553 | | class Callback<R(A1, A2, A3, A4)> : public internal::CallbackBase { |
554 | | public: |
555 | | typedef R(RunType)(A1, A2, A3, A4); |
556 | | |
557 | | Callback() : CallbackBase(NULL) { } |
558 | | |
559 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
560 | | // return the exact Callback<> type. See base/bind.h for details. |
561 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
562 | | Callback(internal::BindState<Runnable, BindRunType, |
563 | | BoundArgsType>* bind_state) |
564 | | : CallbackBase(bind_state) { |
565 | | |
566 | | // Force the assignment to a local variable of PolymorphicInvoke |
567 | | // so the compiler will typecheck that the passed in Run() method has |
568 | | // the correct type. |
569 | | PolymorphicInvoke invoke_func = |
570 | | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
571 | | ::InvokerType::Run; |
572 | | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
573 | | } |
574 | | |
575 | | bool Equals(const Callback& other) const { |
576 | | return CallbackBase::Equals(other); |
577 | | } |
578 | | |
579 | | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, |
580 | | typename internal::CallbackParamTraits<A2>::ForwardType a2, |
581 | | typename internal::CallbackParamTraits<A3>::ForwardType a3, |
582 | | typename internal::CallbackParamTraits<A4>::ForwardType a4) const { |
583 | | PolymorphicInvoke f = |
584 | | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
585 | | |
586 | | return f(bind_state_.get(), internal::CallbackForward(a1), |
587 | | internal::CallbackForward(a2), |
588 | | internal::CallbackForward(a3), |
589 | | internal::CallbackForward(a4)); |
590 | | } |
591 | | |
592 | | private: |
593 | | typedef R(*PolymorphicInvoke)( |
594 | | internal::BindStateBase*, |
595 | | typename internal::CallbackParamTraits<A1>::ForwardType, |
596 | | typename internal::CallbackParamTraits<A2>::ForwardType, |
597 | | typename internal::CallbackParamTraits<A3>::ForwardType, |
598 | | typename internal::CallbackParamTraits<A4>::ForwardType); |
599 | | |
600 | | }; |
601 | | |
602 | | template <typename R, typename A1, typename A2, typename A3, typename A4, |
603 | | typename A5> |
604 | | class Callback<R(A1, A2, A3, A4, A5)> : public internal::CallbackBase { |
605 | | public: |
606 | | typedef R(RunType)(A1, A2, A3, A4, A5); |
607 | | |
608 | | Callback() : CallbackBase(NULL) { } |
609 | | |
610 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
611 | | // return the exact Callback<> type. See base/bind.h for details. |
612 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
613 | | Callback(internal::BindState<Runnable, BindRunType, |
614 | | BoundArgsType>* bind_state) |
615 | | : CallbackBase(bind_state) { |
616 | | |
617 | | // Force the assignment to a local variable of PolymorphicInvoke |
618 | | // so the compiler will typecheck that the passed in Run() method has |
619 | | // the correct type. |
620 | | PolymorphicInvoke invoke_func = |
621 | | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
622 | | ::InvokerType::Run; |
623 | | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
624 | | } |
625 | | |
626 | | bool Equals(const Callback& other) const { |
627 | | return CallbackBase::Equals(other); |
628 | | } |
629 | | |
630 | | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, |
631 | | typename internal::CallbackParamTraits<A2>::ForwardType a2, |
632 | | typename internal::CallbackParamTraits<A3>::ForwardType a3, |
633 | | typename internal::CallbackParamTraits<A4>::ForwardType a4, |
634 | | typename internal::CallbackParamTraits<A5>::ForwardType a5) const { |
635 | | PolymorphicInvoke f = |
636 | | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
637 | | |
638 | | return f(bind_state_.get(), internal::CallbackForward(a1), |
639 | | internal::CallbackForward(a2), |
640 | | internal::CallbackForward(a3), |
641 | | internal::CallbackForward(a4), |
642 | | internal::CallbackForward(a5)); |
643 | | } |
644 | | |
645 | | private: |
646 | | typedef R(*PolymorphicInvoke)( |
647 | | internal::BindStateBase*, |
648 | | typename internal::CallbackParamTraits<A1>::ForwardType, |
649 | | typename internal::CallbackParamTraits<A2>::ForwardType, |
650 | | typename internal::CallbackParamTraits<A3>::ForwardType, |
651 | | typename internal::CallbackParamTraits<A4>::ForwardType, |
652 | | typename internal::CallbackParamTraits<A5>::ForwardType); |
653 | | |
654 | | }; |
655 | | |
656 | | template <typename R, typename A1, typename A2, typename A3, typename A4, |
657 | | typename A5, typename A6> |
658 | | class Callback<R(A1, A2, A3, A4, A5, A6)> : public internal::CallbackBase { |
659 | | public: |
660 | | typedef R(RunType)(A1, A2, A3, A4, A5, A6); |
661 | | |
662 | | Callback() : CallbackBase(NULL) { } |
663 | | |
664 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
665 | | // return the exact Callback<> type. See base/bind.h for details. |
666 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
667 | | Callback(internal::BindState<Runnable, BindRunType, |
668 | | BoundArgsType>* bind_state) |
669 | 0 | : CallbackBase(bind_state) { |
670 | | |
671 | | // Force the assignment to a local variable of PolymorphicInvoke |
672 | | // so the compiler will typecheck that the passed in Run() method has |
673 | | // the correct type. |
674 | 0 | PolymorphicInvoke invoke_func = |
675 | 0 | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
676 | 0 | ::InvokerType::Run; |
677 | 0 | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
678 | 0 | } |
679 | | |
680 | | bool Equals(const Callback& other) const { |
681 | | return CallbackBase::Equals(other); |
682 | | } |
683 | | |
684 | | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, |
685 | | typename internal::CallbackParamTraits<A2>::ForwardType a2, |
686 | | typename internal::CallbackParamTraits<A3>::ForwardType a3, |
687 | | typename internal::CallbackParamTraits<A4>::ForwardType a4, |
688 | | typename internal::CallbackParamTraits<A5>::ForwardType a5, |
689 | 0 | typename internal::CallbackParamTraits<A6>::ForwardType a6) const { |
690 | 0 | PolymorphicInvoke f = |
691 | 0 | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
692 | |
|
693 | 0 | return f(bind_state_.get(), internal::CallbackForward(a1), |
694 | 0 | internal::CallbackForward(a2), |
695 | 0 | internal::CallbackForward(a3), |
696 | 0 | internal::CallbackForward(a4), |
697 | 0 | internal::CallbackForward(a5), |
698 | 0 | internal::CallbackForward(a6)); |
699 | 0 | } |
700 | | |
701 | | private: |
702 | | typedef R(*PolymorphicInvoke)( |
703 | | internal::BindStateBase*, |
704 | | typename internal::CallbackParamTraits<A1>::ForwardType, |
705 | | typename internal::CallbackParamTraits<A2>::ForwardType, |
706 | | typename internal::CallbackParamTraits<A3>::ForwardType, |
707 | | typename internal::CallbackParamTraits<A4>::ForwardType, |
708 | | typename internal::CallbackParamTraits<A5>::ForwardType, |
709 | | typename internal::CallbackParamTraits<A6>::ForwardType); |
710 | | |
711 | | }; |
712 | | |
713 | | template <typename R, typename A1, typename A2, typename A3, typename A4, |
714 | | typename A5, typename A6, typename A7> |
715 | | class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public internal::CallbackBase { |
716 | | public: |
717 | | typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); |
718 | | |
719 | | Callback() : CallbackBase(NULL) { } |
720 | | |
721 | | // Note that this constructor CANNOT be explicit, and that Bind() CANNOT |
722 | | // return the exact Callback<> type. See base/bind.h for details. |
723 | | template <typename Runnable, typename BindRunType, typename BoundArgsType> |
724 | | Callback(internal::BindState<Runnable, BindRunType, |
725 | | BoundArgsType>* bind_state) |
726 | | : CallbackBase(bind_state) { |
727 | | |
728 | | // Force the assignment to a local variable of PolymorphicInvoke |
729 | | // so the compiler will typecheck that the passed in Run() method has |
730 | | // the correct type. |
731 | | PolymorphicInvoke invoke_func = |
732 | | &internal::BindState<Runnable, BindRunType, BoundArgsType> |
733 | | ::InvokerType::Run; |
734 | | polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); |
735 | | } |
736 | | |
737 | | bool Equals(const Callback& other) const { |
738 | | return CallbackBase::Equals(other); |
739 | | } |
740 | | |
741 | | R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, |
742 | | typename internal::CallbackParamTraits<A2>::ForwardType a2, |
743 | | typename internal::CallbackParamTraits<A3>::ForwardType a3, |
744 | | typename internal::CallbackParamTraits<A4>::ForwardType a4, |
745 | | typename internal::CallbackParamTraits<A5>::ForwardType a5, |
746 | | typename internal::CallbackParamTraits<A6>::ForwardType a6, |
747 | | typename internal::CallbackParamTraits<A7>::ForwardType a7) const { |
748 | | PolymorphicInvoke f = |
749 | | reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); |
750 | | |
751 | | return f(bind_state_.get(), internal::CallbackForward(a1), |
752 | | internal::CallbackForward(a2), |
753 | | internal::CallbackForward(a3), |
754 | | internal::CallbackForward(a4), |
755 | | internal::CallbackForward(a5), |
756 | | internal::CallbackForward(a6), |
757 | | internal::CallbackForward(a7)); |
758 | | } |
759 | | |
760 | | private: |
761 | | typedef R(*PolymorphicInvoke)( |
762 | | internal::BindStateBase*, |
763 | | typename internal::CallbackParamTraits<A1>::ForwardType, |
764 | | typename internal::CallbackParamTraits<A2>::ForwardType, |
765 | | typename internal::CallbackParamTraits<A3>::ForwardType, |
766 | | typename internal::CallbackParamTraits<A4>::ForwardType, |
767 | | typename internal::CallbackParamTraits<A5>::ForwardType, |
768 | | typename internal::CallbackParamTraits<A6>::ForwardType, |
769 | | typename internal::CallbackParamTraits<A7>::ForwardType); |
770 | | |
771 | | }; |
772 | | |
773 | | |
774 | | // Syntactic sugar to make Callbacks<void(void)> easier to declare since it |
775 | | // will be used in a lot of APIs with delayed execution. |
776 | | typedef Callback<void(void)> Closure; |
777 | | |
778 | | } // namespace yb |
779 | | |
780 | | #endif // YB_GUTIL_CALLBACK_H |