Fix by tidy-modernize-use-override

pull/24454/head
Esun Kim 4 years ago
parent 0b08b63295
commit e7434d385e
  1. 6
      src/core/ext/filters/client_channel/client_channel.cc
  2. 2
      src/core/ext/filters/client_channel/config_selector.h
  3. 4
      src/core/ext/filters/client_channel/health/health_check_client.h
  4. 2
      src/core/ext/filters/client_channel/http_connect_handshaker.cc
  5. 6
      src/core/ext/filters/client_channel/lb_policy.h
  6. 2
      src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
  7. 2
      src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
  8. 6
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  9. 4
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  10. 6
      src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
  11. 4
      src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
  12. 4
      src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
  13. 6
      src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
  14. 2
      src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
  15. 4
      src/core/ext/filters/client_channel/lb_policy/xds/eds.cc
  16. 8
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
  17. 8
      src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
  18. 2
      src/core/ext/filters/client_channel/resolver.h
  19. 2
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  20. 2
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
  21. 2
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  22. 2
      src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
  23. 2
      src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
  24. 2
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  25. 2
      src/core/ext/filters/client_channel/resolving_lb_policy.cc
  26. 4
      src/core/ext/filters/client_channel/resolving_lb_policy.h
  27. 2
      src/core/ext/filters/client_channel/retry_throttle.h
  28. 2
      src/core/ext/filters/client_channel/service_config.h
  29. 4
      src/core/ext/filters/client_channel/subchannel.cc
  30. 4
      src/core/ext/filters/client_channel/subchannel.h
  31. 2
      src/core/ext/filters/client_channel/subchannel_interface.h
  32. 2
      src/core/ext/filters/client_channel/subchannel_pool_interface.h
  33. 2
      src/core/ext/filters/max_age/max_age_filter.cc
  34. 2
      src/core/ext/transport/chttp2/client/chttp2_connector.h
  35. 4
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  36. 4
      src/core/ext/transport/chttp2/transport/flow_control.h
  37. 4
      src/core/ext/xds/xds_client.h
  38. 4
      src/core/ext/xds/xds_client_stats.h
  39. 2
      src/core/lib/channel/channelz.h
  40. 4
      src/core/lib/channel/handshaker.h
  41. 2
      src/core/lib/gprpp/dual_ref_counted.h
  42. 2
      src/core/lib/gprpp/orphanable.h
  43. 8
      src/core/lib/iomgr/executor/mpmcqueue.h
  44. 2
      src/core/lib/security/certificate_provider.h
  45. 6
      src/core/lib/security/credentials/credentials.h
  46. 6
      src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
  47. 2
      src/core/lib/security/security_connector/security_connector.h
  48. 2
      src/core/lib/security/transport/security_handshaker.cc
  49. 2
      src/core/lib/surface/server.cc
  50. 4
      src/core/lib/surface/server.h
  51. 6
      src/core/lib/transport/byte_stream.h
  52. 6
      src/core/lib/transport/connectivity_state.h
  53. 2
      src/core/tsi/ssl/session_cache/ssl_session_cache.h
  54. 4
      src/cpp/client/secure_credentials.h
  55. 2
      src/cpp/common/alarm.cc
  56. 2
      src/cpp/common/secure_auth_context.h
  57. 8
      src/cpp/server/channel_argument_option.cc
  58. 2
      src/cpp/server/dynamic_thread_pool.h
  59. 2
      src/cpp/server/health/default_health_check_service.h
  60. 2
      src/cpp/server/load_reporter/load_reporter_async_service_impl.h
  61. 14
      src/cpp/server/server_cc.cc
  62. 2
      src/cpp/server/server_context.cc
  63. 4
      test/core/gprpp/dual_ref_counted_test.cc
  64. 8
      test/core/gprpp/manual_constructor_test.cc
  65. 6
      test/core/gprpp/ref_counted_ptr_test.cc
  66. 2
      test/core/handshake/readahead_handshaker_server_ssl.cc
  67. 13
      test/core/security/credentials_test.cc
  68. 2
      test/core/security/grpc_tls_certificate_distributor_test.cc
  69. 2
      test/core/transport/connectivity_state_test.cc
  70. 17
      test/core/util/fuzzer_corpus_test.cc
  71. 36
      test/cpp/end2end/client_interceptors_end2end_test.cc
  72. 2
      test/cpp/end2end/delegating_channel_test.cc
  73. 6
      test/cpp/end2end/end2end_test.cc
  74. 2
      test/cpp/end2end/filter_end2end_test.cc
  75. 10
      test/cpp/end2end/interceptors_util.h
  76. 2
      test/cpp/end2end/message_allocator_end2end_test.cc
  77. 6
      test/cpp/end2end/server_interceptors_end2end_test.cc
  78. 4
      test/cpp/end2end/time_change_test.cc
  79. 4
      test/cpp/ext/filters/census/stats_plugin_end2end_test.cc
  80. 14
      test/cpp/interop/interop_server.cc
  81. 6
      test/cpp/interop/reconnect_interop_server.cc
  82. 2
      test/cpp/interop/xds_interop_client.cc
  83. 4
      test/cpp/interop/xds_interop_server.cc
  84. 2
      test/cpp/microbenchmarks/bm_call_create.cc
  85. 4
      test/cpp/microbenchmarks/bm_fullstack_trickle.cc
  86. 18
      test/cpp/microbenchmarks/fullstack_fixtures.h
  87. 2
      test/cpp/performance/writes_per_rpc_test.cc
  88. 2
      test/cpp/qps/client.h
  89. 6
      test/cpp/qps/client_async.cc
  90. 10
      test/cpp/qps/client_callback.cc
  91. 18
      test/cpp/qps/client_sync.cc
  92. 2
      test/cpp/qps/server_async.cc
  93. 2
      test/cpp/util/channelz_sampler_test.cc
  94. 2
      test/cpp/util/proto_reflection_descriptor_database.h

@ -209,7 +209,7 @@ class ChannelData {
grpc_closure* on_complete,
grpc_closure* watcher_timer_init);
~ExternalConnectivityWatcher();
~ExternalConnectivityWatcher() override;
// Removes the watcher from the external_watchers_ map.
static void RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
@ -919,7 +919,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
chand_->subchannel_wrappers_.insert(this);
}
~SubchannelWrapper() {
~SubchannelWrapper() override {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p: destroying subchannel wrapper %p for subchannel %p",
@ -1062,7 +1062,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
parent_(std::move(parent)),
last_seen_state_(initial_state) {}
~WatcherWrapper() {
~WatcherWrapper() override {
auto* parent = parent_.release(); // ref owned by lambda
parent->chand_->work_serializer_->Run(
[parent]() { parent->Unref(DEBUG_LOCATION, "WatcherWrapper"); },

@ -65,7 +65,7 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
std::function<void()> on_call_committed;
};
virtual ~ConfigSelector() = default;
~ConfigSelector() override = default;
virtual const char* name() const = 0;

@ -50,7 +50,7 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
RefCountedPtr<channelz::SubchannelNode> channelz_node,
RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
~HealthCheckClient();
~HealthCheckClient() override;
void Orphan() override;
@ -60,7 +60,7 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
public:
CallState(RefCountedPtr<HealthCheckClient> health_check_client,
grpc_pollset_set* interested_parties_);
~CallState();
~CallState() override;
void Orphan() override;

@ -54,7 +54,7 @@ class HttpConnectHandshaker : public Handshaker {
const char* name() const override { return "http_connect"; }
private:
virtual ~HttpConnectHandshaker();
~HttpConnectHandshaker() override;
void CleanupArgsForFailureLocked();
void HandshakeFailedLocked(grpc_error* error);
static void OnWriteDone(void* arg, grpc_error* error);

@ -301,7 +301,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// return the parameters they need.
class Config : public RefCounted<Config> {
public:
virtual ~Config() = default;
~Config() override = default;
// Returns the load balancing policy name
virtual const char* name() const = 0;
@ -341,7 +341,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
};
explicit LoadBalancingPolicy(Args args, intptr_t initial_refcount = 1);
virtual ~LoadBalancingPolicy();
~LoadBalancingPolicy() override;
// Not copyable nor movable.
LoadBalancingPolicy(const LoadBalancingPolicy&) = delete;
@ -376,7 +376,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
explicit QueuePicker(RefCountedPtr<LoadBalancingPolicy> parent)
: parent_(std::move(parent)) {}
~QueuePicker() { parent_.reset(DEBUG_LOCATION, "QueuePicker"); }
~QueuePicker() override { parent_.reset(DEBUG_LOCATION, "QueuePicker"); }
PickResult Pick(PickArgs args) override;

@ -36,7 +36,7 @@ class ChildPolicyHandler::Helper
explicit Helper(RefCountedPtr<ChildPolicyHandler> parent)
: parent_(std::move(parent)) {}
~Helper() { parent_.reset(DEBUG_LOCATION, "Helper"); }
~Helper() override { parent_.reset(DEBUG_LOCATION, "Helper"); }
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override {

@ -36,7 +36,7 @@ class ChildPolicyHandler : public LoadBalancingPolicy {
ChildPolicyHandler(Args args, TraceFlag* tracer)
: LoadBalancingPolicy(std::move(args)), tracer_(tracer) {}
virtual const char* name() const override { return "child_policy_handler"; }
const char* name() const override { return "child_policy_handler"; }
void UpdateLocked(UpdateArgs args) override;
void ExitIdleLocked() override;

@ -164,7 +164,7 @@ class GrpcLb : public LoadBalancingPolicy {
public:
explicit BalancerCallState(
RefCountedPtr<LoadBalancingPolicy> parent_grpclb_policy);
~BalancerCallState();
~BalancerCallState() override;
// It's the caller's responsibility to ensure that Orphan() is called from
// inside the combiner.
@ -369,7 +369,7 @@ class GrpcLb : public LoadBalancingPolicy {
: AsyncConnectivityStateWatcherInterface(parent->work_serializer()),
parent_(std::move(parent)) {}
~StateWatcher() { parent_.reset(DEBUG_LOCATION, "StateWatcher"); }
~StateWatcher() override { parent_.reset(DEBUG_LOCATION, "StateWatcher"); }
private:
void OnConnectivityStateChange(grpc_connectivity_state new_state,
@ -395,7 +395,7 @@ class GrpcLb : public LoadBalancingPolicy {
RefCountedPtr<GrpcLb> parent_;
};
~GrpcLb();
~GrpcLb() override;
void ShutdownLocked() override;

@ -55,7 +55,7 @@ class PickFirst : public LoadBalancingPolicy {
void ResetBackoffLocked() override;
private:
~PickFirst();
~PickFirst() override;
class PickFirstSubchannelList;
@ -94,7 +94,7 @@ class PickFirst : public LoadBalancingPolicy {
policy->Ref(DEBUG_LOCATION, "subchannel_list").release();
}
~PickFirstSubchannelList() {
~PickFirstSubchannelList() override {
PickFirst* p = static_cast<PickFirst*>(policy());
p->Unref(DEBUG_LOCATION, "subchannel_list");
}

@ -93,7 +93,7 @@ class PriorityLb : public LoadBalancingPolicy {
public:
ChildPriority(RefCountedPtr<PriorityLb> priority_policy, std::string name);
~ChildPriority() {
~ChildPriority() override {
priority_policy_.reset(DEBUG_LOCATION, "ChildPriority");
}
@ -152,7 +152,7 @@ class PriorityLb : public LoadBalancingPolicy {
explicit Helper(RefCountedPtr<ChildPriority> priority)
: priority_(std::move(priority)) {}
~Helper() { priority_.reset(DEBUG_LOCATION, "Helper"); }
~Helper() override { priority_.reset(DEBUG_LOCATION, "Helper"); }
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override;
@ -202,7 +202,7 @@ class PriorityLb : public LoadBalancingPolicy {
bool failover_timer_callback_pending_ = false;
};
~PriorityLb();
~PriorityLb() override;
void ShutdownLocked() override;

@ -65,7 +65,7 @@ class RoundRobin : public LoadBalancingPolicy {
void ResetBackoffLocked() override;
private:
~RoundRobin();
~RoundRobin() override;
// Forward declaration.
class RoundRobinSubchannelList;
@ -122,7 +122,7 @@ class RoundRobin : public LoadBalancingPolicy {
policy->Ref(DEBUG_LOCATION, "subchannel_list").release();
}
~RoundRobinSubchannelList() {
~RoundRobinSubchannelList() override {
RoundRobin* p = static_cast<RoundRobin*>(policy());
p->Unref(DEBUG_LOCATION, "subchannel_list");
}

@ -142,7 +142,9 @@ class SubchannelData {
: subchannel_data_(subchannel_data),
subchannel_list_(std::move(subchannel_list)) {}
~Watcher() { subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor"); }
~Watcher() override {
subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor");
}
void OnConnectivityStateChange(grpc_connectivity_state new_state) override;

@ -118,7 +118,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
public:
WeightedChild(RefCountedPtr<WeightedTargetLb> weighted_target_policy,
const std::string& name);
~WeightedChild();
~WeightedChild() override;
void Orphan() override;
@ -142,7 +142,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
explicit Helper(RefCountedPtr<WeightedChild> weighted_child)
: weighted_child_(std::move(weighted_child)) {}
~Helper() { weighted_child_.reset(DEBUG_LOCATION, "Helper"); }
~Helper() override { weighted_child_.reset(DEBUG_LOCATION, "Helper"); }
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override;
@ -188,7 +188,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
bool shutdown_ = false;
};
~WeightedTargetLb();
~WeightedTargetLb() override;
void ShutdownLocked() override;

@ -113,7 +113,7 @@ class CdsLb : public LoadBalancingPolicy {
RefCountedPtr<CdsLb> parent_;
};
~CdsLb();
~CdsLb() override;
void ShutdownLocked() override;

@ -144,7 +144,7 @@ class EdsLb : public LoadBalancingPolicy {
explicit Helper(RefCountedPtr<EdsLb> eds_policy)
: eds_policy_(std::move(eds_policy)) {}
~Helper() { eds_policy_.reset(DEBUG_LOCATION, "Helper"); }
~Helper() override { eds_policy_.reset(DEBUG_LOCATION, "Helper"); }
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override;
@ -160,7 +160,7 @@ class EdsLb : public LoadBalancingPolicy {
RefCountedPtr<EdsLb> eds_policy_;
};
~EdsLb();
~EdsLb() override;
void ShutdownLocked() override;

@ -141,7 +141,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
Picker(RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_lb,
RefCountedPtr<RefCountedPicker> picker);
PickResult Pick(PickArgs args);
PickResult Pick(PickArgs args) override;
private:
RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_lb_;
@ -157,7 +157,9 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
explicit Helper(RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy)
: xds_cluster_impl_policy_(std::move(xds_cluster_impl_policy)) {}
~Helper() { xds_cluster_impl_policy_.reset(DEBUG_LOCATION, "Helper"); }
~Helper() override {
xds_cluster_impl_policy_.reset(DEBUG_LOCATION, "Helper");
}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override;
@ -171,7 +173,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
RefCountedPtr<XdsClusterImplLb> xds_cluster_impl_policy_;
};
~XdsClusterImplLb();
~XdsClusterImplLb() override;
void ShutdownLocked() override;

@ -117,7 +117,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
public:
ClusterChild(RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy,
const std::string& name);
~ClusterChild();
~ClusterChild() override;
void Orphan() override;
@ -141,7 +141,9 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
explicit Helper(RefCountedPtr<ClusterChild> xds_cluster_manager_child)
: xds_cluster_manager_child_(std::move(xds_cluster_manager_child)) {}
~Helper() { xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper"); }
~Helper() override {
xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper");
}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override;
@ -182,7 +184,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
bool shutdown_ = false;
};
~XdsClusterManagerLb();
~XdsClusterManagerLb() override;
void ShutdownLocked() override;

@ -87,7 +87,7 @@ class Resolver : public InternallyRefCounted<Resolver> {
// Not copyable nor movable.
Resolver(const Resolver&) = delete;
Resolver& operator=(const Resolver&) = delete;
virtual ~Resolver() = default;
~Resolver() override = default;
/// Starts resolving.
virtual void StartLocked() = 0;

@ -75,7 +75,7 @@ class AresDnsResolver : public Resolver {
void ShutdownLocked() override;
private:
virtual ~AresDnsResolver();
~AresDnsResolver() override;
void MaybeStartResolvingLocked();
void StartResolvingLocked();

@ -49,7 +49,7 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
grpc_pollset_set_add_fd(driver_pollset_set_, fd_);
}
~GrpcPolledFdPosix() {
~GrpcPolledFdPosix() override {
grpc_pollset_set_del_fd(driver_pollset_set_, fd_);
/* c-ares library will close the fd inside grpc_fd. This fd may be picked up
immediately by another thread, and should not be closed by the following

@ -63,7 +63,7 @@ class NativeDnsResolver : public Resolver {
void ShutdownLocked() override;
private:
virtual ~NativeDnsResolver();
~NativeDnsResolver() override;
void MaybeStartResolvingLocked();
void StartResolvingLocked();

@ -59,7 +59,7 @@ class FakeResolver : public Resolver {
friend class FakeResolverResponseGenerator;
friend class FakeResolverResponseSetter;
virtual ~FakeResolver();
~FakeResolver() override;
void ShutdownLocked() override;

@ -43,7 +43,7 @@ class FakeResolverResponseGenerator
: public RefCounted<FakeResolverResponseGenerator> {
public:
FakeResolverResponseGenerator();
~FakeResolverResponseGenerator();
~FakeResolverResponseGenerator() override;
// Instructs the fake resolver associated with the response generator
// instance to trigger a new resolution with the specified result. If the

@ -140,7 +140,7 @@ class XdsResolver : public Resolver {
XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
const std::vector<XdsApi::Route>& routes,
grpc_error* error);
~XdsConfigSelector();
~XdsConfigSelector() override;
const char* name() const override { return "XdsConfigSelector"; }

@ -78,7 +78,7 @@ class ResolvingLoadBalancingPolicy::ResolverResultHandler
RefCountedPtr<ResolvingLoadBalancingPolicy> parent)
: parent_(std::move(parent)) {}
~ResolverResultHandler() {
~ResolverResultHandler() override {
if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) {
gpr_log(GPR_INFO, "resolving_lb=%p: resolver shutdown complete",
parent_.get());

@ -83,7 +83,7 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy {
grpc_core::UniquePtr<char> target_uri,
ChannelConfigHelper* helper);
virtual const char* name() const override { return "resolving_lb"; }
const char* name() const override { return "resolving_lb"; }
// No-op -- should never get updates from the channel.
// TODO(roth): Need to support updating child LB policy's config for xds
@ -100,7 +100,7 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy {
class ResolverResultHandler;
class ResolvingControlHelper;
~ResolvingLoadBalancingPolicy();
~ResolvingLoadBalancingPolicy() override;
void ShutdownLocked() override;

@ -32,7 +32,7 @@ class ServerRetryThrottleData : public RefCounted<ServerRetryThrottleData> {
public:
ServerRetryThrottleData(intptr_t max_milli_tokens, intptr_t milli_token_ratio,
ServerRetryThrottleData* old_throttle_data);
~ServerRetryThrottleData();
~ServerRetryThrottleData() override;
/// Records a failure. Returns true if it's okay to send a retry.
bool RecordFailure();

@ -71,7 +71,7 @@ class ServiceConfig : public RefCounted<ServiceConfig> {
ServiceConfig(const grpc_channel_args* args, std::string json_string,
Json json, grpc_error** error);
~ServiceConfig();
~ServiceConfig() override;
const std::string& json_string() const { return json_string_; }

@ -325,7 +325,7 @@ class Subchannel::ConnectedSubchannelStateWatcher
GRPC_SUBCHANNEL_WEAK_UNREF(subchannel_, "connecting");
}
~ConnectedSubchannelStateWatcher() {
~ConnectedSubchannelStateWatcher() override {
GRPC_SUBCHANNEL_WEAK_UNREF(subchannel_, "state_watcher");
}
@ -452,7 +452,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
if (subchannel_state == GRPC_CHANNEL_READY) StartHealthCheckingLocked();
}
~HealthWatcher() {
~HealthWatcher() override {
GRPC_SUBCHANNEL_WEAK_UNREF(subchannel_, "health_watcher");
}

@ -76,7 +76,7 @@ class ConnectedSubchannel : public RefCounted<ConnectedSubchannel> {
ConnectedSubchannel(
grpc_channel_stack* channel_stack, const grpc_channel_args* args,
RefCountedPtr<channelz::SubchannelNode> channelz_subchannel);
~ConnectedSubchannel();
~ConnectedSubchannel() override;
void StartWatch(grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
@ -186,7 +186,7 @@ class Subchannel {
RefCountedPtr<ConnectedSubchannel> connected_subchannel;
};
virtual ~ConnectivityStateWatcherInterface() = default;
~ConnectivityStateWatcherInterface() override = default;
// Will be invoked whenever the subchannel's connectivity state
// changes. There will be only one invocation of this method on a

@ -50,7 +50,7 @@ class SubchannelInterface : public RefCounted<SubchannelInterface> {
explicit SubchannelInterface(const char* trace = nullptr)
: RefCounted<SubchannelInterface>(trace) {}
virtual ~SubchannelInterface() = default;
~SubchannelInterface() override = default;
// Returns the current connectivity state of the subchannel.
virtual grpc_connectivity_state CheckConnectivityState() = 0;

@ -67,7 +67,7 @@ class SubchannelPoolInterface : public RefCounted<SubchannelPoolInterface> {
: RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_subchannel_pool_trace)
? "SubchannelPoolInterface"
: nullptr) {}
virtual ~SubchannelPoolInterface() {}
~SubchannelPoolInterface() override {}
// Registers a subchannel against a key. Returns the subchannel registered
// with \a key, which may be different from \a constructed because we reuse

@ -224,7 +224,7 @@ class ConnectivityWatcher : public AsyncConnectivityStateWatcherInterface {
GRPC_CHANNEL_STACK_REF(chand_->channel_stack, "max_age conn_watch");
}
~ConnectivityWatcher() {
~ConnectivityWatcher() override {
GRPC_CHANNEL_STACK_UNREF(chand_->channel_stack, "max_age conn_watch");
}

@ -30,7 +30,7 @@ namespace grpc_core {
class Chttp2Connector : public SubchannelConnector {
public:
Chttp2Connector();
~Chttp2Connector();
~Chttp2Connector() override;
void Connect(const Args& args, Result* result, grpc_closure* notify) override;
void Shutdown(grpc_error* error) override;

@ -63,7 +63,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
// Do not instantiate directly. Use one of the factory methods above.
Chttp2ServerListener(Server* server, grpc_channel_args* args);
~Chttp2ServerListener();
~Chttp2ServerListener() override;
void Start(Server* server,
const std::vector<grpc_pollset*>* pollsets) override;
@ -85,7 +85,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
RefCountedPtr<HandshakeManager> handshake_mgr,
grpc_channel_args* args, grpc_endpoint* endpoint);
~ConnectionState();
~ConnectionState() override;
private:
static void OnTimeout(void* arg, grpc_error* error);

@ -221,7 +221,7 @@ class TransportFlowControlDisabled final : public TransportFlowControlBase {
class TransportFlowControl final : public TransportFlowControlBase {
public:
TransportFlowControl(const grpc_chttp2_transport* t, bool enable_bdp_probe);
~TransportFlowControl() {}
~TransportFlowControl() override {}
bool flow_control_enabled() const override { return true; }
@ -409,7 +409,7 @@ class StreamFlowControlDisabled : public StreamFlowControlBase {
class StreamFlowControl final : public StreamFlowControlBase {
public:
StreamFlowControl(TransportFlowControl* tfc, const grpc_chttp2_stream* s);
~StreamFlowControl() {
~StreamFlowControl() override {
tfc_->PreUpdateAnnouncedWindowOverIncomingWindow(announced_window_delta_);
}

@ -86,7 +86,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
// Callers should not instantiate directly. Use GetOrCreate() instead.
explicit XdsClient(grpc_error** error);
~XdsClient();
~XdsClient() override;
grpc_pollset_set* interested_parties() const { return interested_parties_; }
@ -199,7 +199,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
grpc_channel* channel);
~ChannelState();
~ChannelState() override;
void Orphan() override;

@ -131,7 +131,7 @@ class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
absl::string_view lrs_server_name,
absl::string_view cluster_name,
absl::string_view eds_service_name);
~XdsClusterDropStats();
~XdsClusterDropStats() override;
// Returns a snapshot of this instance and resets all the counters.
Snapshot GetSnapshotAndReset();
@ -206,7 +206,7 @@ class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
absl::string_view cluster_name,
absl::string_view eds_service_name,
RefCountedPtr<XdsLocalityName> name);
~XdsClusterLocalityStats();
~XdsClusterLocalityStats() override;
// Returns a snapshot of this instance and resets all the counters.
Snapshot GetSnapshotAndReset();

@ -87,7 +87,7 @@ class BaseNode : public RefCounted<BaseNode> {
BaseNode(EntityType type, std::string name);
public:
virtual ~BaseNode();
~BaseNode() override;
// All children must implement this function.
virtual Json RenderJson() = 0;

@ -77,7 +77,7 @@ struct HandshakerArgs {
class Handshaker : public RefCounted<Handshaker> {
public:
virtual ~Handshaker() = default;
~Handshaker() override = default;
virtual void Shutdown(grpc_error* why) = 0;
virtual void DoHandshake(grpc_tcp_server_acceptor* acceptor,
grpc_closure* on_handshake_done,
@ -92,7 +92,7 @@ class Handshaker : public RefCounted<Handshaker> {
class HandshakeManager : public RefCounted<HandshakeManager> {
public:
HandshakeManager();
~HandshakeManager();
~HandshakeManager() override;
/// Add \a mgr to the server side list of all pending handshake managers, the
/// list starts with \a *head.

@ -51,7 +51,7 @@ namespace grpc_core {
template <typename Child>
class DualRefCounted : public Orphanable {
public:
virtual ~DualRefCounted() = default;
~DualRefCounted() override = default;
RefCountedPtr<Child> Ref() GRPC_MUST_USE_RESULT {
IncrementRefCount();

@ -88,7 +88,7 @@ class InternallyRefCounted : public Orphanable {
explicit InternallyRefCounted(const char* trace = nullptr,
intptr_t initial_refcount = 1)
: refs_(initial_refcount, trace) {}
virtual ~InternallyRefCounted() = default;
~InternallyRefCounted() override = default;
RefCountedPtr<Child> Ref() GRPC_MUST_USE_RESULT {
IncrementRefCount();

@ -55,22 +55,22 @@ class InfLenFIFOQueue : public MPMCQueueInterface {
// Releases all resources held by the queue. The queue must be empty, and no
// one waits on conditional variables.
~InfLenFIFOQueue();
~InfLenFIFOQueue() override;
// Puts elem into queue immediately at the end of queue. Since the queue has
// infinite length, this routine will never block and should never fail.
void Put(void* elem);
void Put(void* elem) override;
// Removes the oldest element from the queue and returns it.
// This routine will cause the thread to block if queue is currently empty.
// Argument wait_time should be passed in when trace flag turning on (for
// collecting stats info purpose.)
void* Get(gpr_timespec* wait_time = nullptr);
void* Get(gpr_timespec* wait_time = nullptr) override;
// Returns number of elements in queue currently.
// There might be concurrently add/remove on queue, so count might change
// quickly.
int count() const { return count_.Load(MemoryOrder::RELAXED); }
int count() const override { return count_.Load(MemoryOrder::RELAXED); }
struct Node {
Node* next; // Linking

@ -44,7 +44,7 @@ struct grpc_tls_certificate_provider
grpc_tls_certificate_provider()
: interested_parties_(grpc_pollset_set_create()) {}
virtual ~grpc_tls_certificate_provider() {
~grpc_tls_certificate_provider() override {
grpc_pollset_set_destroy(interested_parties_);
}

@ -102,7 +102,7 @@ struct grpc_channel_credentials
: grpc_core::RefCounted<grpc_channel_credentials> {
public:
explicit grpc_channel_credentials(const char* type) : type_(type) {}
virtual ~grpc_channel_credentials() = default;
~grpc_channel_credentials() override = default;
// Creates a security connector for the channel. May also create new channel
// args for the channel to be used in place of the passed in const args if
@ -177,7 +177,7 @@ struct grpc_call_credentials
grpc_security_level min_security_level = GRPC_PRIVACY_AND_INTEGRITY)
: type_(type), min_security_level_(min_security_level) {}
virtual ~grpc_call_credentials() = default;
~grpc_call_credentials() override = default;
// Returns true if completed synchronously, in which case \a error will
// be set to indicate the result. Otherwise, \a on_request_metadata will
@ -225,7 +225,7 @@ struct grpc_server_credentials
public:
explicit grpc_server_credentials(const char* type) : type_(type) {}
virtual ~grpc_server_credentials() { DestroyProcessor(); }
~grpc_server_credentials() override { DestroyProcessor(); }
virtual grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector() = 0;

@ -96,7 +96,7 @@ struct grpc_tls_credential_reload_config
void (*cancel)(void* config_user_data,
grpc_tls_credential_reload_arg* arg),
void (*destruct)(void* config_user_data));
~grpc_tls_credential_reload_config();
~grpc_tls_credential_reload_config() override;
void* context() const { return context_; }
void set_context(void* context) { context_ = context; }
@ -172,7 +172,7 @@ struct grpc_tls_server_authorization_check_config
void (*cancel)(void* config_user_data,
grpc_tls_server_authorization_check_arg* arg),
void (*destruct)(void* config_user_data));
~grpc_tls_server_authorization_check_config();
~grpc_tls_server_authorization_check_config() override;
void* context() const { return context_; }
void set_context(void* context) { context_ = context; }
@ -245,7 +245,7 @@ struct grpc_tls_server_authorization_check_config
struct grpc_tls_credentials_options
: public grpc_core::RefCounted<grpc_tls_credentials_options> {
public:
~grpc_tls_credentials_options() {
~grpc_tls_credentials_options() override {
if (key_materials_config_.get() != nullptr) {
key_materials_config_.get()->Unref();
}

@ -53,7 +53,7 @@ class grpc_security_connector
? "security_connector_refcount"
: nullptr),
url_scheme_(url_scheme) {}
virtual ~grpc_security_connector() = default;
~grpc_security_connector() override = default;
/* Check the peer. Callee takes ownership of the peer object.
When done, sets *auth_context and invokes on_peer_checked. */

@ -499,7 +499,7 @@ class FailHandshaker : public Handshaker {
}
private:
virtual ~FailHandshaker() = default;
~FailHandshaker() override = default;
};
//

@ -936,7 +936,7 @@ class Server::ChannelData::ConnectivityWatcher
GRPC_CHANNEL_INTERNAL_REF(chand_->channel_, "connectivity");
}
~ConnectivityWatcher() {
~ConnectivityWatcher() override {
GRPC_CHANNEL_INTERNAL_UNREF(chand_->channel_, "connectivity");
}

@ -71,7 +71,7 @@ class Server : public InternallyRefCounted<Server> {
/// listening and initiate destruction of the listener.
class ListenerInterface : public Orphanable {
public:
virtual ~ListenerInterface() = default;
~ListenerInterface() override = default;
/// Starts listening. This listener may refer to the pollset object beyond
/// this call, so it is a pointer rather than a reference.
@ -88,7 +88,7 @@ class Server : public InternallyRefCounted<Server> {
};
explicit Server(const grpc_channel_args* args);
~Server();
~Server() override;
void Orphan() override;

@ -40,7 +40,7 @@ namespace grpc_core {
class ByteStream : public Orphanable {
public:
virtual ~ByteStream() {}
~ByteStream() override {}
// Returns true if the bytes are available immediately (in which case
// on_complete will not be called), or false if the bytes will be available
@ -92,7 +92,7 @@ class SliceBufferByteStream : public ByteStream {
// Removes all slices in slice_buffer, leaving it empty.
SliceBufferByteStream(grpc_slice_buffer* slice_buffer, uint32_t flags);
~SliceBufferByteStream();
~SliceBufferByteStream() override;
void Orphan() override;
@ -126,7 +126,7 @@ class ByteStreamCache {
public:
explicit CachingByteStream(ByteStreamCache* cache);
~CachingByteStream();
~CachingByteStream() override;
void Orphan() override;

@ -48,7 +48,7 @@ const char* ConnectivityStateName(grpc_connectivity_state state);
class ConnectivityStateWatcherInterface
: public InternallyRefCounted<ConnectivityStateWatcherInterface> {
public:
virtual ~ConnectivityStateWatcherInterface() = default;
~ConnectivityStateWatcherInterface() override = default;
// Notifies the watcher that the state has changed to new_state.
virtual void Notify(grpc_connectivity_state new_state,
@ -63,12 +63,12 @@ class ConnectivityStateWatcherInterface
class AsyncConnectivityStateWatcherInterface
: public ConnectivityStateWatcherInterface {
public:
virtual ~AsyncConnectivityStateWatcherInterface() = default;
~AsyncConnectivityStateWatcherInterface() override = default;
// Schedules a closure on the ExecCtx to invoke
// OnConnectivityStateChange() asynchronously.
void Notify(grpc_connectivity_state new_state,
const absl::Status& status) override final;
const absl::Status& status) final;
protected:
class Notifier;

@ -53,7 +53,7 @@ class SslSessionLRUCache : public grpc_core::RefCounted<SslSessionLRUCache> {
// Use Create function instead of using this directly.
explicit SslSessionLRUCache(size_t capacity);
~SslSessionLRUCache();
~SslSessionLRUCache() override;
// Not copyable nor movable.
SslSessionLRUCache(const SslSessionLRUCache&) = delete;

@ -37,7 +37,7 @@ class Channel;
class SecureChannelCredentials final : public ChannelCredentials {
public:
explicit SecureChannelCredentials(grpc_channel_credentials* c_creds);
~SecureChannelCredentials() {
~SecureChannelCredentials() override {
if (c_creds_ != nullptr) c_creds_->Unref();
}
grpc_channel_credentials* GetRawCreds() { return c_creds_; }
@ -59,7 +59,7 @@ class SecureChannelCredentials final : public ChannelCredentials {
class SecureCallCredentials final : public CallCredentials {
public:
explicit SecureCallCredentials(grpc_call_credentials* c_creds);
~SecureCallCredentials() {
~SecureCallCredentials() override {
if (c_creds_ != nullptr) c_creds_->Unref();
}
grpc_call_credentials* GetRawCreds() { return c_creds_; }

@ -41,7 +41,7 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
gpr_ref_init(&refs_, 1);
grpc_timer_init_unset(&timer_);
}
~AlarmImpl() {}
~AlarmImpl() override {}
bool FinalizeResult(void** tag, bool* /*status*/) override {
*tag = tag_;
Unref();

@ -49,7 +49,7 @@ class SecureAuthContext final : public AuthContext {
void AddProperty(const std::string& key,
const grpc::string_ref& value) override;
virtual bool SetPeerIdentityPropertyName(const std::string& name) override;
bool SetPeerIdentityPropertyName(const std::string& name) override;
private:
grpc_core::RefCountedPtr<grpc_auth_context> ctx_;

@ -27,10 +27,10 @@ std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
StringOption(const std::string& name, const std::string& value)
: name_(name), value_(value) {}
virtual void UpdateArguments(ChannelArguments* args) override {
void UpdateArguments(ChannelArguments* args) override {
args->SetString(name_, value_);
}
virtual void UpdatePlugins(
void UpdatePlugins(
std::vector<std::unique_ptr<ServerBuilderPlugin>>* /*plugins*/)
override {}
@ -48,10 +48,10 @@ std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
IntOption(const std::string& name, int value)
: name_(name), value_(value) {}
virtual void UpdateArguments(ChannelArguments* args) override {
void UpdateArguments(ChannelArguments* args) override {
args->SetInt(name_, value_);
}
virtual void UpdatePlugins(
void UpdatePlugins(
std::vector<std::unique_ptr<ServerBuilderPlugin>>* /*plugins*/)
override {}

@ -34,7 +34,7 @@ namespace grpc {
class DynamicThreadPool final : public ThreadPoolInterface {
public:
explicit DynamicThreadPool(int reserve_threads);
~DynamicThreadPool();
~DynamicThreadPool() override;
void Add(const std::function<void()>& callback) override;

@ -56,7 +56,7 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
HealthCheckServiceImpl(DefaultHealthCheckService* database,
std::unique_ptr<ServerCompletionQueue> cq);
~HealthCheckServiceImpl();
~HealthCheckServiceImpl() override;
void StartServingThread();

@ -41,7 +41,7 @@ class LoadReporterAsyncServiceImpl
public:
explicit LoadReporterAsyncServiceImpl(
std::unique_ptr<ServerCompletionQueue> cq);
~LoadReporterAsyncServiceImpl();
~LoadReporterAsyncServiceImpl() override;
// Starts the working thread.
void StartThread();

@ -81,12 +81,16 @@ void InitGlobalCallbacks() {
class ShutdownTag : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** /*tag*/, bool* /*status*/) { return false; }
bool FinalizeResult(void** /*tag*/, bool* /*status*/) override {
return false;
}
};
class DummyTag : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** /*tag*/, bool* /*status*/) { return true; }
bool FinalizeResult(void** /*tag*/, bool* /*status*/) override {
return true;
}
};
class UnimplementedAsyncRequestContext {
@ -310,7 +314,7 @@ class Server::UnimplementedAsyncResponse final
grpc::internal::CallOpServerSendStatus> {
public:
UnimplementedAsyncResponse(UnimplementedAsyncRequest* request);
~UnimplementedAsyncResponse() { delete request_; }
~UnimplementedAsyncResponse() override { delete request_; }
bool FinalizeResult(void** tag, bool* status) override {
if (grpc::internal::CallOpSet<
@ -343,7 +347,7 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
grpc_metadata_array_init(&request_metadata_);
}
~SyncRequest() {
~SyncRequest() override {
if (call_details_) {
delete call_details_;
}
@ -567,7 +571,7 @@ class Server::CallbackRequest final
data->details = call_details_;
}
~CallbackRequest() {
~CallbackRequest() override {
delete call_details_;
grpc_metadata_array_destroy(&request_metadata_);
if (has_request_payload_ && request_payload_) {

@ -62,7 +62,7 @@ class ServerContextBase::CompletionOp final
CompletionOp(CompletionOp&&) = delete;
CompletionOp& operator=(CompletionOp&&) = delete;
~CompletionOp() {
~CompletionOp() override {
if (call_.server_rpc_info()) {
call_.server_rpc_info()->Unref();
}

@ -30,7 +30,7 @@ namespace {
class Foo : public DualRefCounted<Foo> {
public:
Foo() = default;
~Foo() { GPR_ASSERT(shutting_down_); }
~Foo() override { GPR_ASSERT(shutting_down_); }
void Orphan() override { shutting_down_ = true; }
@ -75,7 +75,7 @@ TEST(DualRefCounted, RefIfNonZero) {
class FooWithTracing : public DualRefCounted<FooWithTracing> {
public:
FooWithTracing() : DualRefCounted("FooWithTracing") {}
~FooWithTracing() { GPR_ASSERT(shutting_down_); }
~FooWithTracing() override { GPR_ASSERT(shutting_down_); }
void Orphan() override { shutting_down_ = true; }

@ -39,7 +39,7 @@ class A {
class B : public A {
public:
B() {}
~B() {}
~B() override {}
const char* foo() override { return "B_foo"; }
char get_junk() { return junk[0]; }
@ -50,8 +50,8 @@ class B : public A {
class C : public B {
public:
C() {}
~C() {}
virtual const char* bar() { return "C_bar"; }
~C() override {}
const char* bar() override { return "C_bar"; }
char get_more_junk() { return more_junk[0]; }
private:
@ -60,7 +60,7 @@ class C : public B {
class D : public A {
public:
virtual const char* bar() { return "D_bar"; }
const char* bar() override { return "D_bar"; }
};
static void basic_test() {

@ -266,7 +266,7 @@ class Bar : public DualRefCounted<Bar> {
explicit Bar(int value) : value_(value) {}
~Bar() { GPR_ASSERT(shutting_down_); }
~Bar() override { GPR_ASSERT(shutting_down_); }
void Orphan() override { shutting_down_ = true; }
@ -422,7 +422,7 @@ class BarWithTracing : public DualRefCounted<BarWithTracing> {
public:
BarWithTracing() : DualRefCounted("BarWithTracing") {}
~BarWithTracing() { GPR_ASSERT(shutting_down_); }
~BarWithTracing() override { GPR_ASSERT(shutting_down_); }
void Orphan() override { shutting_down_ = true; }
@ -442,7 +442,7 @@ class WeakBaseClass : public DualRefCounted<WeakBaseClass> {
public:
WeakBaseClass() {}
~WeakBaseClass() { GPR_ASSERT(shutting_down_); }
~WeakBaseClass() override { GPR_ASSERT(shutting_down_); }
void Orphan() override { shutting_down_ = true; }

@ -53,7 +53,7 @@ namespace grpc_core {
class ReadAheadHandshaker : public Handshaker {
public:
virtual ~ReadAheadHandshaker() {}
~ReadAheadHandshaker() override {}
const char* name() const override { return "read_ahead"; }
void Shutdown(grpc_error* /*why*/) override {}
void DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,

@ -1579,19 +1579,19 @@ struct fake_call_creds : public grpc_call_credentials {
grpc_slice_unref(value);
}
~fake_call_creds() { GRPC_MDELEM_UNREF(dummy_md_); }
~fake_call_creds() override { GRPC_MDELEM_UNREF(dummy_md_); }
bool get_request_metadata(grpc_polling_entity* pollent,
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
grpc_error** error) {
grpc_error** error) override {
grpc_credentials_mdelem_array_add(md_array, dummy_md_);
return true;
}
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
grpc_error* error) {}
grpc_error* error) override {}
private:
grpc_mdelem dummy_md_;
@ -2001,9 +2001,10 @@ class TestExternalAccountCredentials final
: ExternalAccountCredentials(std::move(options), std::move(scopes)) {}
protected:
void RetrieveSubjectToken(const HTTPRequestContext* ctx,
const ExternalAccountCredentialsOptions& options,
std::function<void(std::string, grpc_error*)> cb) {
void RetrieveSubjectToken(
const HTTPRequestContext* ctx,
const ExternalAccountCredentialsOptions& options,
std::function<void(std::string, grpc_error*)> cb) override {
cb("test_subject_token", GRPC_ERROR_NONE);
}
};

@ -126,7 +126,7 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test {
}
// dtor sets state->watcher to nullptr.
~TlsCertificatesTestWatcher() { state_->watcher = nullptr; }
~TlsCertificatesTestWatcher() override { state_->watcher = nullptr; }
void OnCertificatesChanged(
absl::optional<absl::string_view> root_certs,

@ -49,7 +49,7 @@ class Watcher : public ConnectivityStateWatcherInterface {
status_(status),
destroyed_(destroyed) {}
~Watcher() {
~Watcher() override {
if (destroyed_ != nullptr) *destroyed_ = true;
}

@ -73,9 +73,10 @@ TEST_P(FuzzerCorpusTest, RunOneExample) {
class ExampleGenerator
: public ::testing::internal::ParamGeneratorInterface<std::string> {
public:
virtual ::testing::internal::ParamIteratorInterface<std::string>* Begin()
const;
virtual ::testing::internal::ParamIteratorInterface<std::string>* End() const;
::testing::internal::ParamIteratorInterface<std::string>* Begin()
const override;
::testing::internal::ParamIteratorInterface<std::string>* End()
const override;
private:
void Materialize() const {
@ -124,13 +125,13 @@ class ExampleIterator
std::vector<std::string>::const_iterator begin)
: base_(base_), begin_(begin), current_(begin) {}
virtual const ExampleGenerator* BaseGenerator() const { return &base_; }
const ExampleGenerator* BaseGenerator() const override { return &base_; }
virtual void Advance() { current_++; }
virtual ExampleIterator* Clone() const { return new ExampleIterator(*this); }
virtual const std::string* Current() const { return &*current_; }
void Advance() override { current_++; }
ExampleIterator* Clone() const override { return new ExampleIterator(*this); }
const std::string* Current() const override { return &*current_; }
virtual bool Equals(const ParamIteratorInterface<std::string>& other) const {
bool Equals(const ParamIteratorInterface<std::string>& other) const override {
return &base_ == other.BaseGenerator() &&
current_ == dynamic_cast<const ExampleIterator*>(&other)->current_;
}

@ -64,7 +64,7 @@ class HijackingInterceptor : public experimental::Interceptor {
EXPECT_EQ(info->type(), experimental::ClientRpcInfo::Type::UNARY);
}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
bool hijack = false;
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
@ -155,7 +155,7 @@ class HijackingInterceptor : public experimental::Interceptor {
class HijackingInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) override {
return new HijackingInterceptor(info);
}
@ -169,7 +169,7 @@ class HijackingInterceptorMakesAnotherCall : public experimental::Interceptor {
EXPECT_EQ(strcmp("/grpc.testing.EchoTestService/Echo", info->method()), 0);
}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
auto* map = methods->GetSendInitialMetadata();
@ -277,7 +277,7 @@ class HijackingInterceptorMakesAnotherCall : public experimental::Interceptor {
class HijackingInterceptorMakesAnotherCallFactory
: public experimental::ClientInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) override {
return new HijackingInterceptorMakesAnotherCall(info);
}
@ -289,7 +289,7 @@ class BidiStreamingRpcHijackingInterceptor : public experimental::Interceptor {
info_ = info;
}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
bool hijack = false;
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
@ -358,7 +358,7 @@ class ClientStreamingRpcHijackingInterceptor
ClientStreamingRpcHijackingInterceptor(experimental::ClientRpcInfo* info) {
info_ = info;
}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
bool hijack = false;
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
@ -400,7 +400,7 @@ bool ClientStreamingRpcHijackingInterceptor::got_failed_send_ = false;
class ClientStreamingRpcHijackingInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) override {
return new ClientStreamingRpcHijackingInterceptor(info);
}
@ -414,7 +414,7 @@ class ServerStreamingRpcHijackingInterceptor
got_failed_message_ = false;
}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
bool hijack = false;
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
@ -498,7 +498,7 @@ bool ServerStreamingRpcHijackingInterceptor::got_failed_message_ = false;
class ServerStreamingRpcHijackingInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) override {
return new ServerStreamingRpcHijackingInterceptor(info);
}
@ -507,7 +507,7 @@ class ServerStreamingRpcHijackingInterceptorFactory
class BidiStreamingRpcHijackingInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) override {
return new BidiStreamingRpcHijackingInterceptor(info);
}
@ -528,7 +528,7 @@ class LoggingInterceptor : public experimental::Interceptor {
post_recv_status_ = false;
}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
auto* map = methods->GetSendInitialMetadata();
@ -677,7 +677,7 @@ bool LoggingInterceptor::post_recv_status_;
class LoggingInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) override {
return new LoggingInterceptor(info);
}
@ -717,7 +717,9 @@ class ParameterizedClientInterceptorsEnd2endTest
server_ = builder.BuildAndStart();
}
~ParameterizedClientInterceptorsEnd2endTest() { server_->Shutdown(); }
~ParameterizedClientInterceptorsEnd2endTest() override {
server_->Shutdown();
}
void SendRPC(const std::shared_ptr<Channel>& channel) {
switch (GetParam().type()) {
@ -791,7 +793,7 @@ class ClientInterceptorsEnd2endTest
server_ = builder.BuildAndStart();
}
~ClientInterceptorsEnd2endTest() { server_->Shutdown(); }
~ClientInterceptorsEnd2endTest() override { server_->Shutdown(); }
std::string server_address_;
TestServiceImpl service_;
@ -890,7 +892,7 @@ class ClientInterceptorsCallbackEnd2endTest : public ::testing::Test {
server_ = builder.BuildAndStart();
}
~ClientInterceptorsCallbackEnd2endTest() { server_->Shutdown(); }
~ClientInterceptorsCallbackEnd2endTest() override { server_->Shutdown(); }
std::string server_address_;
TestServiceImpl service_;
@ -953,7 +955,7 @@ class ClientInterceptorsStreamingEnd2endTest : public ::testing::Test {
server_ = builder.BuildAndStart();
}
~ClientInterceptorsStreamingEnd2endTest() { server_->Shutdown(); }
~ClientInterceptorsStreamingEnd2endTest() override { server_->Shutdown(); }
std::string server_address_;
EchoTestServiceStreamingImpl service_;
@ -1103,7 +1105,7 @@ class ClientGlobalInterceptorEnd2endTest : public ::testing::Test {
server_ = builder.BuildAndStart();
}
~ClientGlobalInterceptorEnd2endTest() { server_->Shutdown(); }
~ClientGlobalInterceptorEnd2endTest() override { server_->Shutdown(); }
std::string server_address_;
TestServiceImpl service_;

@ -64,7 +64,7 @@ class DelegatingChannelTest : public ::testing::Test {
server_ = builder.BuildAndStart();
}
~DelegatingChannelTest() { server_->Shutdown(); }
~DelegatingChannelTest() override { server_->Shutdown(); }
std::string server_address_;
TestServiceImpl service_;

@ -1858,7 +1858,7 @@ class CredentialsInterceptor : public experimental::Interceptor {
public:
CredentialsInterceptor(experimental::ClientRpcInfo* info) : info_(info) {}
void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
std::shared_ptr<CallCredentials> creds =
@ -1875,7 +1875,7 @@ class CredentialsInterceptor : public experimental::Interceptor {
class CredentialsInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface {
CredentialsInterceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* info) {
experimental::ClientRpcInfo* info) override {
return new CredentialsInterceptor(info);
}
};
@ -2245,7 +2245,7 @@ class ResourceQuotaEnd2endTest : public End2endTest {
ResourceQuotaEnd2endTest()
: server_resource_quota_("server_resource_quota") {}
virtual void ConfigureServerBuilder(ServerBuilder* builder) override {
void ConfigureServerBuilder(ServerBuilder* builder) override {
builder->SetResourceQuota(server_resource_quota_);
}

@ -101,7 +101,7 @@ int GetCallCounterValue() {
class ChannelDataImpl : public ChannelData {
public:
grpc_error* Init(grpc_channel_element* /*elem*/,
grpc_channel_element_args* /*args*/) {
grpc_channel_element_args* /*args*/) override {
IncrementConnectionCounter();
return GRPC_ERROR_NONE;
}

@ -33,7 +33,7 @@ class DummyInterceptor : public experimental::Interceptor {
public:
DummyInterceptor() {}
virtual void Intercept(experimental::InterceptorBatchMethods* methods) {
void Intercept(experimental::InterceptorBatchMethods* methods) override {
if (methods->QueryInterceptionHookPoint(
experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) {
num_times_run_++;
@ -71,12 +71,12 @@ class DummyInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface,
public experimental::ServerInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* /*info*/) override {
return new DummyInterceptor();
}
virtual experimental::Interceptor* CreateServerInterceptor(
experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* /*info*/) override {
return new DummyInterceptor();
}
@ -87,12 +87,12 @@ class NullInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface,
public experimental::ServerInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateClientInterceptor(
experimental::Interceptor* CreateClientInterceptor(
experimental::ClientRpcInfo* /*info*/) override {
return nullptr;
}
virtual experimental::Interceptor* CreateServerInterceptor(
experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* /*info*/) override {
return nullptr;
}

@ -127,7 +127,7 @@ class MessageAllocatorEnd2endTestBase
}
}
~MessageAllocatorEnd2endTestBase() = default;
~MessageAllocatorEnd2endTestBase() override = default;
void CreateServer(
experimental::MessageAllocator<EchoRequest, EchoResponse>* allocator) {

@ -140,7 +140,7 @@ class LoggingInterceptor : public experimental::Interceptor {
class LoggingInterceptorFactory
: public experimental::ServerInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateServerInterceptor(
experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* info) override {
return new LoggingInterceptor(info);
}
@ -170,7 +170,7 @@ class SyncSendMessageTester : public experimental::Interceptor {
class SyncSendMessageTesterFactory
: public experimental::ServerInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateServerInterceptor(
experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* info) override {
return new SyncSendMessageTester(info);
}
@ -205,7 +205,7 @@ class SyncSendMessageVerifier : public experimental::Interceptor {
class SyncSendMessageVerifierFactory
: public experimental::ServerInterceptorFactoryInterface {
public:
virtual experimental::Interceptor* CreateServerInterceptor(
experimental::Interceptor* CreateServerInterceptor(
experimental::ServerRpcInfo* info) override {
return new SyncSendMessageVerifier(info);
}

@ -148,14 +148,14 @@ class TimeChangeTest : public ::testing::Test {
static void TearDownTestCase() { server_.reset(); }
void SetUp() {
void SetUp() override {
channel_ =
grpc::CreateChannel(server_address_, InsecureChannelCredentials());
GPR_ASSERT(channel_);
stub_ = grpc::testing::EchoTestService::NewStub(channel_);
}
void TearDown() { reset_now_offset(); }
void TearDown() override { reset_now_offset(); }
std::unique_ptr<grpc::testing::EchoTestService::Stub> CreateStub() {
return grpc::testing::EchoTestService::NewStub(channel_);

@ -70,7 +70,7 @@ class StatsPluginEnd2EndTest : public ::testing::Test {
protected:
static void SetUpTestCase() { RegisterOpenCensusPlugin(); }
void SetUp() {
void SetUp() override {
// Set up a synchronous server on a different thread to avoid the asynch
// interface.
::grpc::ServerBuilder builder;
@ -89,7 +89,7 @@ class StatsPluginEnd2EndTest : public ::testing::Test {
server_address_, ::grpc::InsecureChannelCredentials()));
}
void TearDown() {
void TearDown() override {
server_->Shutdown();
server_thread_.join();
}

@ -139,7 +139,7 @@ class TestServiceImpl : public TestService::Service {
public:
Status EmptyCall(ServerContext* context,
const grpc::testing::Empty* /*request*/,
grpc::testing::Empty* /*response*/) {
grpc::testing::Empty* /*response*/) override {
MaybeEchoMetadata(context);
return Status::OK;
}
@ -147,7 +147,7 @@ class TestServiceImpl : public TestService::Service {
// Response contains current timestamp. We ignore everything in the request.
Status CacheableUnaryCall(ServerContext* context,
const SimpleRequest* /*request*/,
SimpleResponse* response) {
SimpleResponse* response) override {
gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE);
std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec);
response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size());
@ -156,7 +156,7 @@ class TestServiceImpl : public TestService::Service {
}
Status UnaryCall(ServerContext* context, const SimpleRequest* request,
SimpleResponse* response) {
SimpleResponse* response) override {
MaybeEchoMetadata(context);
if (request->has_response_compressed()) {
const bool compression_requested = request->response_compressed().value();
@ -192,7 +192,7 @@ class TestServiceImpl : public TestService::Service {
Status StreamingOutputCall(
ServerContext* context, const StreamingOutputCallRequest* request,
ServerWriter<StreamingOutputCallResponse>* writer) {
ServerWriter<StreamingOutputCallResponse>* writer) override {
StreamingOutputCallResponse response;
bool write_success = true;
for (int i = 0; write_success && i < request->response_parameters_size();
@ -233,7 +233,7 @@ class TestServiceImpl : public TestService::Service {
Status StreamingInputCall(ServerContext* context,
ServerReader<StreamingInputCallRequest>* reader,
StreamingInputCallResponse* response) {
StreamingInputCallResponse* response) override {
StreamingInputCallRequest request;
int aggregated_payload_size = 0;
while (reader->Read(&request)) {
@ -253,7 +253,7 @@ class TestServiceImpl : public TestService::Service {
Status FullDuplexCall(
ServerContext* context,
ServerReaderWriter<StreamingOutputCallResponse,
StreamingOutputCallRequest>* stream) {
StreamingOutputCallRequest>* stream) override {
MaybeEchoMetadata(context);
StreamingOutputCallRequest request;
StreamingOutputCallResponse response;
@ -289,7 +289,7 @@ class TestServiceImpl : public TestService::Service {
Status HalfDuplexCall(
ServerContext* /*context*/,
ServerReaderWriter<StreamingOutputCallResponse,
StreamingOutputCallRequest>* stream) {
StreamingOutputCallRequest>* stream) override {
std::vector<StreamingOutputCallRequest> requests;
StreamingOutputCallRequest request;
while (stream->Read(&request)) {

@ -69,7 +69,7 @@ class ReconnectServiceImpl : public ReconnectService::Service {
reconnect_server_init(&tcp_server_);
}
~ReconnectServiceImpl() {
~ReconnectServiceImpl() override {
if (server_started_) {
reconnect_server_destroy(&tcp_server_);
}
@ -78,7 +78,7 @@ class ReconnectServiceImpl : public ReconnectService::Service {
void Poll(int seconds) { reconnect_server_poll(&tcp_server_, seconds); }
Status Start(ServerContext* /*context*/, const ReconnectParams* request,
Empty* /*response*/) {
Empty* /*response*/) override {
bool start_server = true;
std::unique_lock<std::mutex> lock(mu_);
while (serving_ && !shutdown_) {
@ -106,7 +106,7 @@ class ReconnectServiceImpl : public ReconnectService::Service {
}
Status Stop(ServerContext* /*context*/, const Empty* /*request*/,
ReconnectInfo* response) {
ReconnectInfo* response) override {
// extract timestamps and set response
Verify(response);
reconnect_server_clear_timestamps(&tcp_server_);

@ -271,7 +271,7 @@ class LoadBalancerStatsServiceImpl : public LoadBalancerStatsService::Service {
public:
Status GetClientStats(ServerContext* context,
const LoadBalancerStatsRequest* request,
LoadBalancerStatsResponse* response) {
LoadBalancerStatsResponse* response) override {
int start_id;
int end_id;
XdsStatsWatcher* watcher;

@ -56,7 +56,7 @@ class TestServiceImpl : public TestService::Service {
TestServiceImpl(const std::string& i) : hostname_(i) {}
Status UnaryCall(ServerContext* context, const SimpleRequest* request,
SimpleResponse* response) {
SimpleResponse* response) override {
response->set_server_id(FLAGS_server_id);
response->set_hostname(hostname_);
context->AddInitialMetadata("hostname", hostname_);
@ -64,7 +64,7 @@ class TestServiceImpl : public TestService::Service {
}
Status EmptyCall(ServerContext* context, const Empty* request,
Empty* response) {
Empty* response) override {
context->AddInitialMetadata("hostname", hostname_);
return Status::OK;
}

@ -703,7 +703,7 @@ class IsolatedCallFixture : public TrackCounters {
cq_ = grpc_completion_queue_create_for_next(nullptr);
}
void Finish(benchmark::State& state) {
void Finish(benchmark::State& state) override {
grpc_completion_queue_destroy(cq_);
grpc_channel_destroy(channel_);
TrackCounters::Finish(state);

@ -104,13 +104,13 @@ class TrickledCHTTP2 : public EndpointPairFixture {
}
}
virtual ~TrickledCHTTP2() {
~TrickledCHTTP2() override {
if (stats_ != nullptr) {
grpc_passthru_endpoint_stats_destroy(stats_);
}
}
void AddToLabel(std::ostream& out, benchmark::State& state) {
void AddToLabel(std::ostream& out, benchmark::State& state) override {
out << " writes/iter:"
<< ((double)stats_->num_writes / (double)state.iterations())
<< " cli_transport_stalls/iter:"

@ -84,7 +84,7 @@ class FullstackFixture : public BaseFixture {
}
}
virtual ~FullstackFixture() {
~FullstackFixture() override {
server_->Shutdown();
cq_->Shutdown();
void* tag;
@ -93,7 +93,7 @@ class FullstackFixture : public BaseFixture {
}
}
void AddToLabel(std::ostream& out, benchmark::State& state) {
void AddToLabel(std::ostream& out, benchmark::State& state) override {
BaseFixture::AddToLabel(out, state);
out << " polls/iter:"
<< static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) /
@ -115,7 +115,7 @@ class TCP : public FullstackFixture {
FixtureConfiguration())
: FullstackFixture(service, fixture_configuration, MakeAddress(&port_)) {}
~TCP() { grpc_recycle_unused_port(port_); }
~TCP() override { grpc_recycle_unused_port(port_); }
private:
int port_;
@ -134,7 +134,7 @@ class UDS : public FullstackFixture {
FixtureConfiguration())
: FullstackFixture(service, fixture_configuration, MakeAddress(&port_)) {}
~UDS() { grpc_recycle_unused_port(port_); }
~UDS() override { grpc_recycle_unused_port(port_); }
private:
int port_;
@ -154,7 +154,7 @@ class InProcess : public FullstackFixture {
const FixtureConfiguration& fixture_configuration =
FixtureConfiguration())
: FullstackFixture(service, fixture_configuration, "") {}
~InProcess() {}
~InProcess() override {}
};
class EndpointPairFixture : public BaseFixture {
@ -209,7 +209,7 @@ class EndpointPairFixture : public BaseFixture {
}
}
virtual ~EndpointPairFixture() {
~EndpointPairFixture() override {
server_->Shutdown();
cq_->Shutdown();
void* tag;
@ -218,7 +218,7 @@ class EndpointPairFixture : public BaseFixture {
}
}
void AddToLabel(std::ostream& out, benchmark::State& state) {
void AddToLabel(std::ostream& out, benchmark::State& state) override {
BaseFixture::AddToLabel(out, state);
out << " polls/iter:"
<< static_cast<double>(grpc_get_cq_poll_num(this->cq()->cq())) /
@ -261,13 +261,13 @@ class InProcessCHTTP2WithExplicitStats : public EndpointPairFixture {
fixture_configuration),
stats_(stats) {}
virtual ~InProcessCHTTP2WithExplicitStats() {
~InProcessCHTTP2WithExplicitStats() override {
if (stats_ != nullptr) {
grpc_passthru_endpoint_stats_destroy(stats_);
}
}
void AddToLabel(std::ostream& out, benchmark::State& state) {
void AddToLabel(std::ostream& out, benchmark::State& state) override {
EndpointPairFixture::AddToLabel(out, state);
out << " writes/iter:"
<< static_cast<double>(gpr_atm_no_barrier_load(&stats_->num_writes)) /

@ -129,7 +129,7 @@ class InProcessCHTTP2 : public EndpointPairFixture {
InProcessCHTTP2(Service* service, grpc_passthru_endpoint_stats* stats)
: EndpointPairFixture(service, MakeEndpoints(stats)), stats_(stats) {}
virtual ~InProcessCHTTP2() {
~InProcessCHTTP2() override {
if (stats_ != nullptr) {
grpc_passthru_endpoint_stats_destroy(stats_);
}

@ -441,7 +441,7 @@ class ClientImpl : public Client {
ClientRequestCreator<RequestType> create_req(&request_,
config.payload_config());
}
virtual ~ClientImpl() {}
~ClientImpl() override {}
const RequestType* request() { return &request_; }
void WaitForChannelsToConnect() {

@ -191,7 +191,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
t = (t + 1) % cli_cqs_.size();
}
}
virtual ~AsyncClient() {
~AsyncClient() override {
for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) {
void* got_tag;
bool ok;
@ -227,7 +227,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
}
return num_threads;
}
void DestroyMultithreading() override final {
void DestroyMultithreading() final {
for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
std::lock_guard<std::mutex> lock((*ss)->mutex);
(*ss)->shutdown = true;
@ -254,7 +254,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
return ctx;
}
void ThreadFunc(size_t thread_idx, Client::Thread* t) override final {
void ThreadFunc(size_t thread_idx, Client::Thread* t) final {
void* got_tag;
bool ok;

@ -75,7 +75,7 @@ class CallbackClient
config.client_channels() * config.outstanding_rpcs_per_channel();
}
virtual ~CallbackClient() {}
~CallbackClient() override {}
/**
* The main thread of the benchmark will be waiting on DestroyMultithreading.
@ -151,7 +151,7 @@ class CallbackUnaryClient final : public CallbackClient {
}
StartThreads(num_threads_);
}
~CallbackUnaryClient() {}
~CallbackUnaryClient() override {}
protected:
bool ThreadFuncImpl(Thread* t, size_t thread_idx) override {
@ -223,7 +223,7 @@ class CallbackStreamingClient : public CallbackClient {
}
StartThreads(num_threads_);
}
~CallbackStreamingClient() {}
~CallbackStreamingClient() override {}
void AddHistogramEntry(double start, bool ok, Thread* thread_ptr) {
// Update Histogram with data from the callback run
@ -244,7 +244,7 @@ class CallbackStreamingPingPongClient : public CallbackStreamingClient {
public:
CallbackStreamingPingPongClient(const ClientConfig& config)
: CallbackStreamingClient(config) {}
~CallbackStreamingPingPongClient() {}
~CallbackStreamingPingPongClient() override {}
};
class CallbackStreamingPingPongReactor final
@ -346,7 +346,7 @@ class CallbackStreamingPingPongClientImpl final
reactor_.emplace_back(
new CallbackStreamingPingPongReactor(this, std::move(ctx_[i])));
}
~CallbackStreamingPingPongClientImpl() {}
~CallbackStreamingPingPongClientImpl() override {}
bool ThreadFuncImpl(Client::Thread* t, size_t thread_idx) override {
for (size_t vector_idx = thread_idx; vector_idx < total_outstanding_rpcs_;

@ -59,7 +59,7 @@ class SynchronousClient
SetupLoadTest(config, num_threads_);
}
virtual ~SynchronousClient() {}
~SynchronousClient() override {}
virtual bool InitThreadFuncImpl(size_t thread_idx) = 0;
virtual bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) = 0;
@ -115,7 +115,7 @@ class SynchronousUnaryClient final : public SynchronousClient {
: SynchronousClient(config) {
StartThreads(num_threads_);
}
~SynchronousUnaryClient() {}
~SynchronousUnaryClient() override {}
bool InitThreadFuncImpl(size_t /*thread_idx*/) override { return true; }
@ -137,7 +137,7 @@ class SynchronousUnaryClient final : public SynchronousClient {
}
private:
void DestroyMultithreading() override final { EndThreads(); }
void DestroyMultithreading() final { EndThreads(); }
};
template <class StreamType>
@ -153,7 +153,7 @@ class SynchronousStreamingClient : public SynchronousClient {
messages_issued_(num_threads_) {
StartThreads(num_threads_);
}
virtual ~SynchronousStreamingClient() {
~SynchronousStreamingClient() override {
CleanupAllStreams([this](size_t thread_idx) {
// Don't log any kind of error since we may have canceled this
stream_[thread_idx]->Finish().IgnoreError();
@ -208,7 +208,7 @@ class SynchronousStreamingClient : public SynchronousClient {
}
private:
void DestroyMultithreading() override final {
void DestroyMultithreading() final {
CleanupAllStreams(
[this](size_t thread_idx) { context_[thread_idx].TryCancel(); });
EndThreads();
@ -221,7 +221,7 @@ class SynchronousStreamingPingPongClient final
public:
SynchronousStreamingPingPongClient(const ClientConfig& config)
: SynchronousStreamingClient(config) {}
~SynchronousStreamingPingPongClient() {
~SynchronousStreamingPingPongClient() override {
CleanupAllStreams(
[this](size_t thread_idx) { stream_[thread_idx]->WritesDone(); });
}
@ -278,7 +278,7 @@ class SynchronousStreamingFromClientClient final
public:
SynchronousStreamingFromClientClient(const ClientConfig& config)
: SynchronousStreamingClient(config), last_issue_(num_threads_) {}
~SynchronousStreamingFromClientClient() {
~SynchronousStreamingFromClientClient() override {
CleanupAllStreams(
[this](size_t thread_idx) { stream_[thread_idx]->WritesDone(); });
}
@ -331,7 +331,7 @@ class SynchronousStreamingFromServerClient final
public:
SynchronousStreamingFromServerClient(const ClientConfig& config)
: SynchronousStreamingClient(config), last_recv_(num_threads_) {}
~SynchronousStreamingFromServerClient() {}
~SynchronousStreamingFromServerClient() override {}
private:
std::vector<double> last_recv_;
@ -377,7 +377,7 @@ class SynchronousStreamingBothWaysClient final
public:
SynchronousStreamingBothWaysClient(const ClientConfig& config)
: SynchronousStreamingClient(config) {}
~SynchronousStreamingBothWaysClient() {
~SynchronousStreamingBothWaysClient() override {
CleanupAllStreams(
[this](size_t thread_idx) { stream_[thread_idx]->WritesDone(); });
}

@ -162,7 +162,7 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
threads_.emplace_back(&AsyncQpsServerTest::ThreadFunc, this, i);
}
}
~AsyncQpsServerTest() {
~AsyncQpsServerTest() override {
for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
std::lock_guard<std::mutex> lock((*ss)->mutex);
(*ss)->shutdown = true;

@ -66,7 +66,7 @@ std::string output_json("output.json");
class EchoServerImpl final : public grpc::testing::TestService::Service {
Status EmptyCall(::grpc::ServerContext* context,
const grpc::testing::Empty* request,
grpc::testing::Empty* response) {
grpc::testing::Empty* response) override {
return Status::OK;
}
};

@ -40,7 +40,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
explicit ProtoReflectionDescriptorDatabase(
const std::shared_ptr<grpc::Channel>& channel);
virtual ~ProtoReflectionDescriptorDatabase();
~ProtoReflectionDescriptorDatabase() override;
// The following four methods implement DescriptorDatabase interfaces.
//

Loading…
Cancel
Save