YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/gutil/bind.h
Line
Count
Source (jump to first uncovered line)
1
// This file was GENERATED by command:
2
//     pump.py bind.h.pump
3
// DO NOT EDIT BY HAND!!!
4
5
6
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
7
// Use of this source code is governed by a BSD-style license that can be
8
// 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_BIND_H_
26
#define YB_GUTIL_BIND_H_
27
28
#include "yb/gutil/bind_internal.h"
29
#include "yb/gutil/callback_internal.h"
30
31
// -----------------------------------------------------------------------------
32
// Usage documentation
33
// -----------------------------------------------------------------------------
34
//
35
// See yb/gutil/callback.h for documentation.
36
//
37
//
38
// -----------------------------------------------------------------------------
39
// Implementation notes
40
// -----------------------------------------------------------------------------
41
//
42
// If you're reading the implementation, before proceeding further, you should
43
// read the top comment of yb/gutil/bind_internal.h for a definition of common
44
// terms and concepts.
45
//
46
// RETURN TYPES
47
//
48
// Though Bind()'s result is meant to be stored in a Callback<> type, it
49
// cannot actually return the exact type without requiring a large amount
50
// of extra template specializations. The problem is that in order to
51
// discern the correct specialization of Callback<>, Bind would need to
52
// unwrap the function signature to determine the signature's arity, and
53
// whether or not it is a method.
54
//
55
// Each unique combination of (arity, function_type, num_prebound) where
56
// function_type is one of {function, method, const_method} would require
57
// one specialization.  We eventually have to do a similar number of
58
// specializations anyways in the implementation (see the Invoker<>,
59
// classes).  However, it is avoidable in Bind if we return the result
60
// via an indirection like we do below.
61
//
62
// TODO(ajwong): We might be able to avoid this now, but need to test.
63
//
64
// It is possible to move most of the COMPILE_ASSERT asserts into BindState<>,
65
// but it feels a little nicer to have the asserts here so people do not
66
// need to crack open bind_internal.h.  On the other hand, it makes Bind()
67
// harder to read.
68
69
namespace yb {
70
71
template <typename Functor>
72
Callback<
73
    typename internal::BindState<
74
        typename internal::FunctorTraits<Functor>::RunnableType,
75
        typename internal::FunctorTraits<Functor>::RunType,
76
        void()>
77
            ::UnboundRunType>
78
132k
Bind(Functor functor) {
79
  // Typedefs for how to store and run the functor.
80
132k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
81
132k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
82
83
132k
  typedef internal::BindState<RunnableType, RunType, void()> BindState;
84
85
86
132k
  return Callback<typename BindState::UnboundRunType>(
87
132k
      new BindState(internal::MakeRunnable(functor)));
88
132k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (*)(yb::debug::TraceBucketData*)>::RunnableType, yb::internal::FunctorTraits<void (*)(yb::debug::TraceBucketData*)>::RunType, void ()>::UnboundRunType> yb::Bind<void (*)(yb::debug::TraceBucketData*)>(void (*)(yb::debug::TraceBucketData*))
Line
Count
Source
78
3
Bind(Functor functor) {
79
  // Typedefs for how to store and run the functor.
80
3
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
81
3
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
82
83
3
  typedef internal::BindState<RunnableType, RunType, void()> BindState;
84
85
86
3
  return Callback<typename BindState::UnboundRunType>(
87
3
      new BindState(internal::MakeRunnable(functor)));
88
3
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<unsigned long long (*)()>::RunnableType, yb::internal::FunctorTraits<unsigned long long (*)()>::RunType, void ()>::UnboundRunType> yb::Bind<unsigned long long (*)()>(unsigned long long (*)())
Line
Count
Source
78
132k
Bind(Functor functor) {
79
  // Typedefs for how to store and run the functor.
80
132k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
81
132k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
82
83
132k
  typedef internal::BindState<RunnableType, RunType, void()> BindState;
84
85
86
132k
  return Callback<typename BindState::UnboundRunType>(
87
132k
      new BindState(internal::MakeRunnable(functor)));
88
132k
}
89
90
template <typename Functor, typename P1>
91
Callback<
92
    typename internal::BindState<
93
        typename internal::FunctorTraits<Functor>::RunnableType,
94
        typename internal::FunctorTraits<Functor>::RunType,
95
        void(typename internal::CallbackParamTraits<P1>::StorageType)>
96
            ::UnboundRunType>
97
1.85M
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
1.85M
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
1.85M
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
1.85M
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
1.85M
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
1.85M
  COMPILE_ASSERT(
114
1.85M
      !(base::is_non_const_reference<typename
115
1.85M
          BoundFunctorTraits::A1Type>::value ),
116
1.85M
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
1.85M
  COMPILE_ASSERT(
123
1.85M
      internal::HasIsMethodTag<RunnableType>::value ||
124
1.85M
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
1.85M
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
1.85M
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
1.85M
                     !base::is_array<P1>::value,
128
1.85M
                 first_bound_argument_to_method_cannot_be_array);
129
1.85M
  typedef internal::BindState<RunnableType, RunType,
130
1.85M
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
1.85M
  return Callback<typename BindState::UnboundRunType>(
134
1.85M
      new BindState(internal::MakeRunnable(functor), p1));
135
1.85M
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<unsigned long long (yb::server::HybridClock::*)()>::RunnableType, yb::internal::FunctorTraits<unsigned long long (yb::server::HybridClock::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::server::HybridClock>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::server::HybridClock> >::value>::StorageType)>::UnboundRunType> yb::Bind<unsigned long long (yb::server::HybridClock::*)(), yb::internal::UnretainedWrapper<yb::server::HybridClock> >(unsigned long long (yb::server::HybridClock::*)(), yb::internal::UnretainedWrapper<yb::server::HybridClock> const&)
Line
Count
Source
97
51.5k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
51.5k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
51.5k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
51.5k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
51.5k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
51.5k
  COMPILE_ASSERT(
114
51.5k
      !(base::is_non_const_reference<typename
115
51.5k
          BoundFunctorTraits::A1Type>::value ),
116
51.5k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
51.5k
  COMPILE_ASSERT(
123
51.5k
      internal::HasIsMethodTag<RunnableType>::value ||
124
51.5k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
51.5k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
51.5k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
51.5k
                     !base::is_array<P1>::value,
128
51.5k
                 first_bound_argument_to_method_cannot_be_array);
129
51.5k
  typedef internal::BindState<RunnableType, RunType,
130
51.5k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
51.5k
  return Callback<typename BindState::UnboundRunType>(
134
51.5k
      new BindState(internal::MakeRunnable(functor), p1));
135
51.5k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<unsigned long long (*)(unsigned long long)>::RunnableType, yb::internal::FunctorTraits<unsigned long long (*)(unsigned long long)>::RunType, void (yb::internal::CallbackParamTraits<unsigned long long, IsMoveOnlyType<unsigned long long>::value>::StorageType)>::UnboundRunType> yb::Bind<unsigned long long (*)(unsigned long long), unsigned long long>(unsigned long long (*)(unsigned long long), unsigned long long const&)
Line
Count
Source
97
331
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
331
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
331
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
331
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
331
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
331
  COMPILE_ASSERT(
114
331
      !(base::is_non_const_reference<typename
115
331
          BoundFunctorTraits::A1Type>::value ),
116
331
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
331
  COMPILE_ASSERT(
123
331
      internal::HasIsMethodTag<RunnableType>::value ||
124
331
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
331
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
331
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
331
                     !base::is_array<P1>::value,
128
331
                 first_bound_argument_to_method_cannot_be_array);
129
331
  typedef internal::BindState<RunnableType, RunType,
130
331
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
331
  return Callback<typename BindState::UnboundRunType>(
134
331
      new BindState(internal::MakeRunnable(functor), p1));
135
331
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<long long (yb::server::HybridClock::*)()>::RunnableType, yb::internal::FunctorTraits<long long (yb::server::HybridClock::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::server::HybridClock>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::server::HybridClock> >::value>::StorageType)>::UnboundRunType> yb::Bind<long long (yb::server::HybridClock::*)(), yb::internal::UnretainedWrapper<yb::server::HybridClock> >(long long (yb::server::HybridClock::*)(), yb::internal::UnretainedWrapper<yb::server::HybridClock> const&)
Line
Count
Source
97
25.7k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
25.7k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
25.7k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
25.7k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
25.7k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
25.7k
  COMPILE_ASSERT(
114
25.7k
      !(base::is_non_const_reference<typename
115
25.7k
          BoundFunctorTraits::A1Type>::value ),
116
25.7k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
25.7k
  COMPILE_ASSERT(
123
25.7k
      internal::HasIsMethodTag<RunnableType>::value ||
124
25.7k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
25.7k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
25.7k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
25.7k
                     !base::is_array<P1>::value,
128
25.7k
                 first_bound_argument_to_method_cannot_be_array);
129
25.7k
  typedef internal::BindState<RunnableType, RunType,
130
25.7k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
25.7k
  return Callback<typename BindState::UnboundRunType>(
134
25.7k
      new BindState(internal::MakeRunnable(functor), p1));
135
25.7k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<long long (*)(long long)>::RunnableType, yb::internal::FunctorTraits<long long (*)(long long)>::RunType, void (yb::internal::CallbackParamTraits<long long, IsMoveOnlyType<long long>::value>::StorageType)>::UnboundRunType> yb::Bind<long long (*)(long long), long long>(long long (*)(long long), long long const&)
Line
Count
Source
97
164
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
164
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
164
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
164
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
164
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
164
  COMPILE_ASSERT(
114
164
      !(base::is_non_const_reference<typename
115
164
          BoundFunctorTraits::A1Type>::value ),
116
164
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
164
  COMPILE_ASSERT(
123
164
      internal::HasIsMethodTag<RunnableType>::value ||
124
164
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
164
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
164
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
164
                     !base::is_array<P1>::value,
128
164
                 first_bound_argument_to_method_cannot_be_array);
129
164
  typedef internal::BindState<RunnableType, RunType,
130
164
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
164
  return Callback<typename BindState::UnboundRunType>(
134
164
      new BindState(internal::MakeRunnable(functor), p1));
135
164
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<unsigned long long (yb::server::LogicalClock::*)()>::RunnableType, yb::internal::FunctorTraits<unsigned long long (yb::server::LogicalClock::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::server::LogicalClock>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::server::LogicalClock> >::value>::StorageType)>::UnboundRunType> yb::Bind<unsigned long long (yb::server::LogicalClock::*)(), yb::internal::UnretainedWrapper<yb::server::LogicalClock> >(unsigned long long (yb::server::LogicalClock::*)(), yb::internal::UnretainedWrapper<yb::server::LogicalClock> const&)
Line
Count
Source
97
72
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
72
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
72
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
72
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
72
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
72
  COMPILE_ASSERT(
114
72
      !(base::is_non_const_reference<typename
115
72
          BoundFunctorTraits::A1Type>::value ),
116
72
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
72
  COMPILE_ASSERT(
123
72
      internal::HasIsMethodTag<RunnableType>::value ||
124
72
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
72
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
72
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
72
                     !base::is_array<P1>::value,
128
72
                 first_bound_argument_to_method_cannot_be_array);
129
72
  typedef internal::BindState<RunnableType, RunType,
130
72
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
72
  return Callback<typename BindState::UnboundRunType>(
134
72
      new BindState(internal::MakeRunnable(functor), p1));
135
72
}
heartbeater.cc:yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (*)(std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&)>::RunnableType, yb::internal::FunctorTraits<void (*)(std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&)>::RunType, void (yb::internal::CallbackParamTraits<std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData>, IsMoveOnlyType<std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (*)(std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&), std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> >(void (*)(std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&, yb::Status const&, yb::HostPort const&), std::__1::shared_ptr<yb::tserver::(anonymous namespace)::FindLeaderMasterData> const&)
Line
Count
Source
97
418k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
418k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
418k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
418k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
418k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
418k
  COMPILE_ASSERT(
114
418k
      !(base::is_non_const_reference<typename
115
418k
          BoundFunctorTraits::A1Type>::value ),
116
418k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
418k
  COMPILE_ASSERT(
123
418k
      internal::HasIsMethodTag<RunnableType>::value ||
124
418k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
418k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
418k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
418k
                     !base::is_array<P1>::value,
128
418k
                 first_bound_argument_to_method_cannot_be_array);
129
418k
  typedef internal::BindState<RunnableType, RunType,
130
418k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
418k
  return Callback<typename BindState::UnboundRunType>(
134
418k
      new BindState(internal::MakeRunnable(functor), p1));
135
418k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<unsigned long long (*)(char const*)>::RunnableType, yb::internal::FunctorTraits<unsigned long long (*)(char const*)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<char const>, IsMoveOnlyType<yb::internal::UnretainedWrapper<char const> >::value>::StorageType)>::UnboundRunType> yb::Bind<unsigned long long (*)(char const*), yb::internal::UnretainedWrapper<char const> >(unsigned long long (*)(char const*), yb::internal::UnretainedWrapper<char const> const&)
Line
Count
Source
97
158k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
158k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
158k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
158k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
158k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
158k
  COMPILE_ASSERT(
114
158k
      !(base::is_non_const_reference<typename
115
158k
          BoundFunctorTraits::A1Type>::value ),
116
158k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
158k
  COMPILE_ASSERT(
123
158k
      internal::HasIsMethodTag<RunnableType>::value ||
124
158k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
158k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
158k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
158k
                     !base::is_array<P1>::value,
128
158k
                 first_bound_argument_to_method_cannot_be_array);
129
158k
  typedef internal::BindState<RunnableType, RunType,
130
158k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
158k
  return Callback<typename BindState::UnboundRunType>(
134
158k
      new BindState(internal::MakeRunnable(functor), p1));
135
158k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<yb::Status (yb::master::CatalogManager::*)()>::RunnableType, yb::internal::FunctorTraits<yb::Status (yb::master::CatalogManager::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::CatalogManager>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::CatalogManager> >::value>::StorageType)>::UnboundRunType> yb::Bind<yb::Status (yb::master::CatalogManager::*)(), yb::internal::UnretainedWrapper<yb::master::CatalogManager> >(yb::Status (yb::master::CatalogManager::*)(), yb::internal::UnretainedWrapper<yb::master::CatalogManager> const&)
Line
Count
Source
97
8.07k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
8.07k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
8.07k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
8.07k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
8.07k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
8.07k
  COMPILE_ASSERT(
114
8.07k
      !(base::is_non_const_reference<typename
115
8.07k
          BoundFunctorTraits::A1Type>::value ),
116
8.07k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
8.07k
  COMPILE_ASSERT(
123
8.07k
      internal::HasIsMethodTag<RunnableType>::value ||
124
8.07k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
8.07k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
8.07k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
8.07k
                     !base::is_array<P1>::value,
128
8.07k
                 first_bound_argument_to_method_cannot_be_array);
129
8.07k
  typedef internal::BindState<RunnableType, RunType,
130
8.07k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
8.07k
  return Callback<typename BindState::UnboundRunType>(
134
8.07k
      new BindState(internal::MakeRunnable(functor), p1));
135
8.07k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::master::CatalogManager::*)()>::RunnableType, yb::internal::FunctorTraits<void (yb::master::CatalogManager::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::CatalogManager>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::CatalogManager> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::master::CatalogManager::*)(), yb::internal::UnretainedWrapper<yb::master::CatalogManager> >(void (yb::master::CatalogManager::*)(), yb::internal::UnretainedWrapper<yb::master::CatalogManager> const&)
Line
Count
Source
97
3.02k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
3.02k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
3.02k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
3.02k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
3.02k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
3.02k
  COMPILE_ASSERT(
114
3.02k
      !(base::is_non_const_reference<typename
115
3.02k
          BoundFunctorTraits::A1Type>::value ),
116
3.02k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
3.02k
  COMPILE_ASSERT(
123
3.02k
      internal::HasIsMethodTag<RunnableType>::value ||
124
3.02k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
3.02k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
3.02k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
3.02k
                     !base::is_array<P1>::value,
128
3.02k
                 first_bound_argument_to_method_cannot_be_array);
129
3.02k
  typedef internal::BindState<RunnableType, RunType,
130
3.02k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
3.02k
  return Callback<typename BindState::UnboundRunType>(
134
3.02k
      new BindState(internal::MakeRunnable(functor), p1));
135
3.02k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::master::Master::*)()>::RunnableType, yb::internal::FunctorTraits<void (yb::master::Master::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::Master>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::Master> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::master::Master::*)(), yb::internal::UnretainedWrapper<yb::master::Master> >(void (yb::master::Master::*)(), yb::internal::UnretainedWrapper<yb::master::Master> const&)
Line
Count
Source
97
8.03k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
8.03k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
8.03k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
8.03k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
8.03k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
8.03k
  COMPILE_ASSERT(
114
8.03k
      !(base::is_non_const_reference<typename
115
8.03k
          BoundFunctorTraits::A1Type>::value ),
116
8.03k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
8.03k
  COMPILE_ASSERT(
123
8.03k
      internal::HasIsMethodTag<RunnableType>::value ||
124
8.03k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
8.03k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
8.03k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
8.03k
                     !base::is_array<P1>::value,
128
8.03k
                 first_bound_argument_to_method_cannot_be_array);
129
8.03k
  typedef internal::BindState<RunnableType, RunType,
130
8.03k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
8.03k
  return Callback<typename BindState::UnboundRunType>(
134
8.03k
      new BindState(internal::MakeRunnable(functor), p1));
135
8.03k
}
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (*)(yb::client::YBLoggingCallback*, yb::LogSeverity, char const*, int, tm const*, char const*, unsigned long)>::RunnableType, yb::internal::FunctorTraits<void (*)(yb::client::YBLoggingCallback*, yb::LogSeverity, char const*, int, tm const*, char const*, unsigned long)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::client::YBLoggingCallback>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::client::YBLoggingCallback> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (*)(yb::client::YBLoggingCallback*, yb::LogSeverity, char const*, int, tm const*, char const*, unsigned long), yb::internal::UnretainedWrapper<yb::client::YBLoggingCallback> >(void (*)(yb::client::YBLoggingCallback*, yb::LogSeverity, char const*, int, tm const*, char const*, unsigned long), yb::internal::UnretainedWrapper<yb::client::YBLoggingCallback> const&)
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::client::YBClient::Data::*)(yb::Status const&, yb::HostPort const&)>::RunnableType, yb::internal::FunctorTraits<void (yb::client::YBClient::Data::*)(yb::Status const&, yb::HostPort const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::client::YBClient::Data>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::client::YBClient::Data> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::client::YBClient::Data::*)(yb::Status const&, yb::HostPort const&), yb::internal::UnretainedWrapper<yb::client::YBClient::Data> >(void (yb::client::YBClient::Data::*)(yb::Status const&, yb::HostPort const&), yb::internal::UnretainedWrapper<yb::client::YBClient::Data> const&)
Line
Count
Source
97
41.7k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
41.7k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
41.7k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
41.7k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
41.7k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
41.7k
  COMPILE_ASSERT(
114
41.7k
      !(base::is_non_const_reference<typename
115
41.7k
          BoundFunctorTraits::A1Type>::value ),
116
41.7k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
41.7k
  COMPILE_ASSERT(
123
41.7k
      internal::HasIsMethodTag<RunnableType>::value ||
124
41.7k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
41.7k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
41.7k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
41.7k
                     !base::is_array<P1>::value,
128
41.7k
                 first_bound_argument_to_method_cannot_be_array);
129
41.7k
  typedef internal::BindState<RunnableType, RunType,
130
41.7k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
41.7k
  return Callback<typename BindState::UnboundRunType>(
134
41.7k
      new BindState(internal::MakeRunnable(functor), p1));
135
41.7k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::debug::TraceResultBuffer::*)(scoped_refptr<yb::RefCountedString> const&, bool)>::RunnableType, yb::internal::FunctorTraits<void (yb::debug::TraceResultBuffer::*)(scoped_refptr<yb::RefCountedString> const&, bool)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::debug::TraceResultBuffer>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::debug::TraceResultBuffer> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::debug::TraceResultBuffer::*)(scoped_refptr<yb::RefCountedString> const&, bool), yb::internal::UnretainedWrapper<yb::debug::TraceResultBuffer> >(void (yb::debug::TraceResultBuffer::*)(scoped_refptr<yb::RefCountedString> const&, bool), yb::internal::UnretainedWrapper<yb::debug::TraceResultBuffer> const&)
Line
Count
Source
97
23
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
23
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
23
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
23
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
23
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
23
  COMPILE_ASSERT(
114
23
      !(base::is_non_const_reference<typename
115
23
          BoundFunctorTraits::A1Type>::value ),
116
23
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
23
  COMPILE_ASSERT(
123
23
      internal::HasIsMethodTag<RunnableType>::value ||
124
23
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
23
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
23
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
23
                     !base::is_array<P1>::value,
128
23
                 first_bound_argument_to_method_cannot_be_array);
129
23
  typedef internal::BindState<RunnableType, RunType,
130
23
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
23
  return Callback<typename BindState::UnboundRunType>(
134
23
      new BindState(internal::MakeRunnable(functor), p1));
135
23
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::debug::TraceLog::*)()>::RunnableType, yb::internal::FunctorTraits<void (yb::debug::TraceLog::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::debug::TraceLog>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::debug::TraceLog> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::debug::TraceLog::*)(), yb::internal::UnretainedWrapper<yb::debug::TraceLog> >(void (yb::debug::TraceLog::*)(), yb::internal::UnretainedWrapper<yb::debug::TraceLog> const&)
Line
Count
Source
97
8
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
8
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
8
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
8
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
8
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
8
  COMPILE_ASSERT(
114
8
      !(base::is_non_const_reference<typename
115
8
          BoundFunctorTraits::A1Type>::value ),
116
8
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
8
  COMPILE_ASSERT(
123
8
      internal::HasIsMethodTag<RunnableType>::value ||
124
8
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
8
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
8
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
8
                     !base::is_array<P1>::value,
128
8
                 first_bound_argument_to_method_cannot_be_array);
129
8
  typedef internal::BindState<RunnableType, RunType,
130
8
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
8
  return Callback<typename BindState::UnboundRunType>(
134
8
      new BindState(internal::MakeRunnable(functor), p1));
135
8
}
thread.cc:yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<unsigned long long (yb::(anonymous namespace)::ThreadMgr::*)()>::RunnableType, yb::internal::FunctorTraits<unsigned long long (yb::(anonymous namespace)::ThreadMgr::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::(anonymous namespace)::ThreadMgr>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::(anonymous namespace)::ThreadMgr> >::value>::StorageType)>::UnboundRunType> yb::Bind<unsigned long long (yb::(anonymous namespace)::ThreadMgr::*)(), yb::internal::UnretainedWrapper<yb::(anonymous namespace)::ThreadMgr> >(unsigned long long (yb::(anonymous namespace)::ThreadMgr::*)(), yb::internal::UnretainedWrapper<yb::(anonymous namespace)::ThreadMgr> const&)
Line
Count
Source
97
52.8k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
52.8k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
52.8k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
52.8k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
52.8k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
52.8k
  COMPILE_ASSERT(
114
52.8k
      !(base::is_non_const_reference<typename
115
52.8k
          BoundFunctorTraits::A1Type>::value ),
116
52.8k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
52.8k
  COMPILE_ASSERT(
123
52.8k
      internal::HasIsMethodTag<RunnableType>::value ||
124
52.8k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
52.8k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
52.8k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
52.8k
                     !base::is_array<P1>::value,
128
52.8k
                 first_bound_argument_to_method_cannot_be_array);
129
52.8k
  typedef internal::BindState<RunnableType, RunType,
130
52.8k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
52.8k
  return Callback<typename BindState::UnboundRunType>(
134
52.8k
      new BindState(internal::MakeRunnable(functor), p1));
135
52.8k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::Synchronizer::*)(yb::Status const&)>::RunnableType, yb::internal::FunctorTraits<void (yb::Synchronizer::*)(yb::Status const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::Synchronizer>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::Synchronizer> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::Synchronizer::*)(yb::Status const&), yb::internal::UnretainedWrapper<yb::Synchronizer> >(void (yb::Synchronizer::*)(yb::Status const&), yb::internal::UnretainedWrapper<yb::Synchronizer> const&)
Line
Count
Source
97
907k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
907k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
907k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
907k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
907k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
907k
  COMPILE_ASSERT(
114
907k
      !(base::is_non_const_reference<typename
115
907k
          BoundFunctorTraits::A1Type>::value ),
116
907k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
907k
  COMPILE_ASSERT(
123
907k
      internal::HasIsMethodTag<RunnableType>::value ||
124
907k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
907k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
907k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
907k
                     !base::is_array<P1>::value,
128
907k
                 first_bound_argument_to_method_cannot_be_array);
129
907k
  typedef internal::BindState<RunnableType, RunType,
130
907k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
907k
  return Callback<typename BindState::UnboundRunType>(
134
907k
      new BindState(internal::MakeRunnable(functor), p1));
135
907k
}
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (*)(std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&)>::RunnableType, yb::internal::FunctorTraits<void (*)(std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&)>::RunType, void (yb::internal::CallbackParamTraits<std::__1::weak_ptr<yb::Synchronizer>, IsMoveOnlyType<std::__1::weak_ptr<yb::Synchronizer> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (*)(std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&), std::__1::weak_ptr<yb::Synchronizer> >(void (*)(std::__1::weak_ptr<yb::Synchronizer>, yb::Status const&), std::__1::weak_ptr<yb::Synchronizer> const&)
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::cqlserver::CQLProcessor::*)(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::RunnableType, yb::internal::FunctorTraits<void (yb::cqlserver::CQLProcessor::*)(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::cqlserver::CQLProcessor>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::cqlserver::CQLProcessor> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::cqlserver::CQLProcessor::*)(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), yb::internal::UnretainedWrapper<yb::cqlserver::CQLProcessor> >(void (yb::cqlserver::CQLProcessor::*)(yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), yb::internal::UnretainedWrapper<yb::cqlserver::CQLProcessor> const&)
Line
Count
Source
97
17.9k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
17.9k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
17.9k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
17.9k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
17.9k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
17.9k
  COMPILE_ASSERT(
114
17.9k
      !(base::is_non_const_reference<typename
115
17.9k
          BoundFunctorTraits::A1Type>::value ),
116
17.9k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
17.9k
  COMPILE_ASSERT(
123
17.9k
      internal::HasIsMethodTag<RunnableType>::value ||
124
17.9k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
17.9k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
17.9k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
17.9k
                     !base::is_array<P1>::value,
128
17.9k
                 first_bound_argument_to_method_cannot_be_array);
129
17.9k
  typedef internal::BindState<RunnableType, RunType,
130
17.9k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
17.9k
  return Callback<typename BindState::UnboundRunType>(
134
17.9k
      new BindState(internal::MakeRunnable(functor), p1));
135
17.9k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::log::Log::*)()>::RunnableType, yb::internal::FunctorTraits<void (yb::log::Log::*)()>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::log::Log>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::log::Log> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::log::Log::*)(), yb::internal::UnretainedWrapper<yb::log::Log> >(void (yb::log::Log::*)(), yb::internal::UnretainedWrapper<yb::log::Log> const&)
Line
Count
Source
97
159k
Bind(Functor functor, const P1& p1) {
98
  // Typedefs for how to store and run the functor.
99
159k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
100
159k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
101
102
  // Use RunnableType::RunType instead of RunType above because our
103
  // checks should below for bound references need to know what the actual
104
  // functor is going to interpret the argument as.
105
159k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
106
159k
      BoundFunctorTraits;
107
108
  // Do not allow binding a non-const reference parameter. Non-const reference
109
  // parameters are disallowed by the Google style guide.  Also, binding a
110
  // non-const reference parameter can make for subtle bugs because the
111
  // invoked function will receive a reference to the stored copy of the
112
  // argument and not the original.
113
159k
  COMPILE_ASSERT(
114
159k
      !(base::is_non_const_reference<typename
115
159k
          BoundFunctorTraits::A1Type>::value ),
116
159k
      do_not_bind_functions_with_nonconst_ref);
117
118
  // For methods, we need to be careful for parameter 1.  We do not require
119
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
120
  // methods. We also disallow binding of an array as the method's target
121
  // object.
122
159k
  COMPILE_ASSERT(
123
159k
      internal::HasIsMethodTag<RunnableType>::value ||
124
159k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
125
159k
      p1_is_refcounted_type_and_needs_scoped_refptr);
126
159k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
127
159k
                     !base::is_array<P1>::value,
128
159k
                 first_bound_argument_to_method_cannot_be_array);
129
159k
  typedef internal::BindState<RunnableType, RunType,
130
159k
      void(typename internal::CallbackParamTraits<P1>::StorageType)> BindState;
131
132
133
159k
  return Callback<typename BindState::UnboundRunType>(
134
159k
      new BindState(internal::MakeRunnable(functor), p1));
135
159k
}
136
137
template <typename Functor, typename P1, typename P2>
138
Callback<
139
    typename internal::BindState<
140
        typename internal::FunctorTraits<Functor>::RunnableType,
141
        typename internal::FunctorTraits<Functor>::RunType,
142
        void(typename internal::CallbackParamTraits<P1>::StorageType,
143
            typename internal::CallbackParamTraits<P2>::StorageType)>
144
            ::UnboundRunType>
145
59.3M
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
59.3M
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
59.3M
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
59.3M
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
59.3M
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
59.3M
  COMPILE_ASSERT(
162
59.3M
      !(base::is_non_const_reference<typename
163
59.3M
          BoundFunctorTraits::A1Type>::value ||
164
59.3M
          base::is_non_const_reference<typename
165
59.3M
          BoundFunctorTraits::A2Type>::value ),
166
59.3M
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
59.3M
  COMPILE_ASSERT(
173
59.3M
      internal::HasIsMethodTag<RunnableType>::value ||
174
59.3M
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
59.3M
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
59.3M
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
59.3M
                     !base::is_array<P1>::value,
178
59.3M
                 first_bound_argument_to_method_cannot_be_array);
179
59.3M
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
59.3M
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
59.3M
  typedef internal::BindState<RunnableType, RunType,
182
59.3M
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
59.3M
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
59.3M
  return Callback<typename BindState::UnboundRunType>(
187
59.3M
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
59.3M
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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>)>::RunnableType, yb::internal::FunctorTraits<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>)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::tserver::TSTabletManager>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::tserver::TSTabletManager> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType)>::UnboundRunType> yb::Bind<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>), yb::internal::UnretainedWrapper<yb::tserver::TSTabletManager>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(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>), yb::internal::UnretainedWrapper<yb::tserver::TSTabletManager> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Line
Count
Source
145
142k
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
142k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
142k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
142k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
142k
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
142k
  COMPILE_ASSERT(
162
142k
      !(base::is_non_const_reference<typename
163
142k
          BoundFunctorTraits::A1Type>::value ||
164
142k
          base::is_non_const_reference<typename
165
142k
          BoundFunctorTraits::A2Type>::value ),
166
142k
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
142k
  COMPILE_ASSERT(
173
142k
      internal::HasIsMethodTag<RunnableType>::value ||
174
142k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
142k
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
142k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
142k
                     !base::is_array<P1>::value,
178
142k
                 first_bound_argument_to_method_cannot_be_array);
179
142k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
142k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
142k
  typedef internal::BindState<RunnableType, RunType,
182
142k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
142k
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
142k
  return Callback<typename BindState::UnboundRunType>(
187
142k
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
142k
}
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::ql::TestQLProcessor::*)(yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::RunnableType, yb::internal::FunctorTraits<void (yb::ql::TestQLProcessor::*)(yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::ql::TestQLProcessor>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::ql::TestQLProcessor> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::Callback<void (yb::Status const&)>, IsMoveOnlyType<yb::Callback<void (yb::Status const&)> >::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::ql::TestQLProcessor::*)(yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), yb::internal::UnretainedWrapper<yb::ql::TestQLProcessor>, yb::Callback<void (yb::Status const&)> >(void (yb::ql::TestQLProcessor::*)(yb::Callback<void (yb::Status const&)>, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), yb::internal::UnretainedWrapper<yb::ql::TestQLProcessor> const&, yb::Callback<void (yb::Status const&)> const&)
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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>)>::RunnableType, yb::internal::FunctorTraits<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>)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::tserver::RemoteBootstrapSessionTest>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::tserver::RemoteBootstrapSessionTest> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType)>::UnboundRunType> yb::Bind<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>), yb::internal::UnretainedWrapper<yb::tserver::RemoteBootstrapSessionTest>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(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>), yb::internal::UnretainedWrapper<yb::tserver::RemoteBootstrapSessionTest> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Line
Count
Source
145
4
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
4
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
4
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
4
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
4
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
4
  COMPILE_ASSERT(
162
4
      !(base::is_non_const_reference<typename
163
4
          BoundFunctorTraits::A1Type>::value ||
164
4
          base::is_non_const_reference<typename
165
4
          BoundFunctorTraits::A2Type>::value ),
166
4
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
4
  COMPILE_ASSERT(
173
4
      internal::HasIsMethodTag<RunnableType>::value ||
174
4
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
4
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
4
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
4
                     !base::is_array<P1>::value,
178
4
                 first_bound_argument_to_method_cannot_be_array);
179
4
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
4
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
4
  typedef internal::BindState<RunnableType, RunType,
182
4
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
4
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
4
  return Callback<typename BindState::UnboundRunType>(
187
4
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
4
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::consensus::PeerMessageQueue::*)(yb::OpId const&, yb::Status const&)>::RunnableType, yb::internal::FunctorTraits<void (yb::consensus::PeerMessageQueue::*)(yb::OpId const&, yb::Status const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::OpId, IsMoveOnlyType<yb::OpId>::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::consensus::PeerMessageQueue::*)(yb::OpId const&, yb::Status const&), yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, yb::OpId>(void (yb::consensus::PeerMessageQueue::*)(yb::OpId const&, yb::Status const&), yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue> const&, yb::OpId const&)
Line
Count
Source
145
24.2M
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
24.2M
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
24.2M
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
24.2M
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
24.2M
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
24.2M
  COMPILE_ASSERT(
162
24.2M
      !(base::is_non_const_reference<typename
163
24.2M
          BoundFunctorTraits::A1Type>::value ||
164
24.2M
          base::is_non_const_reference<typename
165
24.2M
          BoundFunctorTraits::A2Type>::value ),
166
24.2M
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
24.2M
  COMPILE_ASSERT(
173
24.2M
      internal::HasIsMethodTag<RunnableType>::value ||
174
24.2M
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
24.2M
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
24.2M
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
24.2M
                     !base::is_array<P1>::value,
178
24.2M
                 first_bound_argument_to_method_cannot_be_array);
179
24.2M
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
24.2M
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
24.2M
  typedef internal::BindState<RunnableType, RunType,
182
24.2M
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
24.2M
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
24.2M
  return Callback<typename BindState::UnboundRunType>(
187
24.2M
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
24.2M
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (yb::consensus::PeerMessageQueue::*)(yb::consensus::MajorityReplicatedData const&)>::RunnableType, yb::internal::FunctorTraits<void (yb::consensus::PeerMessageQueue::*)(yb::consensus::MajorityReplicatedData const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::consensus::MajorityReplicatedData, IsMoveOnlyType<yb::consensus::MajorityReplicatedData>::value>::StorageType)>::UnboundRunType> yb::Bind<void (yb::consensus::PeerMessageQueue::*)(yb::consensus::MajorityReplicatedData const&), yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue>, yb::consensus::MajorityReplicatedData>(void (yb::consensus::PeerMessageQueue::*)(yb::consensus::MajorityReplicatedData const&), yb::internal::UnretainedWrapper<yb::consensus::PeerMessageQueue> const&, yb::consensus::MajorityReplicatedData const&)
Line
Count
Source
145
34.7M
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
34.7M
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
34.7M
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
34.7M
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
34.7M
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
34.7M
  COMPILE_ASSERT(
162
34.7M
      !(base::is_non_const_reference<typename
163
34.7M
          BoundFunctorTraits::A1Type>::value ||
164
34.7M
          base::is_non_const_reference<typename
165
34.7M
          BoundFunctorTraits::A2Type>::value ),
166
34.7M
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
34.7M
  COMPILE_ASSERT(
173
34.7M
      internal::HasIsMethodTag<RunnableType>::value ||
174
34.7M
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
34.7M
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
34.7M
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
34.7M
                     !base::is_array<P1>::value,
178
34.7M
                 first_bound_argument_to_method_cannot_be_array);
179
34.7M
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
34.7M
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
34.7M
  typedef internal::BindState<RunnableType, RunType,
182
34.7M
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
34.7M
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
34.7M
  return Callback<typename BindState::UnboundRunType>(
187
34.7M
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
34.7M
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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>)>::RunnableType, yb::internal::FunctorTraits<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>)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::SysCatalogTable>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::SysCatalogTable> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType)>::UnboundRunType> yb::Bind<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>), yb::internal::UnretainedWrapper<yb::master::SysCatalogTable>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(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>), yb::internal::UnretainedWrapper<yb::master::SysCatalogTable> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Line
Count
Source
145
7.94k
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
7.94k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
7.94k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
7.94k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
7.94k
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
7.94k
  COMPILE_ASSERT(
162
7.94k
      !(base::is_non_const_reference<typename
163
7.94k
          BoundFunctorTraits::A1Type>::value ||
164
7.94k
          base::is_non_const_reference<typename
165
7.94k
          BoundFunctorTraits::A2Type>::value ),
166
7.94k
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
7.94k
  COMPILE_ASSERT(
173
7.94k
      internal::HasIsMethodTag<RunnableType>::value ||
174
7.94k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
7.94k
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
7.94k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
7.94k
                     !base::is_array<P1>::value,
178
7.94k
                 first_bound_argument_to_method_cannot_be_array);
179
7.94k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
7.94k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
7.94k
  typedef internal::BindState<RunnableType, RunType,
182
7.94k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
7.94k
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
7.94k
  return Callback<typename BindState::UnboundRunType>(
187
7.94k
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
7.94k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (*)(yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&)>::RunnableType, yb::internal::FunctorTraits<void (*)(yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::HostPort*, IsMoveOnlyType<yb::HostPort*>::value>::StorageType, yb::internal::CallbackParamTraits<yb::Synchronizer*, IsMoveOnlyType<yb::Synchronizer*>::value>::StorageType)>::UnboundRunType> yb::Bind<void (*)(yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&), yb::HostPort*, yb::Synchronizer*>(void (*)(yb::HostPort*, yb::Synchronizer*, yb::Status const&, yb::HostPort const&), yb::HostPort* const&, yb::Synchronizer* const&)
Line
Count
Source
145
2.93k
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
2.93k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
2.93k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
2.93k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
2.93k
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
2.93k
  COMPILE_ASSERT(
162
2.93k
      !(base::is_non_const_reference<typename
163
2.93k
          BoundFunctorTraits::A1Type>::value ||
164
2.93k
          base::is_non_const_reference<typename
165
2.93k
          BoundFunctorTraits::A2Type>::value ),
166
2.93k
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
2.93k
  COMPILE_ASSERT(
173
2.93k
      internal::HasIsMethodTag<RunnableType>::value ||
174
2.93k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
2.93k
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
2.93k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
2.93k
                     !base::is_array<P1>::value,
178
2.93k
                 first_bound_argument_to_method_cannot_be_array);
179
2.93k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
2.93k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
2.93k
  typedef internal::BindState<RunnableType, RunType,
182
2.93k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
2.93k
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
2.93k
  return Callback<typename BindState::UnboundRunType>(
187
2.93k
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
2.93k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<void (*)(yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::RunnableType, yb::internal::FunctorTraits<void (*)(yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>::RunType, void (yb::internal::CallbackParamTraits<yb::Synchronizer*, IsMoveOnlyType<yb::Synchronizer*>::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::shared_ptr<yb::ql::ExecutedResult>*, IsMoveOnlyType<std::__1::shared_ptr<yb::ql::ExecutedResult>*>::value>::StorageType)>::UnboundRunType> yb::Bind<void (*)(yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*>(void (*)(yb::Synchronizer*, std::__1::shared_ptr<yb::ql::ExecutedResult>*, yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&), yb::Synchronizer* const&, std::__1::shared_ptr<yb::ql::ExecutedResult>* const&)
Line
Count
Source
145
177k
Bind(Functor functor, const P1& p1, const P2& p2) {
146
  // Typedefs for how to store and run the functor.
147
177k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
148
177k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
149
150
  // Use RunnableType::RunType instead of RunType above because our
151
  // checks should below for bound references need to know what the actual
152
  // functor is going to interpret the argument as.
153
177k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
154
177k
      BoundFunctorTraits;
155
156
  // Do not allow binding a non-const reference parameter. Non-const reference
157
  // parameters are disallowed by the Google style guide.  Also, binding a
158
  // non-const reference parameter can make for subtle bugs because the
159
  // invoked function will receive a reference to the stored copy of the
160
  // argument and not the original.
161
177k
  COMPILE_ASSERT(
162
177k
      !(base::is_non_const_reference<typename
163
177k
          BoundFunctorTraits::A1Type>::value ||
164
177k
          base::is_non_const_reference<typename
165
177k
          BoundFunctorTraits::A2Type>::value ),
166
177k
      do_not_bind_functions_with_nonconst_ref);
167
168
  // For methods, we need to be careful for parameter 1.  We do not require
169
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
170
  // methods. We also disallow binding of an array as the method's target
171
  // object.
172
177k
  COMPILE_ASSERT(
173
177k
      internal::HasIsMethodTag<RunnableType>::value ||
174
177k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
175
177k
      p1_is_refcounted_type_and_needs_scoped_refptr);
176
177k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
177
177k
                     !base::is_array<P1>::value,
178
177k
                 first_bound_argument_to_method_cannot_be_array);
179
177k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
180
177k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
181
177k
  typedef internal::BindState<RunnableType, RunType,
182
177k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
183
177k
      typename internal::CallbackParamTraits<P2>::StorageType)> BindState;
184
185
186
177k
  return Callback<typename BindState::UnboundRunType>(
187
177k
      new BindState(internal::MakeRunnable(functor), p1, p2));
188
177k
}
189
190
template <typename Functor, typename P1, typename P2, typename P3>
191
Callback<
192
    typename internal::BindState<
193
        typename internal::FunctorTraits<Functor>::RunnableType,
194
        typename internal::FunctorTraits<Functor>::RunType,
195
        void(typename internal::CallbackParamTraits<P1>::StorageType,
196
            typename internal::CallbackParamTraits<P2>::StorageType,
197
            typename internal::CallbackParamTraits<P3>::StorageType)>
198
            ::UnboundRunType>
199
24.2M
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) {
200
  // Typedefs for how to store and run the functor.
201
24.2M
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
202
24.2M
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
203
204
  // Use RunnableType::RunType instead of RunType above because our
205
  // checks should below for bound references need to know what the actual
206
  // functor is going to interpret the argument as.
207
24.2M
  typedef internal::FunctionTraits<typename RunnableType::RunType>
208
24.2M
      BoundFunctorTraits;
209
210
  // Do not allow binding a non-const reference parameter. Non-const reference
211
  // parameters are disallowed by the Google style guide.  Also, binding a
212
  // non-const reference parameter can make for subtle bugs because the
213
  // invoked function will receive a reference to the stored copy of the
214
  // argument and not the original.
215
24.2M
  COMPILE_ASSERT(
216
24.2M
      !(base::is_non_const_reference<typename
217
24.2M
          BoundFunctorTraits::A1Type>::value ||
218
24.2M
          base::is_non_const_reference<typename
219
24.2M
          BoundFunctorTraits::A2Type>::value ||
220
24.2M
          base::is_non_const_reference<typename
221
24.2M
          BoundFunctorTraits::A3Type>::value ),
222
24.2M
      do_not_bind_functions_with_nonconst_ref);
223
224
  // For methods, we need to be careful for parameter 1.  We do not require
225
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
226
  // methods. We also disallow binding of an array as the method's target
227
  // object.
228
24.2M
  COMPILE_ASSERT(
229
24.2M
      internal::HasIsMethodTag<RunnableType>::value ||
230
24.2M
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
231
24.2M
      p1_is_refcounted_type_and_needs_scoped_refptr);
232
24.2M
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
233
24.2M
                     !base::is_array<P1>::value,
234
24.2M
                 first_bound_argument_to_method_cannot_be_array);
235
24.2M
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
236
24.2M
                 p2_is_refcounted_type_and_needs_scoped_refptr);
237
24.2M
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
238
24.2M
                 p3_is_refcounted_type_and_needs_scoped_refptr);
239
24.2M
  typedef internal::BindState<RunnableType, RunType,
240
24.2M
      void(typename internal::CallbackParamTraits<P1>::StorageType,
241
24.2M
      typename internal::CallbackParamTraits<P2>::StorageType,
242
24.2M
      typename internal::CallbackParamTraits<P3>::StorageType)> BindState;
243
244
245
24.2M
  return Callback<typename BindState::UnboundRunType>(
246
24.2M
      new BindState(internal::MakeRunnable(functor), p1, p2, p3));
247
24.2M
}
248
249
template <typename Functor, typename P1, typename P2, typename P3, typename P4>
250
Callback<
251
    typename internal::BindState<
252
        typename internal::FunctorTraits<Functor>::RunnableType,
253
        typename internal::FunctorTraits<Functor>::RunType,
254
        void(typename internal::CallbackParamTraits<P1>::StorageType,
255
            typename internal::CallbackParamTraits<P2>::StorageType,
256
            typename internal::CallbackParamTraits<P3>::StorageType,
257
            typename internal::CallbackParamTraits<P4>::StorageType)>
258
            ::UnboundRunType>
259
0
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) {
260
  // Typedefs for how to store and run the functor.
261
0
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
262
0
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
263
264
  // Use RunnableType::RunType instead of RunType above because our
265
  // checks should below for bound references need to know what the actual
266
  // functor is going to interpret the argument as.
267
0
  typedef internal::FunctionTraits<typename RunnableType::RunType>
268
0
      BoundFunctorTraits;
269
270
  // Do not allow binding a non-const reference parameter. Non-const reference
271
  // parameters are disallowed by the Google style guide.  Also, binding a
272
  // non-const reference parameter can make for subtle bugs because the
273
  // invoked function will receive a reference to the stored copy of the
274
  // argument and not the original.
275
0
  COMPILE_ASSERT(
276
0
      !(base::is_non_const_reference<typename
277
0
          BoundFunctorTraits::A1Type>::value ||
278
0
          base::is_non_const_reference<typename
279
0
          BoundFunctorTraits::A2Type>::value ||
280
0
          base::is_non_const_reference<typename
281
0
          BoundFunctorTraits::A3Type>::value ||
282
0
          base::is_non_const_reference<typename
283
0
          BoundFunctorTraits::A4Type>::value ),
284
0
      do_not_bind_functions_with_nonconst_ref);
285
286
  // For methods, we need to be careful for parameter 1.  We do not require
287
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
288
  // methods. We also disallow binding of an array as the method's target
289
  // object.
290
0
  COMPILE_ASSERT(
291
0
      internal::HasIsMethodTag<RunnableType>::value ||
292
0
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
293
0
      p1_is_refcounted_type_and_needs_scoped_refptr);
294
0
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
295
0
                     !base::is_array<P1>::value,
296
0
                 first_bound_argument_to_method_cannot_be_array);
297
0
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
298
0
                 p2_is_refcounted_type_and_needs_scoped_refptr);
299
0
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
300
0
                 p3_is_refcounted_type_and_needs_scoped_refptr);
301
0
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
302
0
                 p4_is_refcounted_type_and_needs_scoped_refptr);
303
0
  typedef internal::BindState<RunnableType, RunType,
304
0
      void(typename internal::CallbackParamTraits<P1>::StorageType,
305
0
      typename internal::CallbackParamTraits<P2>::StorageType,
306
0
      typename internal::CallbackParamTraits<P3>::StorageType,
307
0
      typename internal::CallbackParamTraits<P4>::StorageType)> BindState;
308
309
310
0
  return Callback<typename BindState::UnboundRunType>(
311
0
      new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4));
312
0
}
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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&)>::RunnableType, yb::internal::FunctorTraits<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&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > >, IsMoveOnlyType<std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > >::value>::StorageType, yb::internal::CallbackParamTraits<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> > > > >, IsMoveOnlyType<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> > > > > >::value>::StorageType)>::UnboundRunType> yb::Bind<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&), 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> > > > > >(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&), yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager> const&, 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&)
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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&)>::RunnableType, yb::internal::FunctorTraits<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&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::shared_ptr<yb::client::YBTableInfo>, IsMoveOnlyType<std::__1::shared_ptr<yb::client::YBTableInfo> >::value>::StorageType, yb::internal::CallbackParamTraits<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> > > > >, IsMoveOnlyType<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> > > > > >::value>::StorageType)>::UnboundRunType> yb::Bind<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&), 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> > > > > >(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&), yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager> const&, 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&)
313
314
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
315
    typename P5>
316
Callback<
317
    typename internal::BindState<
318
        typename internal::FunctorTraits<Functor>::RunnableType,
319
        typename internal::FunctorTraits<Functor>::RunType,
320
        void(typename internal::CallbackParamTraits<P1>::StorageType,
321
            typename internal::CallbackParamTraits<P2>::StorageType,
322
            typename internal::CallbackParamTraits<P3>::StorageType,
323
            typename internal::CallbackParamTraits<P4>::StorageType,
324
            typename internal::CallbackParamTraits<P5>::StorageType)>
325
            ::UnboundRunType>
326
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
327
339k
    const P5& p5) {
328
  // Typedefs for how to store and run the functor.
329
339k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
330
339k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
331
332
  // Use RunnableType::RunType instead of RunType above because our
333
  // checks should below for bound references need to know what the actual
334
  // functor is going to interpret the argument as.
335
339k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
336
339k
      BoundFunctorTraits;
337
338
  // Do not allow binding a non-const reference parameter. Non-const reference
339
  // parameters are disallowed by the Google style guide.  Also, binding a
340
  // non-const reference parameter can make for subtle bugs because the
341
  // invoked function will receive a reference to the stored copy of the
342
  // argument and not the original.
343
339k
  COMPILE_ASSERT(
344
339k
      !(base::is_non_const_reference<typename
345
339k
          BoundFunctorTraits::A1Type>::value ||
346
339k
          base::is_non_const_reference<typename
347
339k
          BoundFunctorTraits::A2Type>::value ||
348
339k
          base::is_non_const_reference<typename
349
339k
          BoundFunctorTraits::A3Type>::value ||
350
339k
          base::is_non_const_reference<typename
351
339k
          BoundFunctorTraits::A4Type>::value ||
352
339k
          base::is_non_const_reference<typename
353
339k
          BoundFunctorTraits::A5Type>::value ),
354
339k
      do_not_bind_functions_with_nonconst_ref);
355
356
  // For methods, we need to be careful for parameter 1.  We do not require
357
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
358
  // methods. We also disallow binding of an array as the method's target
359
  // object.
360
339k
  COMPILE_ASSERT(
361
339k
      internal::HasIsMethodTag<RunnableType>::value ||
362
339k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
363
339k
      p1_is_refcounted_type_and_needs_scoped_refptr);
364
339k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
365
339k
                     !base::is_array<P1>::value,
366
339k
                 first_bound_argument_to_method_cannot_be_array);
367
339k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
368
339k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
369
339k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
370
339k
                 p3_is_refcounted_type_and_needs_scoped_refptr);
371
339k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
372
339k
                 p4_is_refcounted_type_and_needs_scoped_refptr);
373
339k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
374
339k
                 p5_is_refcounted_type_and_needs_scoped_refptr);
375
339k
  typedef internal::BindState<RunnableType, RunType,
376
339k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
377
339k
      typename internal::CallbackParamTraits<P2>::StorageType,
378
339k
      typename internal::CallbackParamTraits<P3>::StorageType,
379
339k
      typename internal::CallbackParamTraits<P4>::StorageType,
380
339k
      typename internal::CallbackParamTraits<P5>::StorageType)> BindState;
381
382
383
339k
  return Callback<typename BindState::UnboundRunType>(
384
339k
      new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
385
339k
}
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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&)>::RunnableType, yb::internal::FunctorTraits<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&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::ql::QLProcessor>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::ql::QLProcessor> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, IsMoveOnlyType<yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::value>::StorageType, yb::internal::CallbackParamTraits<yb::internal::ConstRefWrapper<yb::ql::StatementParameters>, IsMoveOnlyType<yb::internal::ConstRefWrapper<yb::ql::StatementParameters> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::ql::ParseTree>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::ql::ParseTree> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, IsMoveOnlyType<yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)> >::value>::StorageType)>::UnboundRunType> yb::Bind<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&), 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&)> >(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&), yb::internal::UnretainedWrapper<yb::ql::QLProcessor> const&, yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, yb::internal::ConstRefWrapper<yb::ql::StatementParameters> const&, yb::internal::UnretainedWrapper<yb::ql::ParseTree> const&, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)> const&)
Unexecuted instantiation: yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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&)>::RunnableType, yb::internal::FunctorTraits<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&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > >, IsMoveOnlyType<std::__1::shared_ptr<std::__1::vector<yb::client::YBTableInfo, std::__1::allocator<yb::client::YBTableInfo> > > >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType, yb::internal::CallbackParamTraits<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> > > > >, IsMoveOnlyType<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> > > > > >::value>::StorageType)>::UnboundRunType> yb::Bind<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&), 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> > > > > >(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&), yb::internal::UnretainedWrapper<yb::master::enterprise::CatalogManager> const&, 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::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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)>::RunnableType, yb::internal::FunctorTraits<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)>::RunType, void (yb::internal::CallbackParamTraits<scoped_refptr<yb::tools::ChecksumResultReporter>, IsMoveOnlyType<scoped_refptr<yb::tools::ChecksumResultReporter> >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::shared_ptr<yb::tools::YsckTabletServer>, IsMoveOnlyType<std::__1::shared_ptr<yb::tools::YsckTabletServer> >::value>::StorageType, yb::internal::CallbackParamTraits<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> >, IsMoveOnlyType<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> > >::value>::StorageType, yb::internal::CallbackParamTraits<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IsMoveOnlyType<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value>::StorageType, yb::internal::CallbackParamTraits<yb::tools::ChecksumOptions, IsMoveOnlyType<yb::tools::ChecksumOptions>::value>::StorageType)>::UnboundRunType> yb::Bind<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), 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>(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), 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&)
Line
Count
Source
327
4.37k
    const P5& p5) {
328
  // Typedefs for how to store and run the functor.
329
4.37k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
330
4.37k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
331
332
  // Use RunnableType::RunType instead of RunType above because our
333
  // checks should below for bound references need to know what the actual
334
  // functor is going to interpret the argument as.
335
4.37k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
336
4.37k
      BoundFunctorTraits;
337
338
  // Do not allow binding a non-const reference parameter. Non-const reference
339
  // parameters are disallowed by the Google style guide.  Also, binding a
340
  // non-const reference parameter can make for subtle bugs because the
341
  // invoked function will receive a reference to the stored copy of the
342
  // argument and not the original.
343
4.37k
  COMPILE_ASSERT(
344
4.37k
      !(base::is_non_const_reference<typename
345
4.37k
          BoundFunctorTraits::A1Type>::value ||
346
4.37k
          base::is_non_const_reference<typename
347
4.37k
          BoundFunctorTraits::A2Type>::value ||
348
4.37k
          base::is_non_const_reference<typename
349
4.37k
          BoundFunctorTraits::A3Type>::value ||
350
4.37k
          base::is_non_const_reference<typename
351
4.37k
          BoundFunctorTraits::A4Type>::value ||
352
4.37k
          base::is_non_const_reference<typename
353
4.37k
          BoundFunctorTraits::A5Type>::value ),
354
4.37k
      do_not_bind_functions_with_nonconst_ref);
355
356
  // For methods, we need to be careful for parameter 1.  We do not require
357
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
358
  // methods. We also disallow binding of an array as the method's target
359
  // object.
360
4.37k
  COMPILE_ASSERT(
361
4.37k
      internal::HasIsMethodTag<RunnableType>::value ||
362
4.37k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
363
4.37k
      p1_is_refcounted_type_and_needs_scoped_refptr);
364
4.37k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
365
4.37k
                     !base::is_array<P1>::value,
366
4.37k
                 first_bound_argument_to_method_cannot_be_array);
367
4.37k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
368
4.37k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
369
4.37k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
370
4.37k
                 p3_is_refcounted_type_and_needs_scoped_refptr);
371
4.37k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
372
4.37k
                 p4_is_refcounted_type_and_needs_scoped_refptr);
373
4.37k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
374
4.37k
                 p5_is_refcounted_type_and_needs_scoped_refptr);
375
4.37k
  typedef internal::BindState<RunnableType, RunType,
376
4.37k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
377
4.37k
      typename internal::CallbackParamTraits<P2>::StorageType,
378
4.37k
      typename internal::CallbackParamTraits<P3>::StorageType,
379
4.37k
      typename internal::CallbackParamTraits<P4>::StorageType,
380
4.37k
      typename internal::CallbackParamTraits<P5>::StorageType)> BindState;
381
382
383
4.37k
  return Callback<typename BindState::UnboundRunType>(
384
4.37k
      new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
385
4.37k
}
yb::Callback<yb::internal::BindState<yb::internal::FunctorTraits<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&)>::RunnableType, yb::internal::FunctorTraits<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&)>::RunType, void (yb::internal::CallbackParamTraits<yb::internal::UnretainedWrapper<yb::ql::QLProcessor>, IsMoveOnlyType<yb::internal::UnretainedWrapper<yb::ql::QLProcessor> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, IsMoveOnlyType<yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::value>::StorageType, yb::internal::CallbackParamTraits<yb::internal::ConstRefWrapper<yb::ql::StatementParameters>, IsMoveOnlyType<yb::internal::ConstRefWrapper<yb::ql::StatementParameters> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::internal::OwnedWrapper<yb::ql::ParseTree const>, IsMoveOnlyType<yb::internal::OwnedWrapper<yb::ql::ParseTree const> >::value>::StorageType, yb::internal::CallbackParamTraits<yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)>, IsMoveOnlyType<yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)> >::value>::StorageType)>::UnboundRunType> yb::Bind<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&), 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&)> >(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&), yb::internal::UnretainedWrapper<yb::ql::QLProcessor> const&, yb::internal::ConstRefWrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, yb::internal::ConstRefWrapper<yb::ql::StatementParameters> const&, yb::internal::OwnedWrapper<yb::ql::ParseTree const> const&, yb::Callback<void (yb::Status const&, std::__1::shared_ptr<yb::ql::ExecutedResult> const&)> const&)
Line
Count
Source
327
335k
    const P5& p5) {
328
  // Typedefs for how to store and run the functor.
329
335k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
330
335k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
331
332
  // Use RunnableType::RunType instead of RunType above because our
333
  // checks should below for bound references need to know what the actual
334
  // functor is going to interpret the argument as.
335
335k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
336
335k
      BoundFunctorTraits;
337
338
  // Do not allow binding a non-const reference parameter. Non-const reference
339
  // parameters are disallowed by the Google style guide.  Also, binding a
340
  // non-const reference parameter can make for subtle bugs because the
341
  // invoked function will receive a reference to the stored copy of the
342
  // argument and not the original.
343
335k
  COMPILE_ASSERT(
344
335k
      !(base::is_non_const_reference<typename
345
335k
          BoundFunctorTraits::A1Type>::value ||
346
335k
          base::is_non_const_reference<typename
347
335k
          BoundFunctorTraits::A2Type>::value ||
348
335k
          base::is_non_const_reference<typename
349
335k
          BoundFunctorTraits::A3Type>::value ||
350
335k
          base::is_non_const_reference<typename
351
335k
          BoundFunctorTraits::A4Type>::value ||
352
335k
          base::is_non_const_reference<typename
353
335k
          BoundFunctorTraits::A5Type>::value ),
354
335k
      do_not_bind_functions_with_nonconst_ref);
355
356
  // For methods, we need to be careful for parameter 1.  We do not require
357
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
358
  // methods. We also disallow binding of an array as the method's target
359
  // object.
360
335k
  COMPILE_ASSERT(
361
335k
      internal::HasIsMethodTag<RunnableType>::value ||
362
335k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
363
335k
      p1_is_refcounted_type_and_needs_scoped_refptr);
364
335k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
365
335k
                     !base::is_array<P1>::value,
366
335k
                 first_bound_argument_to_method_cannot_be_array);
367
335k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
368
335k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
369
335k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
370
335k
                 p3_is_refcounted_type_and_needs_scoped_refptr);
371
335k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
372
335k
                 p4_is_refcounted_type_and_needs_scoped_refptr);
373
335k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
374
335k
                 p5_is_refcounted_type_and_needs_scoped_refptr);
375
335k
  typedef internal::BindState<RunnableType, RunType,
376
335k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
377
335k
      typename internal::CallbackParamTraits<P2>::StorageType,
378
335k
      typename internal::CallbackParamTraits<P3>::StorageType,
379
335k
      typename internal::CallbackParamTraits<P4>::StorageType,
380
335k
      typename internal::CallbackParamTraits<P5>::StorageType)> BindState;
381
382
383
335k
  return Callback<typename BindState::UnboundRunType>(
384
335k
      new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5));
385
335k
}
386
387
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
388
    typename P5, typename P6>
389
Callback<
390
    typename internal::BindState<
391
        typename internal::FunctorTraits<Functor>::RunnableType,
392
        typename internal::FunctorTraits<Functor>::RunType,
393
        void(typename internal::CallbackParamTraits<P1>::StorageType,
394
            typename internal::CallbackParamTraits<P2>::StorageType,
395
            typename internal::CallbackParamTraits<P3>::StorageType,
396
            typename internal::CallbackParamTraits<P4>::StorageType,
397
            typename internal::CallbackParamTraits<P5>::StorageType,
398
            typename internal::CallbackParamTraits<P6>::StorageType)>
399
            ::UnboundRunType>
400
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
401
84.6k
    const P5& p5, const P6& p6) {
402
  // Typedefs for how to store and run the functor.
403
84.6k
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
404
84.6k
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
405
406
  // Use RunnableType::RunType instead of RunType above because our
407
  // checks should below for bound references need to know what the actual
408
  // functor is going to interpret the argument as.
409
84.6k
  typedef internal::FunctionTraits<typename RunnableType::RunType>
410
84.6k
      BoundFunctorTraits;
411
412
  // Do not allow binding a non-const reference parameter. Non-const reference
413
  // parameters are disallowed by the Google style guide.  Also, binding a
414
  // non-const reference parameter can make for subtle bugs because the
415
  // invoked function will receive a reference to the stored copy of the
416
  // argument and not the original.
417
84.6k
  COMPILE_ASSERT(
418
84.6k
      !(base::is_non_const_reference<typename
419
84.6k
          BoundFunctorTraits::A1Type>::value ||
420
84.6k
          base::is_non_const_reference<typename
421
84.6k
          BoundFunctorTraits::A2Type>::value ||
422
84.6k
          base::is_non_const_reference<typename
423
84.6k
          BoundFunctorTraits::A3Type>::value ||
424
84.6k
          base::is_non_const_reference<typename
425
84.6k
          BoundFunctorTraits::A4Type>::value ||
426
84.6k
          base::is_non_const_reference<typename
427
84.6k
          BoundFunctorTraits::A5Type>::value ||
428
84.6k
          base::is_non_const_reference<typename
429
84.6k
          BoundFunctorTraits::A6Type>::value ),
430
84.6k
      do_not_bind_functions_with_nonconst_ref);
431
432
  // For methods, we need to be careful for parameter 1.  We do not require
433
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
434
  // methods. We also disallow binding of an array as the method's target
435
  // object.
436
84.6k
  COMPILE_ASSERT(
437
84.6k
      internal::HasIsMethodTag<RunnableType>::value ||
438
84.6k
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
439
84.6k
      p1_is_refcounted_type_and_needs_scoped_refptr);
440
84.6k
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
441
84.6k
                     !base::is_array<P1>::value,
442
84.6k
                 first_bound_argument_to_method_cannot_be_array);
443
84.6k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
444
84.6k
                 p2_is_refcounted_type_and_needs_scoped_refptr);
445
84.6k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
446
84.6k
                 p3_is_refcounted_type_and_needs_scoped_refptr);
447
84.6k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
448
84.6k
                 p4_is_refcounted_type_and_needs_scoped_refptr);
449
84.6k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
450
84.6k
                 p5_is_refcounted_type_and_needs_scoped_refptr);
451
84.6k
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
452
84.6k
                 p6_is_refcounted_type_and_needs_scoped_refptr);
453
84.6k
  typedef internal::BindState<RunnableType, RunType,
454
84.6k
      void(typename internal::CallbackParamTraits<P1>::StorageType,
455
84.6k
      typename internal::CallbackParamTraits<P2>::StorageType,
456
84.6k
      typename internal::CallbackParamTraits<P3>::StorageType,
457
84.6k
      typename internal::CallbackParamTraits<P4>::StorageType,
458
84.6k
      typename internal::CallbackParamTraits<P5>::StorageType,
459
84.6k
      typename internal::CallbackParamTraits<P6>::StorageType)> BindState;
460
461
462
84.6k
  return Callback<typename BindState::UnboundRunType>(
463
84.6k
      new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6));
464
84.6k
}
465
466
template <typename Functor, typename P1, typename P2, typename P3, typename P4,
467
    typename P5, typename P6, typename P7>
468
Callback<
469
    typename internal::BindState<
470
        typename internal::FunctorTraits<Functor>::RunnableType,
471
        typename internal::FunctorTraits<Functor>::RunType,
472
        void(typename internal::CallbackParamTraits<P1>::StorageType,
473
            typename internal::CallbackParamTraits<P2>::StorageType,
474
            typename internal::CallbackParamTraits<P3>::StorageType,
475
            typename internal::CallbackParamTraits<P4>::StorageType,
476
            typename internal::CallbackParamTraits<P5>::StorageType,
477
            typename internal::CallbackParamTraits<P6>::StorageType,
478
            typename internal::CallbackParamTraits<P7>::StorageType)>
479
            ::UnboundRunType>
480
Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4,
481
    const P5& p5, const P6& p6, const P7& p7) {
482
  // Typedefs for how to store and run the functor.
483
  typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType;
484
  typedef typename internal::FunctorTraits<Functor>::RunType RunType;
485
486
  // Use RunnableType::RunType instead of RunType above because our
487
  // checks should below for bound references need to know what the actual
488
  // functor is going to interpret the argument as.
489
  typedef internal::FunctionTraits<typename RunnableType::RunType>
490
      BoundFunctorTraits;
491
492
  // Do not allow binding a non-const reference parameter. Non-const reference
493
  // parameters are disallowed by the Google style guide.  Also, binding a
494
  // non-const reference parameter can make for subtle bugs because the
495
  // invoked function will receive a reference to the stored copy of the
496
  // argument and not the original.
497
  COMPILE_ASSERT(
498
      !(base::is_non_const_reference<typename
499
          BoundFunctorTraits::A1Type>::value ||
500
          base::is_non_const_reference<typename
501
          BoundFunctorTraits::A2Type>::value ||
502
          base::is_non_const_reference<typename
503
          BoundFunctorTraits::A3Type>::value ||
504
          base::is_non_const_reference<typename
505
          BoundFunctorTraits::A4Type>::value ||
506
          base::is_non_const_reference<typename
507
          BoundFunctorTraits::A5Type>::value ||
508
          base::is_non_const_reference<typename
509
          BoundFunctorTraits::A6Type>::value ||
510
          base::is_non_const_reference<typename
511
          BoundFunctorTraits::A7Type>::value ),
512
      do_not_bind_functions_with_nonconst_ref);
513
514
  // For methods, we need to be careful for parameter 1.  We do not require
515
  // a scoped_refptr because BindState<> itself takes care of AddRef() for
516
  // methods. We also disallow binding of an array as the method's target
517
  // object.
518
  COMPILE_ASSERT(
519
      internal::HasIsMethodTag<RunnableType>::value ||
520
          !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value,
521
      p1_is_refcounted_type_and_needs_scoped_refptr);
522
  COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value ||
523
                     !base::is_array<P1>::value,
524
                 first_bound_argument_to_method_cannot_be_array);
525
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value,
526
                 p2_is_refcounted_type_and_needs_scoped_refptr);
527
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value,
528
                 p3_is_refcounted_type_and_needs_scoped_refptr);
529
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value,
530
                 p4_is_refcounted_type_and_needs_scoped_refptr);
531
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value,
532
                 p5_is_refcounted_type_and_needs_scoped_refptr);
533
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value,
534
                 p6_is_refcounted_type_and_needs_scoped_refptr);
535
  COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value,
536
                 p7_is_refcounted_type_and_needs_scoped_refptr);
537
  typedef internal::BindState<RunnableType, RunType,
538
      void(typename internal::CallbackParamTraits<P1>::StorageType,
539
      typename internal::CallbackParamTraits<P2>::StorageType,
540
      typename internal::CallbackParamTraits<P3>::StorageType,
541
      typename internal::CallbackParamTraits<P4>::StorageType,
542
      typename internal::CallbackParamTraits<P5>::StorageType,
543
      typename internal::CallbackParamTraits<P6>::StorageType,
544
      typename internal::CallbackParamTraits<P7>::StorageType)> BindState;
545
546
547
  return Callback<typename BindState::UnboundRunType>(
548
      new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6,
549
          p7));
550
}
551
552
}  // namespace yb
553
554
#endif // YB_GUTIL_BIND_H_