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 */
grpc_core::LoadBalancingPolicyRegistry::ParseLoadBalancingConfig
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
orphanable.h
grpc_core
Round Robin Policy.
Definition: backend_metric.cc:24
grpc_core::LoadBalancingPolicyRegistry::LoadBalancingPolicyExists
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
grpc_json
Definition: json.h:32
lb_policy_factory.h
grpc_core::RefCountedPtr
Definition: ref_counted_ptr.h:35
grpc_core::LoadBalancingPolicyRegistry::Builder
Methods used to create and populate the LoadBalancingPolicyRegistry.
Definition: lb_policy_registry.h:35
grpc_core::LoadBalancingPolicyRegistry::Builder::ShutdownRegistry
static void ShutdownRegistry()
Definition: lb_policy_registry.cc:70
grpc_core::LoadBalancingPolicyRegistry
Definition: lb_policy_registry.h:30
grpc_core::OrphanablePtr
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:68
grpc_core::LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy
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
grpc_error
Definition: error_internal.h:39
grpc_core::LoadBalancingPolicy::Args
Args used to instantiate an LB policy.
Definition: lb_policy.h:311
memory.h
grpc_core::LoadBalancingPolicyRegistry::Builder::InitRegistry
static void InitRegistry()
Global initialization and shutdown hooks.
Definition: lb_policy_registry.cc:66
grpc_core::LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory
static void RegisterLoadBalancingPolicyFactory(std::unique_ptr< LoadBalancingPolicyFactory > factory)
Registers an LB policy factory.
Definition: lb_policy_registry.cc:75
port_platform.h