/Users/deen/code/yugabyte-db/src/yb/gutil/callback_internal.h
Line | Count | Source |
1 | | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 | | // Use of this source code is governed by a BSD-style license that can be |
3 | | // found in the LICENSE file. |
4 | | // |
5 | | // The following only applies to changes made to this file as part of YugaByte development. |
6 | | // |
7 | | // Portions Copyright (c) YugaByte, Inc. |
8 | | // |
9 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
10 | | // in compliance with the License. You may obtain a copy of the License at |
11 | | // |
12 | | // http://www.apache.org/licenses/LICENSE-2.0 |
13 | | // |
14 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
15 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
16 | | // or implied. See the License for the specific language governing permissions and limitations |
17 | | // under the License. |
18 | | // |
19 | | |
20 | | // This file contains utility functions and classes that help the |
21 | | // implementation, and management of the Callback objects. |
22 | | |
23 | | #ifndef YB_GUTIL_CALLBACK_INTERNAL_H_ |
24 | | #define YB_GUTIL_CALLBACK_INTERNAL_H_ |
25 | | |
26 | | #include <stddef.h> |
27 | | |
28 | | #include "yb/gutil/ref_counted.h" |
29 | | #include "yb/gutil/template_util.h" |
30 | | #include "yb/gutil/type_traits.h" |
31 | | |
32 | | template <typename T> |
33 | | class ScopedVector; |
34 | | |
35 | | namespace yb { |
36 | | namespace internal { |
37 | | |
38 | | // BindStateBase is used to provide an opaque handle that the Callback |
39 | | // class can use to represent a function object with bound arguments. It |
40 | | // behaves as an existential type that is used by a corresponding |
41 | | // DoInvoke function to perform the function execution. This allows |
42 | | // us to shield the Callback class from the types of the bound argument via |
43 | | // "type erasure." |
44 | | class BindStateBase : public RefCountedThreadSafe<BindStateBase> { |
45 | | protected: |
46 | | friend class RefCountedThreadSafe<BindStateBase>; |
47 | 43.4M | virtual ~BindStateBase() {} |
48 | | }; |
49 | | |
50 | | // Holds the Callback methods that don't require specialization to reduce |
51 | | // template bloat. |
52 | | class CallbackBase { |
53 | | public: |
54 | | // Returns true if Callback is null (doesn't refer to anything). |
55 | | bool is_null() const; |
56 | | |
57 | | // Returns the Callback into an uninitialized state. |
58 | | void Reset(); |
59 | | |
60 | | protected: |
61 | | // In C++, it is safe to cast function pointers to function pointers of |
62 | | // another type. It is not okay to use void*. We create a InvokeFuncStorage |
63 | | // that that can store our function pointer, and then cast it back to |
64 | | // the original type on usage. |
65 | | typedef void(*InvokeFuncStorage)(void); |
66 | | |
67 | | // Returns true if this callback equals |other|. |other| may be null. |
68 | | bool Equals(const CallbackBase& other) const; |
69 | | |
70 | | // Allow initializing of |bind_state_| via the constructor to avoid default |
71 | | // initialization of the scoped_refptr. We do not also initialize |
72 | | // |polymorphic_invoke_| here because doing a normal assignment in the |
73 | | // derived Callback templates makes for much nicer compiler errors. |
74 | | explicit CallbackBase(BindStateBase* bind_state); |
75 | | |
76 | | // Force the destructor to be instantiated inside this translation unit so |
77 | | // that our subclasses will not get inlined versions. Avoids more template |
78 | | // bloat. |
79 | | ~CallbackBase(); |
80 | | |
81 | | scoped_refptr<BindStateBase> bind_state_; |
82 | | InvokeFuncStorage polymorphic_invoke_; |
83 | | }; |
84 | | |
85 | | // A helper template to determine if given type is non-const move-only-type, |
86 | | // i.e. if a value of the given type should be passed via .Pass() in a |
87 | | // destructive way. |
88 | | template <typename T> struct IsMoveOnlyType { |
89 | | template <typename U> |
90 | | static base::YesType Test(const typename U::MoveOnlyTypeForCPP03*); |
91 | | |
92 | | template <typename U> |
93 | | static base::NoType Test(...); |
94 | | |
95 | | static const bool value = sizeof(Test<T>(0)) == sizeof(base::YesType) && |
96 | | !base::is_const<T>::value; |
97 | | }; |
98 | | |
99 | | // This is a typetraits object that's used to take an argument type, and |
100 | | // extract a suitable type for storing and forwarding arguments. |
101 | | // |
102 | | // In particular, it strips off references, and converts arrays to |
103 | | // pointers for storage; and it avoids accidentally trying to create a |
104 | | // "reference of a reference" if the argument is a reference type. |
105 | | // |
106 | | // This array type becomes an issue for storage because we are passing bound |
107 | | // parameters by const reference. In this case, we end up passing an actual |
108 | | // array type in the initializer list which C++ does not allow. This will |
109 | | // break passing of C-string literals. |
110 | | template <typename T, bool is_move_only = IsMoveOnlyType<T>::value> |
111 | | struct CallbackParamTraits { |
112 | | typedef const T& ForwardType; |
113 | | typedef T StorageType; |
114 | | }; |
115 | | |
116 | | // The Storage should almost be impossible to trigger unless someone manually |
117 | | // specifies type of the bind parameters. However, in case they do, |
118 | | // this will guard against us accidentally storing a reference parameter. |
119 | | // |
120 | | // The ForwardType should only be used for unbound arguments. |
121 | | template <typename T> |
122 | | struct CallbackParamTraits<T&, false> { |
123 | | typedef T& ForwardType; |
124 | | typedef T StorageType; |
125 | | }; |
126 | | |
127 | | // Note that for array types, we implicitly add a const in the conversion. This |
128 | | // means that it is not possible to bind array arguments to functions that take |
129 | | // a non-const pointer. Trying to specialize the template based on a "const |
130 | | // T[n]" does not seem to match correctly, so we are stuck with this |
131 | | // restriction. |
132 | | template <typename T, size_t n> |
133 | | struct CallbackParamTraits<T[n], false> { |
134 | | typedef const T* ForwardType; |
135 | | typedef const T* StorageType; |
136 | | }; |
137 | | |
138 | | // See comment for CallbackParamTraits<T[n]>. |
139 | | template <typename T> |
140 | | struct CallbackParamTraits<T[], false> { |
141 | | typedef const T* ForwardType; |
142 | | typedef const T* StorageType; |
143 | | }; |
144 | | |
145 | | // Parameter traits for movable-but-not-copyable scopers. |
146 | | // |
147 | | // Callback<>/Bind() understands movable-but-not-copyable semantics where |
148 | | // the type cannot be copied but can still have its state destructively |
149 | | // transferred (aka. moved) to another instance of the same type by calling a |
150 | | // helper function. When used with Bind(), this signifies transferal of the |
151 | | // object's state to the target function. |
152 | | // |
153 | | // For these types, the ForwardType must not be a const reference, or a |
154 | | // reference. A const reference is inappropriate, and would break const |
155 | | // correctness, because we are implementing a destructive move. A non-const |
156 | | // reference cannot be used with temporaries which means the result of a |
157 | | // function or a cast would not be usable with Callback<> or Bind(). |
158 | | template <typename T> |
159 | | struct CallbackParamTraits<T, true> { |
160 | | typedef T ForwardType; |
161 | | typedef T StorageType; |
162 | | }; |
163 | | |
164 | | // CallbackForward() is a very limited simulation of C++11's std::forward() |
165 | | // used by the Callback/Bind system for a set of movable-but-not-copyable |
166 | | // types. It is needed because forwarding a movable-but-not-copyable |
167 | | // argument to another function requires us to invoke the proper move |
168 | | // operator to create a rvalue version of the type. The supported types are |
169 | | // whitelisted below as overloads of the CallbackForward() function. The |
170 | | // default template compiles out to be a no-op. |
171 | | // |
172 | | // In C++11, std::forward would replace all uses of this function. However, it |
173 | | // is impossible to implement a general std::forward with C++11 due to a lack |
174 | | // of rvalue references. |
175 | | // |
176 | | // In addition to Callback/Bind, this is used by PostTaskAndReplyWithResult to |
177 | | // simulate std::forward() and forward the result of one Callback as a |
178 | | // parameter to another callback. This is to support Callbacks that return |
179 | | // the movable-but-not-copyable types whitelisted above. |
180 | | template <typename T> |
181 | 421M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { |
182 | 421M | return t; |
183 | 421M | } _ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_9consensus12ReplicateMsgEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESA_E4typeERSA_ Line | Count | Source | 181 | 750 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 750 | return t; | 183 | 750 | } |
_ZN2yb8internal15CallbackForwardIKNS_6StatusEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 130M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 130M | return t; | 183 | 130M | } |
mt-log-test.cc:_ZN2yb8internal15CallbackForwardIKPNS_3log12_GLOBAL__N_119CustomLatchCallbackEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES9_E4typeERS9_ Line | Count | Source | 181 | 4.00k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 4.00k | return t; | 183 | 4.00k | } |
_ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_9consensus18StateChangeContextEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESA_E4typeERSA_ Line | Count | Source | 181 | 1.43M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.43M | return t; | 183 | 1.43M | } |
_ZN2yb8internal15CallbackForwardIKPNS_12SynchronizerEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 1.73M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.73M | return t; | 183 | 1.73M | } |
_ZN2yb8internal15CallbackForwardIKNS_8HostPortEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 1.72M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.72M | return t; | 183 | 1.72M | } |
_ZN2yb8internal15CallbackForwardIPNS_12SynchronizerEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 1.70M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.70M | return t; | 183 | 1.70M | } |
_ZN2yb8internal15CallbackForwardIPNS_6master49SystemTableFaultTolerance_TestFaultTolerance_TestEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 2 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 2 | return t; | 183 | 2 | } |
_ZN2yb8internal15CallbackForwardIKNS_8CallbackIFvRKNS_6StatusEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESB_E4typeERSB_ Line | Count | Source | 181 | 39.4M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 39.4M | return t; | 183 | 39.4M | } |
_ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_2ql14ExecutedResultEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESA_E4typeERSA_ Line | Count | Source | 181 | 20.1M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 20.1M | return t; | 183 | 20.1M | } |
Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIPNS_2ql15TestQLStatementEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ _ZN2yb8internal15CallbackForwardIPNS_6tablet14TabletPeerTestEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 22 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 22 | return t; | 183 | 22 | } |
_ZN2yb8internal15CallbackForwardIKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESC_E4typeERSC_ Line | Count | Source | 181 | 2.07M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 2.07M | return t; | 183 | 2.07M | } |
_ZN2yb8internal15CallbackForwardIKyEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES5_E4typeERS5_ Line | Count | Source | 181 | 16.7k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 16.7k | return t; | 183 | 16.7k | } |
_ZN2yb8internal15CallbackForwardIPNS_3RefEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 2 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 2 | return t; | 183 | 2 | } |
_ZN2yb8internal15CallbackForwardIKiEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES5_E4typeERS5_ Line | Count | Source | 181 | 9 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 9 | return t; | 183 | 9 | } |
_ZN2yb8internal15CallbackForwardIKPKcEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 91.0k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 91.0k | return t; | 183 | 91.0k | } |
_ZN2yb8internal15CallbackForwardIKPNS_12RefCountableEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 2 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 2 | return t; | 183 | 2 | } |
_ZN2yb8internal15CallbackForwardIPNS_43FailureDetectorTest_TestDetectsFailure_TestEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 2 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 2 | return t; | 183 | 2 | } |
_ZN2yb8internal15CallbackForwardIKPiEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 15 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 15 | return t; | 183 | 15 | } |
_ZN2yb8internal15CallbackForwardIPiEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES5_E4typeERS5_ Line | Count | Source | 181 | 24 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 24 | return t; | 183 | 24 | } |
_ZN2yb8internal15CallbackForwardIKxEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES5_E4typeERS5_ Line | Count | Source | 181 | 39.4M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 39.4M | return t; | 183 | 39.4M | } |
_ZN2yb8internal15CallbackForwardIKPNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESD_E4typeERSD_ Line | Count | Source | 181 | 6 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 6 | return t; | 183 | 6 | } |
_ZN2yb8internal15CallbackForwardIPKcEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 182k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 182k | return t; | 183 | 182k | } |
_ZN2yb8internal15CallbackForwardIPNS_7PromiseIiEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 2 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 2 | return t; | 183 | 2 | } |
_ZN2yb8internal15CallbackForwardIPNS_9consensus16PeerMessageQueueEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 56.5M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 56.5M | return t; | 183 | 56.5M | } |
_ZN2yb8internal15CallbackForwardIKNS_4OpIdEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 39.4M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 39.4M | return t; | 183 | 39.4M | } |
_ZN2yb8internal15CallbackForwardIKNS_9consensus22MajorityReplicatedDataEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 45.4M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 45.4M | return t; | 183 | 45.4M | } |
_ZN2yb8internal15CallbackForwardIPNS_9consensus8LogCacheEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 26.2M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 26.2M | return t; | 183 | 26.2M | } |
_ZN2yb8internal15CallbackForwardIKPNS_8HostPortEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 6.86k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 6.86k | return t; | 183 | 6.86k | } |
_ZN2yb8internal15CallbackForwardIPNS_3log3LogEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 194k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 194k | return t; | 183 | 194k | } |
_ZN2yb8internal15CallbackForwardIPNS_6master14CatalogManagerEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 8.04k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 8.04k | return t; | 183 | 8.04k | } |
_ZN2yb8internal15CallbackForwardIPNS_6master6MasterEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 10.8k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 10.8k | return t; | 183 | 10.8k | } |
_ZN2yb8internal15CallbackForwardIPNS_6master15SysCatalogTableEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 38.7k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 38.7k | return t; | 183 | 38.7k | } |
Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIPNS_6master10enterprise14CatalogManagerEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS2_6vectorINS_6client11YBTableInfoENS2_9allocatorIS6_EEEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESE_E4typeERSE_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKNSt3__113unordered_mapINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES9_NS2_4hashIS9_EENS2_8equal_toIS9_EENS7_INS2_4pairIKS9_S9_EEEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESM_E4typeERSM_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_6client11YBTableInfoEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESA_E4typeERSA_ _ZN2yb8internal15CallbackForwardIKPKNS_2ql9ParseTreeEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES9_E4typeERS9_ Line | Count | Source | 181 | 329k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 329k | return t; | 183 | 329k | } |
_ZN2yb8internal15CallbackForwardIPNS_2ql11QLProcessorEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 658k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 658k | return t; | 183 | 658k | } |
_ZN2yb8internal15CallbackForwardIKNS_2ql19StatementParametersEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 982k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 982k | return t; | 183 | 982k | } |
_ZN2yb8internal15CallbackForwardIPKNS_2ql9ParseTreeEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Line | Count | Source | 181 | 655k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 655k | return t; | 183 | 655k | } |
_ZN2yb8internal15CallbackForwardIKNS_8CallbackIFvRKNS_6StatusERKNSt3__110shared_ptrINS_2ql14ExecutedResultEEEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESI_E4typeERSI_ Line | Count | Source | 181 | 984k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 984k | return t; | 183 | 984k | } |
Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIPNS_2ql15TestQLProcessorEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIPNS_2ql9ParseTreeEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ _ZN2yb8internal15CallbackForwardIPNS_6server11HybridClockEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 91.7k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 91.7k | return t; | 183 | 91.7k | } |
_ZN2yb8internal15CallbackForwardIPNS_6server12LogicalClockEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 56 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 56 | return t; | 183 | 56 | } |
heartbeater.cc:_ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_7tserver12_GLOBAL__N_120FindLeaderMasterDataEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESB_E4typeERSB_ Line | Count | Source | 181 | 16.2k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 16.2k | return t; | 183 | 16.2k | } |
_ZN2yb8internal15CallbackForwardIKPNS_6tablet14AbstractTabletEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Line | Count | Source | 181 | 42.9k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 42.9k | return t; | 183 | 42.9k | } |
_ZN2yb8internal15CallbackForwardIKPNS_15RedisResponsePBEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 42.9k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 42.9k | return t; | 183 | 42.9k | } |
_ZN2yb8internal15CallbackForwardIKNSt3__18functionIFvRKNS_6StatusEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESC_E4typeERSC_ Line | Count | Source | 181 | 42.9k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 42.9k | return t; | 183 | 42.9k | } |
_ZN2yb8internal15CallbackForwardIPNS_6tablet14AbstractTabletEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 85.8k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 85.8k | return t; | 183 | 85.8k | } |
_ZN2yb8internal15CallbackForwardIKNSt3__16chrono10time_pointINS_15CoarseMonoClockENS3_8durationIxNS2_5ratioILl1ELl1000000000EEEEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESE_E4typeERSE_ Line | Count | Source | 181 | 128k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 128k | return t; | 183 | 128k | } |
_ZN2yb8internal15CallbackForwardIKNS_14ReadHybridTimeEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 128k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 128k | return t; | 183 | 128k | } |
_ZN2yb8internal15CallbackForwardIKNS_18RedisReadRequestPBEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 128k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 128k | return t; | 183 | 128k | } |
_ZN2yb8internal15CallbackForwardIPNS_15RedisResponsePBEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Line | Count | Source | 181 | 85.8k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 85.8k | return t; | 183 | 85.8k | } |
read_query.cc:_ZN2yb8internal15CallbackForwardIKZNS_7tserver12_GLOBAL__N_19ReadQuery10DoReadImplEvE3$_1EERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES9_E4typeERS9_ Line | Count | Source | 181 | 85.8k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 85.8k | return t; | 183 | 85.8k | } |
_ZN2yb8internal15CallbackForwardIPNS_7tserver15TSTabletManagerEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 677k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 677k | return t; | 183 | 677k | } |
_ZN2yb8internal15CallbackForwardIPNS_7tserver26RemoteBootstrapSessionTestEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 24 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 24 | return t; | 183 | 24 | } |
_ZN2yb8internal15CallbackForwardIPNS_9cqlserver12CQLProcessorEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 9.05M | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 9.05M | return t; | 183 | 9.05M | } |
_ZN2yb8internal15CallbackForwardIKPNSt3__110shared_ptrINS_2ql14ExecutedResultEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESB_E4typeERSB_ Line | Count | Source | 181 | 545k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 545k | return t; | 183 | 545k | } |
Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKPNS_6client17YBLoggingCallbackEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIPNS_6client17YBLoggingCallbackEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKNS_11LogSeverityEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES6_E4typeERS6_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKPK2tmEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKmEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES5_E4typeERS5_ _ZN2yb8internal15CallbackForwardIPNS_6client8YBClient4DataEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Line | Count | Source | 181 | 54.6k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 54.6k | return t; | 183 | 54.6k | } |
_ZN2yb8internal15CallbackForwardIPNS_5debug17TraceResultBufferEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 696 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 696 | return t; | 183 | 696 | } |
_ZN2yb8internal15CallbackForwardIK13scoped_refptrINS_16RefCountedStringEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Line | Count | Source | 181 | 1.39k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.39k | return t; | 183 | 1.39k | } |
_ZN2yb8internal15CallbackForwardIKbEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES5_E4typeERS5_ Line | Count | Source | 181 | 1.39k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.39k | return t; | 183 | 1.39k | } |
_ZN2yb8internal15CallbackForwardIKPNS_5debug15TraceBucketDataEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES8_E4typeERS8_ Line | Count | Source | 181 | 1.21k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 1.21k | return t; | 183 | 1.21k | } |
_ZN2yb8internal15CallbackForwardIPNS_5debug8TraceLogEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 16 | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 16 | return t; | 183 | 16 | } |
thread.cc:_ZN2yb8internal15CallbackForwardIPNS_12_GLOBAL__N_19ThreadMgrEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 60.6k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 60.6k | return t; | 183 | 60.6k | } |
Unexecuted instantiation: _ZN2yb8internal15CallbackForwardIKNSt3__18weak_ptrINS_12SynchronizerEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES9_E4typeERS9_ _ZN2yb8internal15CallbackForwardIK13scoped_refptrINS_5tools22ChecksumResultReporterEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES9_E4typeERS9_ Line | Count | Source | 181 | 4.19k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 4.19k | return t; | 183 | 4.19k | } |
_ZN2yb8internal15CallbackForwardIPNS_5tools22ChecksumResultReporterEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 8.38k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 8.38k | return t; | 183 | 8.38k | } |
_ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_5tools16YsckTabletServerEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESA_E4typeERSA_ Line | Count | Source | 181 | 12.5k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 12.5k | return t; | 183 | 12.5k | } |
_ZN2yb8internal15CallbackForwardIKNSt3__110shared_ptrINS_13BlockingQueueINS2_4pairINS_6SchemaENS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEENS_18DefaultLogicalSizeEEEEEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueESK_E4typeERSK_ Line | Count | Source | 181 | 12.5k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 12.5k | return t; | 183 | 12.5k | } |
_ZN2yb8internal15CallbackForwardIKNS_5tools15ChecksumOptionsEEERN4base9enable_ifIXntsr14IsMoveOnlyTypeIT_EE5valueES7_E4typeERS7_ Line | Count | Source | 181 | 12.5k | typename base::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(T& t) { | 182 | 12.5k | return t; | 183 | 12.5k | } |
|
184 | | |
185 | | template <typename T> |
186 | | typename base::enable_if<IsMoveOnlyType<T>::value, T>::type CallbackForward(T& t) { |
187 | | return t.Pass(); |
188 | | } |
189 | | |
190 | | } // namespace internal |
191 | | } // namespace yb |
192 | | |
193 | | #endif // YB_GUTIL_CALLBACK_INTERNAL_H_ |