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/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index d727cea7db6..20957c3daaf 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -90,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. 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.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.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/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h index 7a039192085..d7912a00c77 100644 --- a/src/core/ext/filters/client_channel/subchannel.h +++ b/src/core/ext/filters/client_channel/subchannel.h @@ -294,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_; }; @@ -328,7 +328,7 @@ class Subchannel { private: class HealthWatcher; - Map, StringLess> map_; + std::map, StringLess> map_; }; class ConnectedSubchannelStateWatcher; diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h index 545b9ebeb88..5a063b4df96 100644 --- a/src/core/lib/channel/channelz.h +++ b/src/core/lib/channel/channelz.h @@ -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/gprpp/map.h b/src/core/lib/gprpp/map.h index 4537012c903..0d61f902757 100644 --- a/src/core/lib/gprpp/map.h +++ b/src/core/lib/gprpp/map.h @@ -59,9 +59,6 @@ struct RefCountedPtrLess { } }; -template > -using Map = std::map; - } // namespace grpc_core #endif /* GRPC_CORE_LIB_GPRPP_MAP_H */ diff --git a/src/core/lib/security/credentials/credentials.cc b/src/core/lib/security/credentials/credentials.cc index f2ec9b7f2f2..37678715704 100644 --- a/src/core/lib/security/credentials/credentials.cc +++ b/src/core/lib/security/credentials/credentials.cc @@ -45,18 +45,18 @@ void grpc_channel_credentials_release(grpc_channel_credentials* creds) { if (creds) creds->Unref(); } -static grpc_core::Map, - grpc_core::RefCountedPtr, - grpc_core::StringLess>* g_grpc_control_plane_creds; +static std::map, + grpc_core::RefCountedPtr, + grpc_core::StringLess>* g_grpc_control_plane_creds; static gpr_mu g_control_plane_creds_mu; static void do_control_plane_creds_init() { gpr_mu_init(&g_control_plane_creds_mu); GPR_ASSERT(g_grpc_control_plane_creds == nullptr); g_grpc_control_plane_creds = grpc_core::New< - grpc_core::Map, - grpc_core::RefCountedPtr, - grpc_core::StringLess>>(); + std::map, + grpc_core::RefCountedPtr, + grpc_core::StringLess>>(); } void grpc_control_plane_credentials_init() { diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h index 16f0454907b..e0700c41a92 100644 --- a/src/core/lib/security/credentials/credentials.h +++ b/src/core/lib/security/credentials/credentials.h @@ -148,9 +148,9 @@ struct grpc_channel_credentials private: const char* type_; - grpc_core::Map, - grpc_core::RefCountedPtr, - grpc_core::StringLess> + std::map, + grpc_core::RefCountedPtr, + grpc_core::StringLess> local_control_plane_creds_; }; diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h index 25b43561364..cefd1b88a02 100644 --- a/src/core/lib/transport/connectivity_state.h +++ b/src/core/lib/transport/connectivity_state.h @@ -47,11 +47,9 @@ class ConnectivityStateWatcherInterface virtual ~ConnectivityStateWatcherInterface() = default; // Notifies the watcher that the state has changed to new_state. - virtual void Notify(grpc_connectivity_state new_state) GRPC_ABSTRACT; + virtual void Notify(grpc_connectivity_state new_state) = 0; void Orphan() override { Unref(); } - - GRPC_ABSTRACT_BASE_CLASS }; // An alternative watcher interface that performs notifications via an @@ -70,8 +68,7 @@ class AsyncConnectivityStateWatcherInterface class Notifier; // Invoked asynchronously when Notify() is called. - virtual void OnConnectivityStateChange(grpc_connectivity_state new_state) - GRPC_ABSTRACT; + virtual void OnConnectivityStateChange(grpc_connectivity_state new_state) = 0; }; // Tracks connectivity state. Maintains a list of watchers that are @@ -113,8 +110,8 @@ class ConnectivityStateTracker { Atomic state_; // TODO(roth): This could be a set instead of a map if we had a set // implementation. - Map> + std::map> watchers_; };