diff --git a/BUILD b/BUILD
index 12313bcfa34..1128f715c79 100644
--- a/BUILD
+++ b/BUILD
@@ -69,11 +69,6 @@ config_setting(
values = {"cpu": "darwin"},
)
-config_setting(
- name = "grpc_use_cpp_std_lib",
- values = {"define": "GRPC_USE_CPP_STD_LIB=1"},
-)
-
python_config_settings()
# This should be updated along with build.yaml
@@ -514,7 +509,6 @@ grpc_cc_library(
"src/core/lib/gpr/tls_pthread.h",
"src/core/lib/gpr/tmpfile.h",
"src/core/lib/gpr/useful.h",
- "src/core/lib/gprpp/abstract.h",
"src/core/lib/gprpp/arena.h",
"src/core/lib/gprpp/atomic.h",
"src/core/lib/gprpp/fork.h",
diff --git a/BUILD.gn b/BUILD.gn
index 7ad8f248bdf..0e3e5c51c7b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -132,7 +132,6 @@ config("grpc_config") {
"src/core/lib/gpr/tmpfile_windows.cc",
"src/core/lib/gpr/useful.h",
"src/core/lib/gpr/wrap_memcpy.cc",
- "src/core/lib/gprpp/abstract.h",
"src/core/lib/gprpp/arena.cc",
"src/core/lib/gprpp/arena.h",
"src/core/lib/gprpp/atomic.h",
@@ -1237,7 +1236,6 @@ config("grpc_config") {
"src/core/lib/gpr/tls_pthread.h",
"src/core/lib/gpr/tmpfile.h",
"src/core/lib/gpr/useful.h",
- "src/core/lib/gprpp/abstract.h",
"src/core/lib/gprpp/arena.h",
"src/core/lib/gprpp/atomic.h",
"src/core/lib/gprpp/debug_location.h",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 518ca81c664..59c575f894c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -631,7 +631,6 @@ add_dependencies(buildtests_cxx golden_file_test)
add_dependencies(buildtests_cxx gprpp_mpscq_test)
add_dependencies(buildtests_cxx grpc_alts_credentials_options_test)
add_dependencies(buildtests_cxx grpc_cli)
-add_dependencies(buildtests_cxx grpc_core_map_test)
add_dependencies(buildtests_cxx grpc_fetch_oauth2)
add_dependencies(buildtests_cxx grpc_linux_system_roots_test)
add_dependencies(buildtests_cxx grpc_spiffe_security_connector_test)
@@ -13408,47 +13407,6 @@ target_link_libraries(grpc_cli
)
-endif (gRPC_BUILD_TESTS)
-if (gRPC_BUILD_TESTS)
-
-add_executable(grpc_core_map_test
- test/core/gprpp/map_test.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-
-target_include_directories(grpc_core_map_test
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
- PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
- PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
- PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
- PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
- PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
- PRIVATE ${_gRPC_UPB_GENERATED_DIR}
- PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR}
- PRIVATE ${_gRPC_UPB_INCLUDE_DIR}
- PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
- PRIVATE third_party/googletest/googletest/include
- PRIVATE third_party/googletest/googletest
- PRIVATE third_party/googletest/googlemock/include
- PRIVATE third_party/googletest/googlemock
- PRIVATE ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(grpc_core_map_test
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- grpc++
- grpc
- gpr
- ${_gRPC_GFLAGS_LIBRARIES}
-)
-
-
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_CODEGEN)
diff --git a/Makefile b/Makefile
index 20e01d6c10c..9358cc3205d 100644
--- a/Makefile
+++ b/Makefile
@@ -1220,7 +1220,6 @@ golden_file_test: $(BINDIR)/$(CONFIG)/golden_file_test
gprpp_mpscq_test: $(BINDIR)/$(CONFIG)/gprpp_mpscq_test
grpc_alts_credentials_options_test: $(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test
grpc_cli: $(BINDIR)/$(CONFIG)/grpc_cli
-grpc_core_map_test: $(BINDIR)/$(CONFIG)/grpc_core_map_test
grpc_cpp_plugin: $(BINDIR)/$(CONFIG)/grpc_cpp_plugin
grpc_csharp_plugin: $(BINDIR)/$(CONFIG)/grpc_csharp_plugin
grpc_fetch_oauth2: $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2
@@ -1699,7 +1698,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/gprpp_mpscq_test \
$(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test \
$(BINDIR)/$(CONFIG)/grpc_cli \
- $(BINDIR)/$(CONFIG)/grpc_core_map_test \
$(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \
$(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \
$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \
@@ -1870,7 +1868,6 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/gprpp_mpscq_test \
$(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test \
$(BINDIR)/$(CONFIG)/grpc_cli \
- $(BINDIR)/$(CONFIG)/grpc_core_map_test \
$(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \
$(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \
$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \
@@ -2378,8 +2375,6 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/gprpp_mpscq_test || ( echo test gprpp_mpscq_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_alts_credentials_options_test"
$(Q) $(BINDIR)/$(CONFIG)/grpc_alts_credentials_options_test || ( echo test grpc_alts_credentials_options_test failed ; exit 1 )
- $(E) "[RUN] Testing grpc_core_map_test"
- $(Q) $(BINDIR)/$(CONFIG)/grpc_core_map_test || ( echo test grpc_core_map_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_linux_system_roots_test"
$(Q) $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test || ( echo test grpc_linux_system_roots_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_spiffe_security_connector_test"
@@ -16803,49 +16798,6 @@ endif
endif
-GRPC_CORE_MAP_TEST_SRC = \
- test/core/gprpp/map_test.cc \
-
-GRPC_CORE_MAP_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_CORE_MAP_TEST_SRC))))
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure targets if you don't have OpenSSL.
-
-$(BINDIR)/$(CONFIG)/grpc_core_map_test: openssl_dep_error
-
-else
-
-
-
-
-ifeq ($(NO_PROTOBUF),true)
-
-# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+.
-
-$(BINDIR)/$(CONFIG)/grpc_core_map_test: protobuf_dep_error
-
-else
-
-$(BINDIR)/$(CONFIG)/grpc_core_map_test: $(PROTOBUF_DEP) $(GRPC_CORE_MAP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
- $(E) "[LD] Linking $@"
- $(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(GRPC_CORE_MAP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpc_core_map_test
-
-endif
-
-endif
-
-$(OBJDIR)/$(CONFIG)/test/core/gprpp/map_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
-
-deps_grpc_core_map_test: $(GRPC_CORE_MAP_TEST_OBJS:.o=.dep)
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(GRPC_CORE_MAP_TEST_OBJS:.o=.dep)
-endif
-endif
-
-
GRPC_CPP_PLUGIN_SRC = \
src/compiler/cpp_plugin.cc \
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index ed137285334..95c639c9dbc 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -98,9 +98,6 @@ def grpc_cc_library(
"//:grpc_allow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=1"],
"//:grpc_disallow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=0"],
"//conditions:default": [],
- }) + select({
- "//:grpc_use_cpp_std_lib": ["GRPC_USE_CPP_STD_LIB=1"],
- "//conditions:default": [],
}),
hdrs = hdrs + public_hdrs,
deps = deps + _get_external_deps(external_deps),
diff --git a/build.yaml b/build.yaml
index 81058a6d1c9..285a33a0140 100644
--- a/build.yaml
+++ b/build.yaml
@@ -279,7 +279,6 @@ filegroups:
- src/core/lib/gpr/tls_pthread.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/abstract.h
- src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/atomic.h
- src/core/lib/gprpp/fork.h
@@ -5016,20 +5015,6 @@ targets:
- grpc
- gpr
- grpc++_test_config
-- name: grpc_core_map_test
- gtest: true
- build: test
- language: c++
- headers:
- - test/core/gprpp/map_tester.h
- src:
- - test/core/gprpp/map_test.cc
- deps:
- - grpc_test_util
- - grpc++
- - grpc
- - gpr
- uses_polling: false
- name: grpc_cpp_plugin
build: protoc
language: c++
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index 87de0d91a81..bc844cd4517 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -299,7 +299,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/fork.h',
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index da18f800006..8be7a3d7e5d 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -202,7 +202,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/fork.h',
@@ -978,7 +977,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/fork.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index baa52fb9830..698d9f162b5 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -96,7 +96,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/tls_pthread.h )
s.files += %w( src/core/lib/gpr/tmpfile.h )
s.files += %w( src/core/lib/gpr/useful.h )
- s.files += %w( src/core/lib/gprpp/abstract.h )
s.files += %w( src/core/lib/gprpp/arena.h )
s.files += %w( src/core/lib/gprpp/atomic.h )
s.files += %w( src/core/lib/gprpp/fork.h )
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index d1767ab0b75..fe414023dac 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -27,14 +27,6 @@
* - some syscalls to be made directly
*/
-/*
- * Defines GRPC_USE_CPP_STD_LIB to use standard C++ library instead of
- * in-house library if possible. (e.g. std::map)
- */
-#ifndef GRPC_USE_CPP_STD_LIB
-#define GRPC_USE_CPP_STD_LIB 1
-#endif
-
/* Get windows.h included everywhere (we need it) */
#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
#ifndef WIN32_LEAN_AND_MEAN
diff --git a/package.xml b/package.xml
index d8633ebfde1..56807a958c7 100644
--- a/package.xml
+++ b/package.xml
@@ -101,7 +101,6 @@
-
diff --git a/src/core/ext/filters/client_channel/backend_metric.cc b/src/core/ext/filters/client_channel/backend_metric.cc
index 0d6aa2f6e2c..b36614f5b80 100644
--- a/src/core/ext/filters/client_channel/backend_metric.cc
+++ b/src/core/ext/filters/client_channel/backend_metric.cc
@@ -26,12 +26,12 @@ namespace grpc_core {
namespace {
template
-Map ParseMap(
+std::map ParseMap(
udpa_data_orca_v1_OrcaLoadReport* msg,
EntryType** (*entry_func)(udpa_data_orca_v1_OrcaLoadReport*, size_t*),
upb_strview (*key_func)(const EntryType*),
double (*value_func)(const EntryType*), Arena* arena) {
- Map result;
+ std::map result;
size_t size;
const auto* const* entries = entry_func(msg, &size);
for (size_t i = 0; i < size; ++i) {
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index af2425a6faa..70746f4783f 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -282,18 +282,18 @@ class ChannelData {
RefCountedPtr saved_service_config_;
bool received_first_resolver_result_ = false;
// The number of SubchannelWrapper instances referencing a given Subchannel.
- Map subchannel_refcount_map_;
+ std::map subchannel_refcount_map_;
// The set of SubchannelWrappers that currently exist.
// No need to hold a ref, since the map is updated in the control-plane
// combiner when the SubchannelWrappers are created and destroyed.
// TODO(roth): We really want to use a set here, not a map. Since we don't
// currently have a set implementation, we use a map and ignore the value.
- Map subchannel_wrappers_;
+ std::map subchannel_wrappers_;
// Pending ConnectedSubchannel updates for each SubchannelWrapper.
// Updates are queued here in the control plane combiner and then applied
// in the data plane mutex when the picker is updated.
- Map, RefCountedPtr,
- RefCountedPtrLess>
+ std::map, RefCountedPtr,
+ RefCountedPtrLess>
pending_subchannel_updates_;
//
@@ -314,7 +314,7 @@ class ChannelData {
// synchronously via grpc_channel_num_external_connectivity_watchers().
//
mutable Mutex external_watchers_mu_;
- Map external_watchers_;
+ std::map external_watchers_;
};
//
@@ -1107,7 +1107,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
// subchannel. This is needed so that when the LB policy calls
// CancelConnectivityStateWatch() with its watcher, we know the
// corresponding WrapperWatcher to cancel on the underlying subchannel.
- Map watcher_map_;
+ std::map watcher_map_;
// To be accessed only in the control plane combiner.
RefCountedPtr connected_subchannel_;
// To be accessed only in the data plane mutex.
diff --git a/src/core/ext/filters/client_channel/client_channel_factory.h b/src/core/ext/filters/client_channel/client_channel_factory.h
index 42bc7cb505f..79797bbc454 100644
--- a/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -24,7 +24,6 @@
#include
#include "src/core/ext/filters/client_channel/subchannel.h"
-#include "src/core/lib/gprpp/abstract.h"
namespace grpc_core {
@@ -33,8 +32,7 @@ class ClientChannelFactory {
virtual ~ClientChannelFactory() = default;
// Creates a subchannel with the specified args.
- virtual Subchannel* CreateSubchannel(const grpc_channel_args* args)
- GRPC_ABSTRACT;
+ virtual Subchannel* CreateSubchannel(const grpc_channel_args* args) = 0;
// Returns a channel arg containing the specified factory.
static grpc_arg CreateChannelArg(ClientChannelFactory* factory);
@@ -42,8 +40,6 @@ class ClientChannelFactory {
// Returns the factory from args, or null if not found.
static ClientChannelFactory* GetFromChannelArgs(
const grpc_channel_args* args);
-
- GRPC_ABSTRACT_BASE_CLASS
};
} // namespace grpc_core
diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h
index 093d5fc30b8..20957c3daaf 100644
--- a/src/core/ext/filters/client_channel/lb_policy.h
+++ b/src/core/ext/filters/client_channel/lb_policy.h
@@ -24,7 +24,6 @@
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/map.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -91,11 +90,11 @@ class LoadBalancingPolicy : public InternallyRefCounted {
/// Application-specific requests cost metrics. Metric names are
/// determined by the application. Each value is an absolute cost
/// (e.g. 3487 bytes of storage) associated with the request.
- Map request_cost;
+ std::map request_cost;
/// Application-specific resource utilization metrics. Metric names
/// are determined by the application. Each value is expressed as a
/// fraction of total resources available.
- Map utilization;
+ std::map utilization;
};
/// Interface for accessing per-call state.
@@ -109,13 +108,11 @@ class LoadBalancingPolicy : public InternallyRefCounted {
/// automatically freed when the call is complete.
/// It is more efficient to use this than to allocate memory directly
/// for allocations that need to be made on a per-call basis.
- virtual void* Alloc(size_t size) GRPC_ABSTRACT;
+ virtual void* Alloc(size_t size) = 0;
/// Returns the backend metric data returned by the server for the call,
/// or null if no backend metric data was returned.
- virtual const BackendMetricData* GetBackendMetricData() GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual const BackendMetricData* GetBackendMetricData() = 0;
};
/// Interface for accessing metadata.
@@ -134,20 +131,18 @@ class LoadBalancingPolicy : public InternallyRefCounted {
/// Implementations must ensure that the key and value remain alive
/// until the call ends. If desired, they may be allocated via
/// CallState::Alloc().
- virtual void Add(StringView key, StringView value) GRPC_ABSTRACT;
+ virtual void Add(StringView key, StringView value) = 0;
/// Iteration interface.
- virtual Iterator Begin() const GRPC_ABSTRACT;
- virtual bool IsEnd(Iterator it) const GRPC_ABSTRACT;
- virtual void Next(Iterator* it) const GRPC_ABSTRACT;
- virtual StringView Key(Iterator it) const GRPC_ABSTRACT;
- virtual StringView Value(Iterator it) const GRPC_ABSTRACT;
+ virtual Iterator Begin() const = 0;
+ virtual bool IsEnd(Iterator it) const = 0;
+ virtual void Next(Iterator* it) const = 0;
+ virtual StringView Key(Iterator it) const = 0;
+ virtual StringView Value(Iterator it) const = 0;
/// Removes the element pointed to by \a it, which is modified to
/// point to the next element.
- virtual void Erase(Iterator* it) GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual void Erase(Iterator* it) = 0;
};
/// Arguments used when picking a subchannel for a call.
@@ -229,9 +224,7 @@ class LoadBalancingPolicy : public InternallyRefCounted {
SubchannelPicker() = default;
virtual ~SubchannelPicker() = default;
- virtual PickResult Pick(PickArgs args) GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual PickResult Pick(PickArgs args) = 0;
};
/// A proxy object implemented by the client channel and used by the
@@ -246,22 +239,19 @@ class LoadBalancingPolicy : public InternallyRefCounted {
/// Creates a new subchannel with the specified channel args.
virtual RefCountedPtr CreateSubchannel(
- const grpc_channel_args& args) GRPC_ABSTRACT;
+ const grpc_channel_args& args) = 0;
/// Sets the connectivity state and returns a new picker to be used
/// by the client channel.
virtual void UpdateState(grpc_connectivity_state state,
- UniquePtr) GRPC_ABSTRACT;
+ UniquePtr) = 0;
/// Requests that the resolver re-resolve.
- virtual void RequestReresolution() GRPC_ABSTRACT;
+ virtual void RequestReresolution() = 0;
/// Adds a trace message associated with the channel.
enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
- virtual void AddTraceEvent(TraceSeverity severity,
- StringView message) GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual void AddTraceEvent(TraceSeverity severity, StringView message) = 0;
};
/// Interface for configuration data used by an LB policy implementation.
@@ -272,9 +262,7 @@ class LoadBalancingPolicy : public InternallyRefCounted {
virtual ~Config() = default;
// Returns the load balancing policy name
- virtual const char* name() const GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual const char* name() const = 0;
};
/// Data passed to the UpdateLocked() method when new addresses and
@@ -319,12 +307,12 @@ class LoadBalancingPolicy : public InternallyRefCounted {
LoadBalancingPolicy& operator=(const LoadBalancingPolicy&) = delete;
/// Returns the name of the LB policy.
- virtual const char* name() const GRPC_ABSTRACT;
+ virtual const char* name() const = 0;
/// Updates the policy with new data from the resolver. Will be invoked
/// immediately after LB policy is constructed, and then again whenever
/// the resolver returns a new result.
- virtual void UpdateLocked(UpdateArgs) GRPC_ABSTRACT; // NOLINT
+ virtual void UpdateLocked(UpdateArgs) = 0; // NOLINT
/// Tries to enter a READY connectivity state.
/// This is a no-op by default, since most LB policies never go into
@@ -332,7 +320,7 @@ class LoadBalancingPolicy : public InternallyRefCounted {
virtual void ExitIdleLocked() {}
/// Resets connection backoff.
- virtual void ResetBackoffLocked() GRPC_ABSTRACT;
+ virtual void ResetBackoffLocked() = 0;
grpc_pollset_set* interested_parties() const { return interested_parties_; }
@@ -370,8 +358,6 @@ class LoadBalancingPolicy : public InternallyRefCounted {
grpc_error* error_;
};
- GRPC_ABSTRACT_BASE_CLASS
-
protected:
grpc_combiner* combiner() const { return combiner_; }
@@ -382,7 +368,7 @@ class LoadBalancingPolicy : public InternallyRefCounted {
}
/// Shuts down the policy.
- virtual void ShutdownLocked() GRPC_ABSTRACT;
+ virtual void ShutdownLocked() = 0;
private:
/// Combiner under which LB policy actions take place.
diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index b4d3fab91be..5354af7acd4 100644
--- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -33,7 +33,6 @@
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/inlined_vector.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
@@ -117,8 +116,6 @@ class SubchannelData {
// Cancels any pending connectivity watch and unrefs the subchannel.
void ShutdownLocked();
- GRPC_ABSTRACT_BASE_CLASS
-
protected:
SubchannelData(
SubchannelList* subchannel_list,
@@ -131,7 +128,7 @@ class SubchannelData {
// invoked whenever the subchannel's connectivity state changes.
// To stop watching, use CancelConnectivityWatchLocked().
virtual void ProcessConnectivityChangeLocked(
- grpc_connectivity_state connectivity_state) GRPC_ABSTRACT;
+ grpc_connectivity_state connectivity_state) = 0;
private:
// Watcher for subchannel connectivity state.
@@ -200,8 +197,6 @@ class SubchannelList : public InternallyRefCounted {
InternallyRefCounted::Unref(DEBUG_LOCATION, "shutdown");
}
- GRPC_ABSTRACT_BASE_CLASS
-
protected:
SubchannelList(LoadBalancingPolicy* policy, TraceFlag* tracer,
const ServerAddressList& addresses,
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
index c148023bf5b..e0fa6c31dcd 100644
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
@@ -576,8 +576,8 @@ class XdsLb : public LoadBalancingPolicy {
RefCountedPtr xds_policy_;
- Map, OrphanablePtr,
- XdsLocalityName::Less>
+ std::map, OrphanablePtr,
+ XdsLocalityName::Less>
localities_;
const uint32_t priority_;
grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE;
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc
index a866d50b3a6..f2f06b467f2 100644
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc
@@ -143,15 +143,11 @@ XdsClientStats::Snapshot XdsClientStats::GetSnapshotAndReset() {
}
{
MutexLock lock(&dropped_requests_mu_);
-#if GRPC_USE_CPP_STD_LIB
// This is a workaround for the case where some compilers cannot build
// move-assignment of map with non-copyable but movable key.
// https://stackoverflow.com/questions/36475497
std::swap(snapshot.dropped_requests, dropped_requests_);
dropped_requests_.clear();
-#else
- snapshot.dropped_requests = std::move(dropped_requests_);
-#endif
}
return snapshot;
}
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h
index 6e8dd961ea9..8a8af4426b4 100644
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h
@@ -111,9 +111,9 @@ class XdsClientStats {
double total_metric_value_{0};
};
- using LoadMetricMap = Map, LoadMetric, StringLess>;
+ using LoadMetricMap = std::map, LoadMetric, StringLess>;
using LoadMetricSnapshotMap =
- Map, LoadMetric::Snapshot, StringLess>;
+ std::map, LoadMetric::Snapshot, StringLess>;
struct Snapshot {
// TODO(juanlishen): Change this to const method when const_iterator is
@@ -180,12 +180,12 @@ class XdsClientStats {
// UniquePtr<>. We should remove this wrapper if the value type of Map<>
// doesn't have to be movable.
using LocalityStatsMap =
- Map, RefCountedPtr,
- XdsLocalityName::Less>;
+ std::map, RefCountedPtr,
+ XdsLocalityName::Less>;
using LocalityStatsSnapshotMap =
- Map, LocalityStats::Snapshot,
- XdsLocalityName::Less>;
- using DroppedRequestsMap = Map, uint64_t, StringLess>;
+ std::map, LocalityStats::Snapshot,
+ XdsLocalityName::Less>;
+ using DroppedRequestsMap = std::map, uint64_t, StringLess>;
using DroppedRequestsSnapshotMap = DroppedRequestsMap;
struct Snapshot {
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc
index a7666b34e53..9c6e4c553c7 100644
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc
@@ -346,15 +346,7 @@ grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name) {
namespace {
void LocalityStatsPopulate(envoy_api_v2_endpoint_UpstreamLocalityStats* output,
-#if GRPC_USE_CPP_STD_LIB
- // TODO(veblush): Clean up this
- // This is to address the difference between
- // std::map and Map. #else block will be gone
- // once using stdlib is enabled by default.
Pair,
-#else
- Pair,
-#endif
XdsClientStats::LocalityStats::Snapshot>& input,
upb_arena* arena) {
// Set sub_zone.
diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h
index 1b56bef7d81..25396682bbd 100644
--- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h
+++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h
@@ -57,7 +57,7 @@ class XdsPriorityListUpdate {
size_t size() const { return localities.size(); }
- Map, Locality, XdsLocalityName::Less>
+ std::map, Locality, XdsLocalityName::Less>
localities;
};
diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.h b/src/core/ext/filters/client_channel/lb_policy_factory.h
index 3b8c9faa180..3cd6d456714 100644
--- a/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -22,7 +22,6 @@
#include
#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/orphanable.h"
namespace grpc_core {
@@ -31,18 +30,16 @@ class LoadBalancingPolicyFactory {
public:
/// Returns a new LB policy instance.
virtual OrphanablePtr CreateLoadBalancingPolicy(
- LoadBalancingPolicy::Args) const GRPC_ABSTRACT;
+ LoadBalancingPolicy::Args) const = 0;
/// Returns the LB policy name that this factory provides.
/// Caller does NOT take ownership of result.
- virtual const char* name() const GRPC_ABSTRACT;
+ virtual const char* name() const = 0;
virtual RefCountedPtr ParseLoadBalancingConfig(
- const grpc_json* json, grpc_error** error) const GRPC_ABSTRACT;
+ const grpc_json* json, grpc_error** error) const = 0;
virtual ~LoadBalancingPolicyFactory() {}
-
- GRPC_ABSTRACT_BASE_CLASS;
};
} // namespace grpc_core
diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h
index 829a860040a..609d0a7a233 100644
--- a/src/core/ext/filters/client_channel/resolver.h
+++ b/src/core/ext/filters/client_channel/resolver.h
@@ -25,7 +25,6 @@
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/combiner.h"
@@ -74,17 +73,15 @@ class Resolver : public InternallyRefCounted {
/// Returns a result to the channel.
/// Takes ownership of \a result.args.
- virtual void ReturnResult(Result result) GRPC_ABSTRACT; // NOLINT
+ virtual void ReturnResult(Result result) = 0; // NOLINT
/// Returns a transient error to the channel.
/// If the resolver does not set the GRPC_ERROR_INT_GRPC_STATUS
/// attribute on the error, calls will be failed with status UNKNOWN.
- virtual void ReturnError(grpc_error* error) GRPC_ABSTRACT;
+ virtual void ReturnError(grpc_error* error) = 0;
// TODO(yashkt): As part of the service config error handling
// changes, add a method to parse the service config JSON string.
-
- GRPC_ABSTRACT_BASE_CLASS
};
// Not copyable nor movable.
@@ -92,7 +89,7 @@ class Resolver : public InternallyRefCounted {
Resolver& operator=(const Resolver&) = delete;
/// Starts resolving.
- virtual void StartLocked() GRPC_ABSTRACT;
+ virtual void StartLocked() = 0;
/// Asks the resolver to obtain an updated resolver result, if
/// applicable.
@@ -123,8 +120,6 @@ class Resolver : public InternallyRefCounted {
Unref();
}
- GRPC_ABSTRACT_BASE_CLASS
-
protected:
GRPC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE
@@ -138,7 +133,7 @@ class Resolver : public InternallyRefCounted {
virtual ~Resolver();
/// Shuts down the resolver.
- virtual void ShutdownLocked() GRPC_ABSTRACT;
+ virtual void ShutdownLocked() = 0;
grpc_combiner* combiner() const { return combiner_; }
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index 2d172eb3d1e..fe51c34bc3e 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -23,7 +23,6 @@
#include
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/iomgr/pollset_set.h"
typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
@@ -67,22 +66,18 @@ class GrpcPolledFd {
public:
virtual ~GrpcPolledFd() {}
/* Called when c-ares library is interested and there's no pending callback */
- virtual void RegisterForOnReadableLocked(grpc_closure* read_closure)
- GRPC_ABSTRACT;
+ virtual void RegisterForOnReadableLocked(grpc_closure* read_closure) = 0;
/* Called when c-ares library is interested and there's no pending callback */
- virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure)
- GRPC_ABSTRACT;
+ virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure) = 0;
/* Indicates if there is data left even after just being read from */
- virtual bool IsFdStillReadableLocked() GRPC_ABSTRACT;
+ virtual bool IsFdStillReadableLocked() = 0;
/* Called once and only once. Must cause cancellation of any pending
* read/write callbacks. */
- virtual void ShutdownLocked(grpc_error* error) GRPC_ABSTRACT;
+ virtual void ShutdownLocked(grpc_error* error) = 0;
/* Get the underlying ares_socket_t that this was created from */
- virtual ares_socket_t GetWrappedAresSocketLocked() GRPC_ABSTRACT;
+ virtual ares_socket_t GetWrappedAresSocketLocked() = 0;
/* A unique name, for logging */
- virtual const char* GetName() GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual const char* GetName() = 0;
};
/* A GrpcPolledFdFactory is 1-to-1 with and owned by the
@@ -95,11 +90,9 @@ class GrpcPolledFdFactory {
/* Creates a new wrapped fd for the current platform */
virtual GrpcPolledFd* NewGrpcPolledFdLocked(
ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- grpc_combiner* combiner) GRPC_ABSTRACT;
+ grpc_combiner* combiner) = 0;
/* Optionally configures the ares channel after creation */
- virtual void ConfigureAresChannelLocked(ares_channel channel) GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual void ConfigureAresChannelLocked(ares_channel channel) = 0;
};
UniquePtr NewGrpcPolledFdFactory(grpc_combiner* combiner);
diff --git a/src/core/ext/filters/client_channel/resolver_factory.h b/src/core/ext/filters/client_channel/resolver_factory.h
index 7fed48b9570..7cee4879814 100644
--- a/src/core/ext/filters/client_channel/resolver_factory.h
+++ b/src/core/ext/filters/client_channel/resolver_factory.h
@@ -24,7 +24,6 @@
#include
#include "src/core/ext/filters/client_channel/resolver.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/pollset_set.h"
@@ -49,11 +48,10 @@ class ResolverFactory {
public:
/// Returns a bool indicating whether the input uri is valid to create a
/// resolver.
- virtual bool IsValidUri(const grpc_uri* uri) const GRPC_ABSTRACT;
+ virtual bool IsValidUri(const grpc_uri* uri) const = 0;
/// Returns a new resolver instance.
- virtual OrphanablePtr CreateResolver(ResolverArgs args) const
- GRPC_ABSTRACT;
+ virtual OrphanablePtr CreateResolver(ResolverArgs args) const = 0;
/// Returns a string representing the default authority to use for this
/// scheme.
@@ -65,11 +63,9 @@ class ResolverFactory {
/// Returns the URI scheme that this factory implements.
/// Caller does NOT take ownership of result.
- virtual const char* scheme() const GRPC_ABSTRACT;
+ virtual const char* scheme() const = 0;
virtual ~ResolverFactory() {}
-
- GRPC_ABSTRACT_BASE_CLASS
};
} // namespace grpc_core
diff --git a/src/core/ext/filters/client_channel/service_config.h b/src/core/ext/filters/client_channel/service_config.h
index 189a0b9bca2..f0206bf782e 100644
--- a/src/core/ext/filters/client_channel/service_config.h
+++ b/src/core/ext/filters/client_channel/service_config.h
@@ -62,8 +62,6 @@ class ServiceConfig : public RefCounted {
class ParsedConfig {
public:
virtual ~ParsedConfig() = default;
-
- GRPC_ABSTRACT_BASE_CLASS;
};
/// This is the base class that all service config parsers should derive from.
@@ -82,8 +80,6 @@ class ServiceConfig : public RefCounted {
GPR_DEBUG_ASSERT(error != nullptr);
return nullptr;
}
-
- GRPC_ABSTRACT_BASE_CLASS;
};
static constexpr int kNumPreallocatedParsers = 4;
diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h
index d6fb65814b7..d7912a00c77 100644
--- a/src/core/ext/filters/client_channel/subchannel.h
+++ b/src/core/ext/filters/client_channel/subchannel.h
@@ -192,11 +192,9 @@ class Subchannel {
virtual void OnConnectivityStateChange(
grpc_connectivity_state new_state,
RefCountedPtr connected_subchannel) // NOLINT
- GRPC_ABSTRACT;
+ = 0;
- virtual grpc_pollset_set* interested_parties() GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual grpc_pollset_set* interested_parties() = 0;
};
// The ctor and dtor are not intended to use directly.
@@ -296,8 +294,8 @@ class Subchannel {
private:
// TODO(roth): This could be a set instead of a map if we had a set
// implementation.
- Map>
+ std::map>
watchers_;
};
@@ -330,7 +328,7 @@ class Subchannel {
private:
class HealthWatcher;
- Map, StringLess> map_;
+ std::map, StringLess> map_;
};
class ConnectedSubchannelStateWatcher;
diff --git a/src/core/ext/filters/client_channel/subchannel_interface.h b/src/core/ext/filters/client_channel/subchannel_interface.h
index 2e448dc5a64..9ea3dfe4931 100644
--- a/src/core/ext/filters/client_channel/subchannel_interface.h
+++ b/src/core/ext/filters/client_channel/subchannel_interface.h
@@ -36,14 +36,12 @@ class SubchannelInterface : public RefCounted {
// Will be invoked whenever the subchannel's connectivity state
// changes. There will be only one invocation of this method on a
// given watcher instance at any given time.
- virtual void OnConnectivityStateChange(grpc_connectivity_state new_state)
- GRPC_ABSTRACT;
+ virtual void OnConnectivityStateChange(
+ grpc_connectivity_state new_state) = 0;
// TODO(roth): Remove this as soon as we move to EventManager-based
// polling.
- virtual grpc_pollset_set* interested_parties() GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual grpc_pollset_set* interested_parties() = 0;
};
template
@@ -53,7 +51,7 @@ class SubchannelInterface : public RefCounted {
virtual ~SubchannelInterface() = default;
// Returns the current connectivity state of the subchannel.
- virtual grpc_connectivity_state CheckConnectivityState() GRPC_ABSTRACT;
+ virtual grpc_connectivity_state CheckConnectivityState() = 0;
// Starts watching the subchannel's connectivity state.
// The first callback to the watcher will be delivered when the
@@ -68,29 +66,27 @@ class SubchannelInterface : public RefCounted {
// the previous watcher using CancelConnectivityStateWatch().
virtual void WatchConnectivityState(
grpc_connectivity_state initial_state,
- UniquePtr watcher) GRPC_ABSTRACT;
+ UniquePtr watcher) = 0;
// Cancels a connectivity state watch.
// If the watcher has already been destroyed, this is a no-op.
virtual void CancelConnectivityStateWatch(
- ConnectivityStateWatcherInterface* watcher) GRPC_ABSTRACT;
+ ConnectivityStateWatcherInterface* watcher) = 0;
// Attempt to connect to the backend. Has no effect if already connected.
// If the subchannel is currently in backoff delay due to a previously
// failed attempt, the new connection attempt will not start until the
// backoff delay has elapsed.
- virtual void AttemptToConnect() GRPC_ABSTRACT;
+ virtual void AttemptToConnect() = 0;
// Resets the subchannel's connection backoff state. If AttemptToConnect()
// has been called since the subchannel entered TRANSIENT_FAILURE state,
// starts a new connection attempt immediately; otherwise, a new connection
// attempt will be started as soon as AttemptToConnect() is called.
- virtual void ResetBackoff() GRPC_ABSTRACT;
+ virtual void ResetBackoff() = 0;
// TODO(roth): Need a better non-grpc-specific abstraction here.
- virtual const grpc_channel_args* channel_args() GRPC_ABSTRACT;
-
- GRPC_ABSTRACT_BASE_CLASS
+ virtual const grpc_channel_args* channel_args() = 0;
};
} // namespace grpc_core
diff --git a/src/core/ext/filters/client_channel/subchannel_pool_interface.h b/src/core/ext/filters/client_channel/subchannel_pool_interface.h
index eeb56faf0c0..2fe5fa3fd05 100644
--- a/src/core/ext/filters/client_channel/subchannel_pool_interface.h
+++ b/src/core/ext/filters/client_channel/subchannel_pool_interface.h
@@ -23,7 +23,6 @@
#include "src/core/lib/avl/avl.h"
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/ref_counted.h"
namespace grpc_core {
@@ -70,14 +69,14 @@ class SubchannelPoolInterface : public RefCounted {
// with \a key, which may be different from \a constructed because we reuse
// (instead of update) any existing subchannel already registered with \a key.
virtual Subchannel* RegisterSubchannel(SubchannelKey* key,
- Subchannel* constructed) GRPC_ABSTRACT;
+ Subchannel* constructed) = 0;
// Removes the registered subchannel found by \a key.
- virtual void UnregisterSubchannel(SubchannelKey* key) GRPC_ABSTRACT;
+ virtual void UnregisterSubchannel(SubchannelKey* key) = 0;
// Finds the subchannel registered for the given subchannel key. Returns NULL
// if no such channel exists. Thread-safe.
- virtual Subchannel* FindSubchannel(SubchannelKey* key) GRPC_ABSTRACT;
+ virtual Subchannel* FindSubchannel(SubchannelKey* key) = 0;
// Creates a channel arg from \a subchannel pool.
static grpc_arg CreateChannelArg(SubchannelPoolInterface* subchannel_pool);
@@ -85,8 +84,6 @@ class SubchannelPoolInterface : public RefCounted {
// Gets the subchannel pool from the channel args.
static SubchannelPoolInterface* GetSubchannelPoolFromChannelArgs(
const grpc_channel_args* args);
-
- GRPC_ABSTRACT_BASE_CLASS
};
} // namespace grpc_core
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h
index 49e206fca3d..39ce1c51ec9 100644
--- a/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -25,7 +25,6 @@
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/transport/bdp_estimator.h"
#include "src/core/lib/transport/pid_controller.h"
@@ -189,8 +188,6 @@ class TransportFlowControlBase {
// factor
virtual void TestOnlyForceHugeWindow() {}
- GRPC_ABSTRACT_BASE_CLASS
-
protected:
friend class ::grpc::testing::TrickledCHTTP2;
int64_t remote_window_ = kDefaultWindow;
@@ -385,8 +382,6 @@ class StreamFlowControlBase {
int64_t local_window_delta() { return local_window_delta_; }
int64_t announced_window_delta() { return announced_window_delta_; }
- GRPC_ABSTRACT_BASE_CLASS
-
protected:
friend class ::grpc::testing::TrickledCHTTP2;
int64_t remote_window_delta_ = 0;
diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h
index b023a5280e0..5a063b4df96 100644
--- a/src/core/lib/channel/channelz.h
+++ b/src/core/lib/channel/channelz.h
@@ -88,7 +88,7 @@ class BaseNode : public RefCounted {
virtual ~BaseNode();
// All children must implement this function.
- virtual grpc_json* RenderJson() GRPC_ABSTRACT;
+ virtual grpc_json* RenderJson() = 0;
// Renders the json and returns allocated string that must be freed by the
// caller.
@@ -221,8 +221,8 @@ class ChannelNode : public BaseNode {
// TODO(roth): We don't actually use the values here, only the keys, so
// these should be sets instead of maps, but we don't currently have a set
// implementation. Change this if/when we have one.
- Map child_channels_;
- Map child_subchannels_;
+ std::map child_channels_;
+ std::map child_subchannels_;
};
// Handles channelz bookkeeping for servers
@@ -262,8 +262,8 @@ class ServerNode : public BaseNode {
CallCountingHelper call_counter_;
ChannelTrace trace_;
Mutex child_mu_; // Guards child maps below.
- Map> child_sockets_;
- Map> child_listen_sockets_;
+ std::map> child_sockets_;
+ std::map> child_listen_sockets_;
};
// Handles channelz bookkeeping for sockets
diff --git a/src/core/lib/channel/channelz_registry.h b/src/core/lib/channel/channelz_registry.h
index e04d7c44888..c60a5554fb9 100644
--- a/src/core/lib/channel/channelz_registry.h
+++ b/src/core/lib/channel/channelz_registry.h
@@ -87,7 +87,7 @@ class ChannelzRegistry {
// protects members
Mutex mu_;
- Map node_map_;
+ std::map node_map_;
intptr_t uuid_generator_ = 0;
};
diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h
index b68799b6e0e..4f064d901df 100644
--- a/src/core/lib/channel/handshaker.h
+++ b/src/core/lib/channel/handshaker.h
@@ -77,12 +77,11 @@ struct HandshakerArgs {
class Handshaker : public RefCounted {
public:
virtual ~Handshaker() = default;
- virtual void Shutdown(grpc_error* why) GRPC_ABSTRACT;
+ virtual void Shutdown(grpc_error* why) = 0;
virtual void DoHandshake(grpc_tcp_server_acceptor* acceptor,
grpc_closure* on_handshake_done,
- HandshakerArgs* args) GRPC_ABSTRACT;
- virtual const char* name() const GRPC_ABSTRACT;
- GRPC_ABSTRACT_BASE_CLASS
+ HandshakerArgs* args) = 0;
+ virtual const char* name() const = 0;
};
//
diff --git a/src/core/lib/channel/handshaker_factory.h b/src/core/lib/channel/handshaker_factory.h
index 3972af1f439..520e5e4b258 100644
--- a/src/core/lib/channel/handshaker_factory.h
+++ b/src/core/lib/channel/handshaker_factory.h
@@ -33,10 +33,8 @@ class HandshakerFactory {
public:
virtual void AddHandshakers(const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr) GRPC_ABSTRACT;
+ HandshakeManager* handshake_mgr) = 0;
virtual ~HandshakerFactory() = default;
-
- GRPC_ABSTRACT_BASE_CLASS
};
} // namespace grpc_core
diff --git a/src/core/lib/gprpp/abstract.h b/src/core/lib/gprpp/abstract.h
deleted file mode 100644
index ea68e3ab041..00000000000
--- a/src/core/lib/gprpp/abstract.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_GPRPP_ABSTRACT_H
-#define GRPC_CORE_LIB_GPRPP_ABSTRACT_H
-
-#if GRPC_USE_CPP_STD_LIB
-
-#define GRPC_ABSTRACT_BASE_CLASS
-
-#define GRPC_ABSTRACT = 0
-
-#else
-
-// This is needed to support abstract base classes in the c core. Since gRPC
-// doesn't have a c++ runtime, it will hit a linker error on delete unless
-// we define a virtual operator delete. See this blog for more info:
-// https://eli.thegreenplace.net/2015/c-deleting-destructors-and-virtual-operator-delete/
-#define GRPC_ABSTRACT_BASE_CLASS \
- static void operator delete(void* p) { abort(); }
-
-// gRPC currently can't depend on libstdc++, so we can't use "= 0" for
-// pure virtual methods. Instead, we use this macro.
-#define GRPC_ABSTRACT \
- { \
- gpr_log(GPR_ERROR, "Function marked GRPC_ABSTRACT was not implemented"); \
- GPR_ASSERT(false); \
- }
-
-#endif // GRPC_USE_CPP_STD_LIB
-
-#endif /* GRPC_CORE_LIB_GPRPP_ABSTRACT_H */
diff --git a/src/core/lib/gprpp/map.h b/src/core/lib/gprpp/map.h
index 6a41a97bec2..0d61f902757 100644
--- a/src/core/lib/gprpp/map.h
+++ b/src/core/lib/gprpp/map.h
@@ -26,10 +26,7 @@
#include
#include
#include
-
-#if GRPC_USE_CPP_STD_LIB
#include