GRPC Core  9.0.0
lb_policy_registry.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H
20 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H
21 
23 
27 
28 namespace grpc_core {
29 
31  public:
35  class Builder {
36  public:
38  static void InitRegistry();
39  static void ShutdownRegistry();
40 
44  std::unique_ptr<LoadBalancingPolicyFactory> factory);
45  };
46 
49  const char* name, LoadBalancingPolicy::Args args);
50 
54  static bool LoadBalancingPolicyExists(const char* name,
55  bool* requires_config);
56 
60  const grpc_json* json, grpc_error** error);
61 };
62 
63 } // namespace grpc_core
64 
65 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */
static void ShutdownRegistry()
Definition: lb_policy_registry.cc:70
Definition: error_internal.h:39
static void InitRegistry()
Global initialization and shutdown hooks.
Definition: lb_policy_registry.cc:66
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:68
static RefCountedPtr< LoadBalancingPolicy::Config > ParseLoadBalancingConfig(const grpc_json *json, grpc_error **error)
Returns a parsed object of the load balancing policy to be used from a LoadBalancingConfig array json...
Definition: lb_policy_registry.cc:185
Round Robin Policy.
Definition: backend_metric.cc:24
Methods used to create and populate the LoadBalancingPolicyRegistry.
Definition: lb_policy_registry.h:35
static void RegisterLoadBalancingPolicyFactory(std::unique_ptr< LoadBalancingPolicyFactory > factory)
Registers an LB policy factory.
Definition: lb_policy_registry.cc:75
Definition: lb_policy_registry.h:30
Definition: ref_counted_ptr.h:35
static bool LoadBalancingPolicyExists(const char *name, bool *requires_config)
Returns true if the LB policy factory specified by name exists in this registry.
Definition: lb_policy_registry.cc:97
Definition: json.h:32
Args used to instantiate an LB policy.
Definition: lb_policy.h:311
static OrphanablePtr< LoadBalancingPolicy > CreateLoadBalancingPolicy(const char *name, LoadBalancingPolicy::Args args)
Creates an LB policy of the type specified by name.
Definition: lb_policy_registry.cc:86