resolver.cc
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 
20 
22 
23 #include <algorithm>
24 #include <utility>
25 
27 
29  "resolver_refcount");
30 
31 namespace grpc_core {
32 
33 //
34 // Resolver
35 //
36 
39  ? "Resolver"
40  : nullptr) {}
41 
42 //
43 // Resolver::Result
44 //
45 
47 
49  : addresses(other.addresses),
50  service_config(other.service_config),
51  resolution_note(other.resolution_note),
53 
55  : addresses(std::move(other.addresses)),
56  service_config(std::move(other.service_config)),
57  resolution_note(std::move(other.resolution_note)),
58  // TODO(roth): Use std::move() once channel args is converted to C++.
59  args(other.args) {
60  other.args = nullptr;
61 }
62 
64  if (&other == this) return *this;
65  addresses = other.addresses;
66  service_config = other.service_config;
67  resolution_note = other.resolution_note;
70  return *this;
71 }
72 
74  addresses = std::move(other.addresses);
75  service_config = std::move(other.service_config);
76  resolution_note = std::move(other.resolution_note);
77  // TODO(roth): Use std::move() once channel args is converted to C++.
79  args = other.args;
80  other.args = nullptr;
81  return *this;
82 }
83 
84 } // namespace grpc_core
grpc_core::Resolver::Result::args
const grpc_channel_args * args
Definition: resolver/resolver.h:70
grpc_core::Resolver::Result::addresses
absl::StatusOr< ServerAddressList > addresses
A list of addresses, or an error.
Definition: resolver/resolver.h:58
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::Resolver::Result::service_config
absl::StatusOr< RefCountedPtr< ServiceConfig > > service_config
A service config, or an error.
Definition: resolver/resolver.h:60
GRPC_TRACE_FLAG_ENABLED
#define GRPC_TRACE_FLAG_ENABLED(f)
Definition: debug/trace.h:114
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
grpc_core::Resolver::Result
Results returned by the resolver.
Definition: resolver/resolver.h:56
grpc_channel_args_destroy
void grpc_channel_args_destroy(grpc_channel_args *a)
Definition: channel_args.cc:360
grpc_channel_args_copy
grpc_channel_args * grpc_channel_args_copy(const grpc_channel_args *src)
Definition: channel_args.cc:285
grpc_core::InternallyRefCounted
Definition: orphanable.h:73
grpc_trace_resolver_refcount
grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount(false, "resolver_refcount")
grpc_core::Resolver::Result::Result
Result()=default
resolver.h
grpc_core::TraceFlag
Definition: debug/trace.h:63
grpc_core::Resolver::Resolver
Resolver()
Definition: resolver.cc:37
grpc_core::Resolver::Result::~Result
~Result()
Definition: resolver.cc:46
grpc_core::Resolver::Result::operator=
Result & operator=(const Result &other)
Definition: resolver.cc:63
grpc_core::Resolver::Result::resolution_note
std::string resolution_note
Definition: resolver/resolver.h:67
channel_args.h
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:04