aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Alistair Veitch <aveitch@google.com>2016-07-21 17:29:04 -0700
committerGravatar Alistair Veitch <aveitch@google.com>2016-07-21 17:29:04 -0700
commit3abd27e5312540e2efd63e94ca024a2e8d42af39 (patch)
tree9d580b71d6e81fd42f7ef9cb72e6b74321a9b55e /include
parentef1c860197742c87819070e6906b96d1e42451b3 (diff)
parentb8e26c021718758c2a0b2e73757580476d995498 (diff)
merge to upstream/master
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/create_channel_posix.h (renamed from include/grpc/grpc_zookeeper.h)42
-rw-r--r--include/grpc++/ext/proto_server_reflection_plugin.h (renamed from include/grpc++/support/config_protobuf.h)38
-rw-r--r--include/grpc++/ext/reflection.grpc.pb.h184
-rw-r--r--include/grpc++/ext/reflection.pb.h2035
-rw-r--r--include/grpc++/grpc++.h2
-rw-r--r--include/grpc++/impl/codegen/async_stream.h57
-rw-r--r--include/grpc++/impl/codegen/async_unary_call.h3
-rw-r--r--include/grpc++/impl/codegen/call.h38
-rw-r--r--include/grpc++/impl/codegen/client_context.h12
-rw-r--r--include/grpc++/impl/codegen/completion_queue.h15
-rw-r--r--include/grpc++/impl/codegen/config.h17
-rw-r--r--include/grpc++/impl/codegen/config_protobuf.h27
-rw-r--r--include/grpc++/impl/codegen/core_codegen.h85
-rw-r--r--include/grpc++/impl/codegen/core_codegen_interface.h7
-rw-r--r--include/grpc++/impl/codegen/impl/async_stream.h43
-rw-r--r--include/grpc++/impl/codegen/impl/status_code_enum.h152
-rw-r--r--include/grpc++/impl/codegen/proto_utils.h17
-rw-r--r--include/grpc++/impl/codegen/server_context.h7
-rw-r--r--include/grpc++/impl/codegen/server_interface.h8
-rw-r--r--include/grpc++/impl/codegen/sync_stream.h12
-rw-r--r--include/grpc++/impl/grpc_library.h3
-rw-r--r--include/grpc++/impl/server_builder_option.h3
-rw-r--r--include/grpc++/server.h9
-rw-r--r--include/grpc++/server_builder.h67
-rw-r--r--include/grpc++/server_posix.h (renamed from include/grpc++/impl/proto_utils.h)27
-rw-r--r--include/grpc++/support/byte_buffer.h2
-rw-r--r--include/grpc++/support/slice.h3
-rw-r--r--include/grpc/compression.h3
-rw-r--r--include/grpc/grpc_posix.h78
-rw-r--r--include/grpc/impl/codegen/byte_buffer.h9
-rw-r--r--include/grpc/impl/codegen/compression_types.h44
-rw-r--r--include/grpc/impl/codegen/grpc_types.h46
-rw-r--r--include/grpc/impl/codegen/log.h3
-rw-r--r--include/grpc/impl/codegen/port_platform.h19
-rw-r--r--include/grpc/module.modulemap5
-rw-r--r--include/grpc/support/avl.h5
-rw-r--r--include/grpc/support/string_util.h3
37 files changed, 2849 insertions, 281 deletions
diff --git a/include/grpc/grpc_zookeeper.h b/include/grpc++/create_channel_posix.h
index 2b195c18bf..0d96159942 100644
--- a/include/grpc/grpc_zookeeper.h
+++ b/include/grpc++/create_channel_posix.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,29 +31,27 @@
*
*/
-/** Support zookeeper as alternative name system in addition to DNS
- * Zookeeper name in gRPC is represented as a URI:
- * zookeeper://host:port/path/service/instance
- *
- * Where zookeeper is the name system scheme
- * host:port is the address of a zookeeper server
- * /path/service/instance is the zookeeper name to be resolved
- *
- * Refer doc/naming.md for more details
- */
+#ifndef GRPCXX_CREATE_CHANNEL_POSIX_H
+#define GRPCXX_CREATE_CHANNEL_POSIX_H
+
+#include <memory>
+
+#include <grpc++/channel.h>
+#include <grpc/support/port_platform.h>
+
+namespace grpc {
-#ifndef GRPC_GRPC_ZOOKEEPER_H
-#define GRPC_GRPC_ZOOKEEPER_H
+#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
-#ifdef __cplusplus
-extern "C" {
-#endif
+/// Create a new \a Channel communicating over given file descriptor
+///
+/// \param target The name of the target.
+/// \param fd The file descriptor representing a socket.
+std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target,
+ int fd);
-/** Register zookeeper name resolver in grpc */
-void grpc_zookeeper_register();
+#endif // GPR_SUPPORT_CHANNELS_FROM_FD
-#ifdef __cplusplus
-}
-#endif
+} // namespace grpc
-#endif /* GRPC_GRPC_ZOOKEEPER_H */
+#endif // GRPCXX_CREATE_CHANNEL_POSIX_H
diff --git a/include/grpc++/support/config_protobuf.h b/include/grpc++/ext/proto_server_reflection_plugin.h
index 3e7f169652..3e54882d41 100644
--- a/include/grpc++/support/config_protobuf.h
+++ b/include/grpc++/ext/proto_server_reflection_plugin.h
@@ -31,9 +31,39 @@
*
*/
-#ifndef GRPCXX_SUPPORT_CONFIG_PROTOBUF_H
-#define GRPCXX_SUPPORT_CONFIG_PROTOBUF_H
+#ifndef GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
+#define GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
-#include <grpc++/impl/codegen/config_protobuf.h>
+#include <grpc++/impl/server_builder_plugin.h>
+#include <grpc++/support/config.h>
-#endif // GRPCXX_SUPPORT_CONFIG_PROTOBUF_H
+namespace grpc {
+class ServerInitializer;
+class ProtoServerReflection;
+} // namespace grpc
+
+namespace grpc {
+namespace reflection {
+
+class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
+ public:
+ ProtoServerReflectionPlugin();
+ ::grpc::string name() GRPC_OVERRIDE;
+ void InitServer(::grpc::ServerInitializer* si) GRPC_OVERRIDE;
+ void Finish(::grpc::ServerInitializer* si) GRPC_OVERRIDE;
+ void ChangeArguments(const ::grpc::string& name, void* value) GRPC_OVERRIDE;
+ bool has_async_methods() const GRPC_OVERRIDE;
+ bool has_sync_methods() const GRPC_OVERRIDE;
+
+ private:
+ std::shared_ptr<grpc::ProtoServerReflection> reflection_service_;
+};
+
+// Add proto reflection plugin to ServerBuilder. This function should be called
+// at the static initialization time.
+void InitProtoReflectionServerBuilderPlugin();
+
+} // namespace reflection
+} // namespace grpc
+
+#endif // GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
diff --git a/include/grpc++/ext/reflection.grpc.pb.h b/include/grpc++/ext/reflection.grpc.pb.h
new file mode 100644
index 0000000000..0b4ef86147
--- /dev/null
+++ b/include/grpc++/ext/reflection.grpc.pb.h
@@ -0,0 +1,184 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+// Generated by the gRPC protobuf plugin.
+// If you make any local change, they will be lost.
+// source: reflection.proto
+// Original file comments:
+// Copyright 2016, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Service exported by server reflection
+//
+#ifndef GRPC_reflection_2eproto__INCLUDED
+#define GRPC_reflection_2eproto__INCLUDED
+
+#include <grpc++/ext/reflection.pb.h>
+
+#include <grpc++/impl/codegen/async_stream.h>
+#include <grpc++/impl/codegen/async_unary_call.h>
+#include <grpc++/impl/codegen/proto_utils.h>
+#include <grpc++/impl/codegen/rpc_method.h>
+#include <grpc++/impl/codegen/service_type.h>
+#include <grpc++/impl/codegen/status.h>
+#include <grpc++/impl/codegen/stub_options.h>
+#include <grpc++/impl/codegen/sync_stream.h>
+
+namespace grpc {
+class CompletionQueue;
+class Channel;
+class RpcService;
+class ServerCompletionQueue;
+class ServerContext;
+} // namespace grpc
+
+namespace grpc {
+namespace reflection {
+namespace v1alpha {
+
+class ServerReflection GRPC_FINAL {
+ public:
+ class StubInterface {
+ public:
+ virtual ~StubInterface() {}
+ // The reflection service is structured as a bidirectional stream, ensuring
+ // all related requests go to a single server.
+ std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) {
+ return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context));
+ }
+ std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
+ return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag));
+ }
+ private:
+ virtual ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) = 0;
+ virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0;
+ };
+ class Stub GRPC_FINAL : public StubInterface {
+ public:
+ Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel);
+ std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) {
+ return std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context));
+ }
+ std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
+ return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag));
+ }
+
+ private:
+ std::shared_ptr< ::grpc::ChannelInterface> channel_;
+ ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) GRPC_OVERRIDE;
+ ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) GRPC_OVERRIDE;
+ const ::grpc::RpcMethod rpcmethod_ServerReflectionInfo_;
+ };
+ static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
+
+ class Service : public ::grpc::Service {
+ public:
+ Service();
+ virtual ~Service();
+ // The reflection service is structured as a bidirectional stream, ensuring
+ // all related requests go to a single server.
+ virtual ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream);
+ };
+ template <class BaseClass>
+ class WithAsyncMethod_ServerReflectionInfo : public BaseClass {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service *service) {}
+ public:
+ WithAsyncMethod_ServerReflectionInfo() {
+ ::grpc::Service::MarkMethodAsync(0);
+ }
+ ~WithAsyncMethod_ServerReflectionInfo() GRPC_OVERRIDE {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ void RequestServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+ ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag);
+ }
+ };
+ typedef WithAsyncMethod_ServerReflectionInfo<Service > AsyncService;
+ template <class BaseClass>
+ class WithGenericMethod_ServerReflectionInfo : public BaseClass {
+ private:
+ void BaseClassMustBeDerivedFromService(const Service *service) {}
+ public:
+ WithGenericMethod_ServerReflectionInfo() {
+ ::grpc::Service::MarkMethodGeneric(0);
+ }
+ ~WithGenericMethod_ServerReflectionInfo() GRPC_OVERRIDE {
+ BaseClassMustBeDerivedFromService(this);
+ }
+ // disable synchronous version of this method
+ ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE {
+ abort();
+ return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+ }
+ };
+};
+
+} // namespace v1alpha
+} // namespace reflection
+} // namespace grpc
+
+
+#endif // GRPC_reflection_2eproto__INCLUDED
diff --git a/include/grpc++/ext/reflection.pb.h b/include/grpc++/ext/reflection.pb.h
new file mode 100644
index 0000000000..00d07735ee
--- /dev/null
+++ b/include/grpc++/ext/reflection.pb.h
@@ -0,0 +1,2035 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: reflection.proto
+
+#ifndef PROTOBUF_reflection_2eproto__INCLUDED
+#define PROTOBUF_reflection_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 3000000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers. Please update
+#error your headers.
+#endif
+#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers. Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/metadata.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/unknown_field_set.h>
+// @@protoc_insertion_point(includes)
+
+namespace grpc {
+namespace reflection {
+namespace v1alpha {
+
+// Internal implementation detail -- do not call these.
+void protobuf_AddDesc_reflection_2eproto();
+void protobuf_AssignDesc_reflection_2eproto();
+void protobuf_ShutdownFile_reflection_2eproto();
+
+class ErrorResponse;
+class ExtensionNumberResponse;
+class ExtensionRequest;
+class FileDescriptorResponse;
+class ListServiceResponse;
+class ServerReflectionRequest;
+class ServerReflectionResponse;
+class ServiceResponse;
+
+// ===================================================================
+
+class ServerReflectionRequest : public ::google::protobuf::Message {
+ public:
+ ServerReflectionRequest();
+ virtual ~ServerReflectionRequest();
+
+ ServerReflectionRequest(const ServerReflectionRequest& from);
+
+ inline ServerReflectionRequest& operator=(const ServerReflectionRequest& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ServerReflectionRequest& default_instance();
+
+ enum MessageRequestCase {
+ kFileByFilename = 3,
+ kFileContainingSymbol = 4,
+ kFileContainingExtension = 5,
+ kAllExtensionNumbersOfType = 6,
+ kListServices = 7,
+ MESSAGE_REQUEST_NOT_SET = 0,
+ };
+
+ void Swap(ServerReflectionRequest* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ServerReflectionRequest* New() const { return New(NULL); }
+
+ ServerReflectionRequest* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ServerReflectionRequest& from);
+ void MergeFrom(const ServerReflectionRequest& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ServerReflectionRequest* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // optional string host = 1;
+ void clear_host();
+ static const int kHostFieldNumber = 1;
+ const ::std::string& host() const;
+ void set_host(const ::std::string& value);
+ void set_host(const char* value);
+ void set_host(const char* value, size_t size);
+ ::std::string* mutable_host();
+ ::std::string* release_host();
+ void set_allocated_host(::std::string* host);
+
+ // optional string file_by_filename = 3;
+ private:
+ bool has_file_by_filename() const;
+ public:
+ void clear_file_by_filename();
+ static const int kFileByFilenameFieldNumber = 3;
+ const ::std::string& file_by_filename() const;
+ void set_file_by_filename(const ::std::string& value);
+ void set_file_by_filename(const char* value);
+ void set_file_by_filename(const char* value, size_t size);
+ ::std::string* mutable_file_by_filename();
+ ::std::string* release_file_by_filename();
+ void set_allocated_file_by_filename(::std::string* file_by_filename);
+
+ // optional string file_containing_symbol = 4;
+ private:
+ bool has_file_containing_symbol() const;
+ public:
+ void clear_file_containing_symbol();
+ static const int kFileContainingSymbolFieldNumber = 4;
+ const ::std::string& file_containing_symbol() const;
+ void set_file_containing_symbol(const ::std::string& value);
+ void set_file_containing_symbol(const char* value);
+ void set_file_containing_symbol(const char* value, size_t size);
+ ::std::string* mutable_file_containing_symbol();
+ ::std::string* release_file_containing_symbol();
+ void set_allocated_file_containing_symbol(::std::string* file_containing_symbol);
+
+ // optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5;
+ bool has_file_containing_extension() const;
+ void clear_file_containing_extension();
+ static const int kFileContainingExtensionFieldNumber = 5;
+ const ::grpc::reflection::v1alpha::ExtensionRequest& file_containing_extension() const;
+ ::grpc::reflection::v1alpha::ExtensionRequest* mutable_file_containing_extension();
+ ::grpc::reflection::v1alpha::ExtensionRequest* release_file_containing_extension();
+ void set_allocated_file_containing_extension(::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension);
+
+ // optional string all_extension_numbers_of_type = 6;
+ private:
+ bool has_all_extension_numbers_of_type() const;
+ public:
+ void clear_all_extension_numbers_of_type();
+ static const int kAllExtensionNumbersOfTypeFieldNumber = 6;
+ const ::std::string& all_extension_numbers_of_type() const;
+ void set_all_extension_numbers_of_type(const ::std::string& value);
+ void set_all_extension_numbers_of_type(const char* value);
+ void set_all_extension_numbers_of_type(const char* value, size_t size);
+ ::std::string* mutable_all_extension_numbers_of_type();
+ ::std::string* release_all_extension_numbers_of_type();
+ void set_allocated_all_extension_numbers_of_type(::std::string* all_extension_numbers_of_type);
+
+ // optional string list_services = 7;
+ private:
+ bool has_list_services() const;
+ public:
+ void clear_list_services();
+ static const int kListServicesFieldNumber = 7;
+ const ::std::string& list_services() const;
+ void set_list_services(const ::std::string& value);
+ void set_list_services(const char* value);
+ void set_list_services(const char* value, size_t size);
+ ::std::string* mutable_list_services();
+ ::std::string* release_list_services();
+ void set_allocated_list_services(::std::string* list_services);
+
+ MessageRequestCase message_request_case() const;
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ServerReflectionRequest)
+ private:
+ inline void set_has_file_by_filename();
+ inline void set_has_file_containing_symbol();
+ inline void set_has_file_containing_extension();
+ inline void set_has_all_extension_numbers_of_type();
+ inline void set_has_list_services();
+
+ inline bool has_message_request() const;
+ void clear_message_request();
+ inline void clear_has_message_request();
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::internal::ArenaStringPtr host_;
+ union MessageRequestUnion {
+ MessageRequestUnion() {}
+ ::google::protobuf::internal::ArenaStringPtr file_by_filename_;
+ ::google::protobuf::internal::ArenaStringPtr file_containing_symbol_;
+ ::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension_;
+ ::google::protobuf::internal::ArenaStringPtr all_extension_numbers_of_type_;
+ ::google::protobuf::internal::ArenaStringPtr list_services_;
+ } message_request_;
+ mutable int _cached_size_;
+ ::google::protobuf::uint32 _oneof_case_[1];
+
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ServerReflectionRequest* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ExtensionRequest : public ::google::protobuf::Message {
+ public:
+ ExtensionRequest();
+ virtual ~ExtensionRequest();
+
+ ExtensionRequest(const ExtensionRequest& from);
+
+ inline ExtensionRequest& operator=(const ExtensionRequest& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ExtensionRequest& default_instance();
+
+ void Swap(ExtensionRequest* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ExtensionRequest* New() const { return New(NULL); }
+
+ ExtensionRequest* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ExtensionRequest& from);
+ void MergeFrom(const ExtensionRequest& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ExtensionRequest* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // optional string containing_type = 1;
+ void clear_containing_type();
+ static const int kContainingTypeFieldNumber = 1;
+ const ::std::string& containing_type() const;
+ void set_containing_type(const ::std::string& value);
+ void set_containing_type(const char* value);
+ void set_containing_type(const char* value, size_t size);
+ ::std::string* mutable_containing_type();
+ ::std::string* release_containing_type();
+ void set_allocated_containing_type(::std::string* containing_type);
+
+ // optional int32 extension_number = 2;
+ void clear_extension_number();
+ static const int kExtensionNumberFieldNumber = 2;
+ ::google::protobuf::int32 extension_number() const;
+ void set_extension_number(::google::protobuf::int32 value);
+
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ExtensionRequest)
+ private:
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::internal::ArenaStringPtr containing_type_;
+ ::google::protobuf::int32 extension_number_;
+ mutable int _cached_size_;
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ExtensionRequest* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ServerReflectionResponse : public ::google::protobuf::Message {
+ public:
+ ServerReflectionResponse();
+ virtual ~ServerReflectionResponse();
+
+ ServerReflectionResponse(const ServerReflectionResponse& from);
+
+ inline ServerReflectionResponse& operator=(const ServerReflectionResponse& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ServerReflectionResponse& default_instance();
+
+ enum MessageResponseCase {
+ kFileDescriptorResponse = 4,
+ kAllExtensionNumbersResponse = 5,
+ kListServicesResponse = 6,
+ kErrorResponse = 7,
+ MESSAGE_RESPONSE_NOT_SET = 0,
+ };
+
+ void Swap(ServerReflectionResponse* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ServerReflectionResponse* New() const { return New(NULL); }
+
+ ServerReflectionResponse* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ServerReflectionResponse& from);
+ void MergeFrom(const ServerReflectionResponse& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ServerReflectionResponse* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // optional string valid_host = 1;
+ void clear_valid_host();
+ static const int kValidHostFieldNumber = 1;
+ const ::std::string& valid_host() const;
+ void set_valid_host(const ::std::string& value);
+ void set_valid_host(const char* value);
+ void set_valid_host(const char* value, size_t size);
+ ::std::string* mutable_valid_host();
+ ::std::string* release_valid_host();
+ void set_allocated_valid_host(::std::string* valid_host);
+
+ // optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2;
+ bool has_original_request() const;
+ void clear_original_request();
+ static const int kOriginalRequestFieldNumber = 2;
+ const ::grpc::reflection::v1alpha::ServerReflectionRequest& original_request() const;
+ ::grpc::reflection::v1alpha::ServerReflectionRequest* mutable_original_request();
+ ::grpc::reflection::v1alpha::ServerReflectionRequest* release_original_request();
+ void set_allocated_original_request(::grpc::reflection::v1alpha::ServerReflectionRequest* original_request);
+
+ // optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4;
+ bool has_file_descriptor_response() const;
+ void clear_file_descriptor_response();
+ static const int kFileDescriptorResponseFieldNumber = 4;
+ const ::grpc::reflection::v1alpha::FileDescriptorResponse& file_descriptor_response() const;
+ ::grpc::reflection::v1alpha::FileDescriptorResponse* mutable_file_descriptor_response();
+ ::grpc::reflection::v1alpha::FileDescriptorResponse* release_file_descriptor_response();
+ void set_allocated_file_descriptor_response(::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response);
+
+ // optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5;
+ bool has_all_extension_numbers_response() const;
+ void clear_all_extension_numbers_response();
+ static const int kAllExtensionNumbersResponseFieldNumber = 5;
+ const ::grpc::reflection::v1alpha::ExtensionNumberResponse& all_extension_numbers_response() const;
+ ::grpc::reflection::v1alpha::ExtensionNumberResponse* mutable_all_extension_numbers_response();
+ ::grpc::reflection::v1alpha::ExtensionNumberResponse* release_all_extension_numbers_response();
+ void set_allocated_all_extension_numbers_response(::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response);
+
+ // optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6;
+ bool has_list_services_response() const;
+ void clear_list_services_response();
+ static const int kListServicesResponseFieldNumber = 6;
+ const ::grpc::reflection::v1alpha::ListServiceResponse& list_services_response() const;
+ ::grpc::reflection::v1alpha::ListServiceResponse* mutable_list_services_response();
+ ::grpc::reflection::v1alpha::ListServiceResponse* release_list_services_response();
+ void set_allocated_list_services_response(::grpc::reflection::v1alpha::ListServiceResponse* list_services_response);
+
+ // optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7;
+ bool has_error_response() const;
+ void clear_error_response();
+ static const int kErrorResponseFieldNumber = 7;
+ const ::grpc::reflection::v1alpha::ErrorResponse& error_response() const;
+ ::grpc::reflection::v1alpha::ErrorResponse* mutable_error_response();
+ ::grpc::reflection::v1alpha::ErrorResponse* release_error_response();
+ void set_allocated_error_response(::grpc::reflection::v1alpha::ErrorResponse* error_response);
+
+ MessageResponseCase message_response_case() const;
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ServerReflectionResponse)
+ private:
+ inline void set_has_file_descriptor_response();
+ inline void set_has_all_extension_numbers_response();
+ inline void set_has_list_services_response();
+ inline void set_has_error_response();
+
+ inline bool has_message_response() const;
+ void clear_message_response();
+ inline void clear_has_message_response();
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::internal::ArenaStringPtr valid_host_;
+ ::grpc::reflection::v1alpha::ServerReflectionRequest* original_request_;
+ union MessageResponseUnion {
+ MessageResponseUnion() {}
+ ::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response_;
+ ::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response_;
+ ::grpc::reflection::v1alpha::ListServiceResponse* list_services_response_;
+ ::grpc::reflection::v1alpha::ErrorResponse* error_response_;
+ } message_response_;
+ mutable int _cached_size_;
+ ::google::protobuf::uint32 _oneof_case_[1];
+
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ServerReflectionResponse* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class FileDescriptorResponse : public ::google::protobuf::Message {
+ public:
+ FileDescriptorResponse();
+ virtual ~FileDescriptorResponse();
+
+ FileDescriptorResponse(const FileDescriptorResponse& from);
+
+ inline FileDescriptorResponse& operator=(const FileDescriptorResponse& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const FileDescriptorResponse& default_instance();
+
+ void Swap(FileDescriptorResponse* other);
+
+ // implements Message ----------------------------------------------
+
+ inline FileDescriptorResponse* New() const { return New(NULL); }
+
+ FileDescriptorResponse* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const FileDescriptorResponse& from);
+ void MergeFrom(const FileDescriptorResponse& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(FileDescriptorResponse* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // repeated bytes file_descriptor_proto = 1;
+ int file_descriptor_proto_size() const;
+ void clear_file_descriptor_proto();
+ static const int kFileDescriptorProtoFieldNumber = 1;
+ const ::std::string& file_descriptor_proto(int index) const;
+ ::std::string* mutable_file_descriptor_proto(int index);
+ void set_file_descriptor_proto(int index, const ::std::string& value);
+ void set_file_descriptor_proto(int index, const char* value);
+ void set_file_descriptor_proto(int index, const void* value, size_t size);
+ ::std::string* add_file_descriptor_proto();
+ void add_file_descriptor_proto(const ::std::string& value);
+ void add_file_descriptor_proto(const char* value);
+ void add_file_descriptor_proto(const void* value, size_t size);
+ const ::google::protobuf::RepeatedPtrField< ::std::string>& file_descriptor_proto() const;
+ ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_file_descriptor_proto();
+
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.FileDescriptorResponse)
+ private:
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::RepeatedPtrField< ::std::string> file_descriptor_proto_;
+ mutable int _cached_size_;
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static FileDescriptorResponse* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ExtensionNumberResponse : public ::google::protobuf::Message {
+ public:
+ ExtensionNumberResponse();
+ virtual ~ExtensionNumberResponse();
+
+ ExtensionNumberResponse(const ExtensionNumberResponse& from);
+
+ inline ExtensionNumberResponse& operator=(const ExtensionNumberResponse& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ExtensionNumberResponse& default_instance();
+
+ void Swap(ExtensionNumberResponse* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ExtensionNumberResponse* New() const { return New(NULL); }
+
+ ExtensionNumberResponse* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ExtensionNumberResponse& from);
+ void MergeFrom(const ExtensionNumberResponse& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ExtensionNumberResponse* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // optional string base_type_name = 1;
+ void clear_base_type_name();
+ static const int kBaseTypeNameFieldNumber = 1;
+ const ::std::string& base_type_name() const;
+ void set_base_type_name(const ::std::string& value);
+ void set_base_type_name(const char* value);
+ void set_base_type_name(const char* value, size_t size);
+ ::std::string* mutable_base_type_name();
+ ::std::string* release_base_type_name();
+ void set_allocated_base_type_name(::std::string* base_type_name);
+
+ // repeated int32 extension_number = 2;
+ int extension_number_size() const;
+ void clear_extension_number();
+ static const int kExtensionNumberFieldNumber = 2;
+ ::google::protobuf::int32 extension_number(int index) const;
+ void set_extension_number(int index, ::google::protobuf::int32 value);
+ void add_extension_number(::google::protobuf::int32 value);
+ const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+ extension_number() const;
+ ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+ mutable_extension_number();
+
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ExtensionNumberResponse)
+ private:
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::internal::ArenaStringPtr base_type_name_;
+ ::google::protobuf::RepeatedField< ::google::protobuf::int32 > extension_number_;
+ mutable int _extension_number_cached_byte_size_;
+ mutable int _cached_size_;
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ExtensionNumberResponse* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ListServiceResponse : public ::google::protobuf::Message {
+ public:
+ ListServiceResponse();
+ virtual ~ListServiceResponse();
+
+ ListServiceResponse(const ListServiceResponse& from);
+
+ inline ListServiceResponse& operator=(const ListServiceResponse& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ListServiceResponse& default_instance();
+
+ void Swap(ListServiceResponse* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ListServiceResponse* New() const { return New(NULL); }
+
+ ListServiceResponse* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ListServiceResponse& from);
+ void MergeFrom(const ListServiceResponse& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ListServiceResponse* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // repeated .grpc.reflection.v1alpha.ServiceResponse service = 1;
+ int service_size() const;
+ void clear_service();
+ static const int kServiceFieldNumber = 1;
+ const ::grpc::reflection::v1alpha::ServiceResponse& service(int index) const;
+ ::grpc::reflection::v1alpha::ServiceResponse* mutable_service(int index);
+ ::grpc::reflection::v1alpha::ServiceResponse* add_service();
+ ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >*
+ mutable_service();
+ const ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >&
+ service() const;
+
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ListServiceResponse)
+ private:
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse > service_;
+ mutable int _cached_size_;
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ListServiceResponse* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ServiceResponse : public ::google::protobuf::Message {
+ public:
+ ServiceResponse();
+ virtual ~ServiceResponse();
+
+ ServiceResponse(const ServiceResponse& from);
+
+ inline ServiceResponse& operator=(const ServiceResponse& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ServiceResponse& default_instance();
+
+ void Swap(ServiceResponse* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ServiceResponse* New() const { return New(NULL); }
+
+ ServiceResponse* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ServiceResponse& from);
+ void MergeFrom(const ServiceResponse& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ServiceResponse* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // optional string name = 1;
+ void clear_name();
+ static const int kNameFieldNumber = 1;
+ const ::std::string& name() const;
+ void set_name(const ::std::string& value);
+ void set_name(const char* value);
+ void set_name(const char* value, size_t size);
+ ::std::string* mutable_name();
+ ::std::string* release_name();
+ void set_allocated_name(::std::string* name);
+
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ServiceResponse)
+ private:
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::internal::ArenaStringPtr name_;
+ mutable int _cached_size_;
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ServiceResponse* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ErrorResponse : public ::google::protobuf::Message {
+ public:
+ ErrorResponse();
+ virtual ~ErrorResponse();
+
+ ErrorResponse(const ErrorResponse& from);
+
+ inline ErrorResponse& operator=(const ErrorResponse& from) {
+ CopyFrom(from);
+ return *this;
+ }
+
+ static const ::google::protobuf::Descriptor* descriptor();
+ static const ErrorResponse& default_instance();
+
+ void Swap(ErrorResponse* other);
+
+ // implements Message ----------------------------------------------
+
+ inline ErrorResponse* New() const { return New(NULL); }
+
+ ErrorResponse* New(::google::protobuf::Arena* arena) const;
+ void CopyFrom(const ::google::protobuf::Message& from);
+ void MergeFrom(const ::google::protobuf::Message& from);
+ void CopyFrom(const ErrorResponse& from);
+ void MergeFrom(const ErrorResponse& from);
+ void Clear();
+ bool IsInitialized() const;
+
+ int ByteSize() const;
+ bool MergePartialFromCodedStream(
+ ::google::protobuf::io::CodedInputStream* input);
+ void SerializeWithCachedSizes(
+ ::google::protobuf::io::CodedOutputStream* output) const;
+ ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+ int GetCachedSize() const { return _cached_size_; }
+ private:
+ void SharedCtor();
+ void SharedDtor();
+ void SetCachedSize(int size) const;
+ void InternalSwap(ErrorResponse* other);
+ private:
+ inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
+ return _internal_metadata_.arena();
+ }
+ inline void* MaybeArenaPtr() const {
+ return _internal_metadata_.raw_arena_ptr();
+ }
+ public:
+
+ ::google::protobuf::Metadata GetMetadata() const;
+
+ // nested types ----------------------------------------------------
+
+ // accessors -------------------------------------------------------
+
+ // optional int32 error_code = 1;
+ void clear_error_code();
+ static const int kErrorCodeFieldNumber = 1;
+ ::google::protobuf::int32 error_code() const;
+ void set_error_code(::google::protobuf::int32 value);
+
+ // optional string error_message = 2;
+ void clear_error_message();
+ static const int kErrorMessageFieldNumber = 2;
+ const ::std::string& error_message() const;
+ void set_error_message(const ::std::string& value);
+ void set_error_message(const char* value);
+ void set_error_message(const char* value, size_t size);
+ ::std::string* mutable_error_message();
+ ::std::string* release_error_message();
+ void set_allocated_error_message(::std::string* error_message);
+
+ // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ErrorResponse)
+ private:
+
+ ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
+ bool _is_default_instance_;
+ ::google::protobuf::internal::ArenaStringPtr error_message_;
+ ::google::protobuf::int32 error_code_;
+ mutable int _cached_size_;
+ friend void protobuf_AddDesc_reflection_2eproto();
+ friend void protobuf_AssignDesc_reflection_2eproto();
+ friend void protobuf_ShutdownFile_reflection_2eproto();
+
+ void InitAsDefaultInstance();
+ static ErrorResponse* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+#if !PROTOBUF_INLINE_NOT_IN_HEADERS
+// ServerReflectionRequest
+
+// optional string host = 1;
+inline void ServerReflectionRequest::clear_host() {
+ host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& ServerReflectionRequest::host() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+ return host_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ServerReflectionRequest::set_host(const ::std::string& value) {
+
+ host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+}
+inline void ServerReflectionRequest::set_host(const char* value) {
+
+ host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+}
+inline void ServerReflectionRequest::set_host(const char* value, size_t size) {
+
+ host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+}
+inline ::std::string* ServerReflectionRequest::mutable_host() {
+
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+ return host_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServerReflectionRequest::release_host() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+
+ return host_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ServerReflectionRequest::set_allocated_host(::std::string* host) {
+ if (host != NULL) {
+
+ } else {
+
+ }
+ host_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host);
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.host)
+}
+
+// optional string file_by_filename = 3;
+inline bool ServerReflectionRequest::has_file_by_filename() const {
+ return message_request_case() == kFileByFilename;
+}
+inline void ServerReflectionRequest::set_has_file_by_filename() {
+ _oneof_case_[0] = kFileByFilename;
+}
+inline void ServerReflectionRequest::clear_file_by_filename() {
+ if (has_file_by_filename()) {
+ message_request_.file_by_filename_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ clear_has_message_request();
+ }
+}
+inline const ::std::string& ServerReflectionRequest::file_by_filename() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+ if (has_file_by_filename()) {
+ return message_request_.file_by_filename_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+}
+inline void ServerReflectionRequest::set_file_by_filename(const ::std::string& value) {
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+ if (!has_file_by_filename()) {
+ clear_message_request();
+ set_has_file_by_filename();
+ message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+}
+inline void ServerReflectionRequest::set_file_by_filename(const char* value) {
+ if (!has_file_by_filename()) {
+ clear_message_request();
+ set_has_file_by_filename();
+ message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+}
+inline void ServerReflectionRequest::set_file_by_filename(const char* value, size_t size) {
+ if (!has_file_by_filename()) {
+ clear_message_request();
+ set_has_file_by_filename();
+ message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+}
+inline ::std::string* ServerReflectionRequest::mutable_file_by_filename() {
+ if (!has_file_by_filename()) {
+ clear_message_request();
+ set_has_file_by_filename();
+ message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+ return message_request_.file_by_filename_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServerReflectionRequest::release_file_by_filename() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+ if (has_file_by_filename()) {
+ clear_has_message_request();
+ return message_request_.file_by_filename_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionRequest::set_allocated_file_by_filename(::std::string* file_by_filename) {
+ if (!has_file_by_filename()) {
+ message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ clear_message_request();
+ if (file_by_filename != NULL) {
+ set_has_file_by_filename();
+ message_request_.file_by_filename_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ file_by_filename);
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename)
+}
+
+// optional string file_containing_symbol = 4;
+inline bool ServerReflectionRequest::has_file_containing_symbol() const {
+ return message_request_case() == kFileContainingSymbol;
+}
+inline void ServerReflectionRequest::set_has_file_containing_symbol() {
+ _oneof_case_[0] = kFileContainingSymbol;
+}
+inline void ServerReflectionRequest::clear_file_containing_symbol() {
+ if (has_file_containing_symbol()) {
+ message_request_.file_containing_symbol_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ clear_has_message_request();
+ }
+}
+inline const ::std::string& ServerReflectionRequest::file_containing_symbol() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+ if (has_file_containing_symbol()) {
+ return message_request_.file_containing_symbol_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+}
+inline void ServerReflectionRequest::set_file_containing_symbol(const ::std::string& value) {
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+ if (!has_file_containing_symbol()) {
+ clear_message_request();
+ set_has_file_containing_symbol();
+ message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+}
+inline void ServerReflectionRequest::set_file_containing_symbol(const char* value) {
+ if (!has_file_containing_symbol()) {
+ clear_message_request();
+ set_has_file_containing_symbol();
+ message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+}
+inline void ServerReflectionRequest::set_file_containing_symbol(const char* value, size_t size) {
+ if (!has_file_containing_symbol()) {
+ clear_message_request();
+ set_has_file_containing_symbol();
+ message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+}
+inline ::std::string* ServerReflectionRequest::mutable_file_containing_symbol() {
+ if (!has_file_containing_symbol()) {
+ clear_message_request();
+ set_has_file_containing_symbol();
+ message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+ return message_request_.file_containing_symbol_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServerReflectionRequest::release_file_containing_symbol() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+ if (has_file_containing_symbol()) {
+ clear_has_message_request();
+ return message_request_.file_containing_symbol_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionRequest::set_allocated_file_containing_symbol(::std::string* file_containing_symbol) {
+ if (!has_file_containing_symbol()) {
+ message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ clear_message_request();
+ if (file_containing_symbol != NULL) {
+ set_has_file_containing_symbol();
+ message_request_.file_containing_symbol_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ file_containing_symbol);
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol)
+}
+
+// optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5;
+inline bool ServerReflectionRequest::has_file_containing_extension() const {
+ return message_request_case() == kFileContainingExtension;
+}
+inline void ServerReflectionRequest::set_has_file_containing_extension() {
+ _oneof_case_[0] = kFileContainingExtension;
+}
+inline void ServerReflectionRequest::clear_file_containing_extension() {
+ if (has_file_containing_extension()) {
+ delete message_request_.file_containing_extension_;
+ clear_has_message_request();
+ }
+}
+inline const ::grpc::reflection::v1alpha::ExtensionRequest& ServerReflectionRequest::file_containing_extension() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension)
+ return has_file_containing_extension()
+ ? *message_request_.file_containing_extension_
+ : ::grpc::reflection::v1alpha::ExtensionRequest::default_instance();
+}
+inline ::grpc::reflection::v1alpha::ExtensionRequest* ServerReflectionRequest::mutable_file_containing_extension() {
+ if (!has_file_containing_extension()) {
+ clear_message_request();
+ set_has_file_containing_extension();
+ message_request_.file_containing_extension_ = new ::grpc::reflection::v1alpha::ExtensionRequest;
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension)
+ return message_request_.file_containing_extension_;
+}
+inline ::grpc::reflection::v1alpha::ExtensionRequest* ServerReflectionRequest::release_file_containing_extension() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension)
+ if (has_file_containing_extension()) {
+ clear_has_message_request();
+ ::grpc::reflection::v1alpha::ExtensionRequest* temp = message_request_.file_containing_extension_;
+ message_request_.file_containing_extension_ = NULL;
+ return temp;
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionRequest::set_allocated_file_containing_extension(::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension) {
+ clear_message_request();
+ if (file_containing_extension) {
+ set_has_file_containing_extension();
+ message_request_.file_containing_extension_ = file_containing_extension;
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension)
+}
+
+// optional string all_extension_numbers_of_type = 6;
+inline bool ServerReflectionRequest::has_all_extension_numbers_of_type() const {
+ return message_request_case() == kAllExtensionNumbersOfType;
+}
+inline void ServerReflectionRequest::set_has_all_extension_numbers_of_type() {
+ _oneof_case_[0] = kAllExtensionNumbersOfType;
+}
+inline void ServerReflectionRequest::clear_all_extension_numbers_of_type() {
+ if (has_all_extension_numbers_of_type()) {
+ message_request_.all_extension_numbers_of_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ clear_has_message_request();
+ }
+}
+inline const ::std::string& ServerReflectionRequest::all_extension_numbers_of_type() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+ if (has_all_extension_numbers_of_type()) {
+ return message_request_.all_extension_numbers_of_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+}
+inline void ServerReflectionRequest::set_all_extension_numbers_of_type(const ::std::string& value) {
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+ if (!has_all_extension_numbers_of_type()) {
+ clear_message_request();
+ set_has_all_extension_numbers_of_type();
+ message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+}
+inline void ServerReflectionRequest::set_all_extension_numbers_of_type(const char* value) {
+ if (!has_all_extension_numbers_of_type()) {
+ clear_message_request();
+ set_has_all_extension_numbers_of_type();
+ message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+}
+inline void ServerReflectionRequest::set_all_extension_numbers_of_type(const char* value, size_t size) {
+ if (!has_all_extension_numbers_of_type()) {
+ clear_message_request();
+ set_has_all_extension_numbers_of_type();
+ message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+}
+inline ::std::string* ServerReflectionRequest::mutable_all_extension_numbers_of_type() {
+ if (!has_all_extension_numbers_of_type()) {
+ clear_message_request();
+ set_has_all_extension_numbers_of_type();
+ message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+ return message_request_.all_extension_numbers_of_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServerReflectionRequest::release_all_extension_numbers_of_type() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+ if (has_all_extension_numbers_of_type()) {
+ clear_has_message_request();
+ return message_request_.all_extension_numbers_of_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionRequest::set_allocated_all_extension_numbers_of_type(::std::string* all_extension_numbers_of_type) {
+ if (!has_all_extension_numbers_of_type()) {
+ message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ clear_message_request();
+ if (all_extension_numbers_of_type != NULL) {
+ set_has_all_extension_numbers_of_type();
+ message_request_.all_extension_numbers_of_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ all_extension_numbers_of_type);
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type)
+}
+
+// optional string list_services = 7;
+inline bool ServerReflectionRequest::has_list_services() const {
+ return message_request_case() == kListServices;
+}
+inline void ServerReflectionRequest::set_has_list_services() {
+ _oneof_case_[0] = kListServices;
+}
+inline void ServerReflectionRequest::clear_list_services() {
+ if (has_list_services()) {
+ message_request_.list_services_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ clear_has_message_request();
+ }
+}
+inline const ::std::string& ServerReflectionRequest::list_services() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+ if (has_list_services()) {
+ return message_request_.list_services_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ return *&::google::protobuf::internal::GetEmptyStringAlreadyInited();
+}
+inline void ServerReflectionRequest::set_list_services(const ::std::string& value) {
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+ if (!has_list_services()) {
+ clear_message_request();
+ set_has_list_services();
+ message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+}
+inline void ServerReflectionRequest::set_list_services(const char* value) {
+ if (!has_list_services()) {
+ clear_message_request();
+ set_has_list_services();
+ message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+}
+inline void ServerReflectionRequest::set_list_services(const char* value, size_t size) {
+ if (!has_list_services()) {
+ clear_message_request();
+ set_has_list_services();
+ message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
+ reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+}
+inline ::std::string* ServerReflectionRequest::mutable_list_services() {
+ if (!has_list_services()) {
+ clear_message_request();
+ set_has_list_services();
+ message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+ return message_request_.list_services_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServerReflectionRequest::release_list_services() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+ if (has_list_services()) {
+ clear_has_message_request();
+ return message_request_.list_services_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionRequest::set_allocated_list_services(::std::string* list_services) {
+ if (!has_list_services()) {
+ message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ }
+ clear_message_request();
+ if (list_services != NULL) {
+ set_has_list_services();
+ message_request_.list_services_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ list_services);
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.list_services)
+}
+
+inline bool ServerReflectionRequest::has_message_request() const {
+ return message_request_case() != MESSAGE_REQUEST_NOT_SET;
+}
+inline void ServerReflectionRequest::clear_has_message_request() {
+ _oneof_case_[0] = MESSAGE_REQUEST_NOT_SET;
+}
+inline ServerReflectionRequest::MessageRequestCase ServerReflectionRequest::message_request_case() const {
+ return ServerReflectionRequest::MessageRequestCase(_oneof_case_[0]);
+}
+// -------------------------------------------------------------------
+
+// ExtensionRequest
+
+// optional string containing_type = 1;
+inline void ExtensionRequest::clear_containing_type() {
+ containing_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& ExtensionRequest::containing_type() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+ return containing_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ExtensionRequest::set_containing_type(const ::std::string& value) {
+
+ containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+}
+inline void ExtensionRequest::set_containing_type(const char* value) {
+
+ containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+}
+inline void ExtensionRequest::set_containing_type(const char* value, size_t size) {
+
+ containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+}
+inline ::std::string* ExtensionRequest::mutable_containing_type() {
+
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+ return containing_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ExtensionRequest::release_containing_type() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+
+ return containing_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ExtensionRequest::set_allocated_containing_type(::std::string* containing_type) {
+ if (containing_type != NULL) {
+
+ } else {
+
+ }
+ containing_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), containing_type);
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ExtensionRequest.containing_type)
+}
+
+// optional int32 extension_number = 2;
+inline void ExtensionRequest::clear_extension_number() {
+ extension_number_ = 0;
+}
+inline ::google::protobuf::int32 ExtensionRequest::extension_number() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionRequest.extension_number)
+ return extension_number_;
+}
+inline void ExtensionRequest::set_extension_number(::google::protobuf::int32 value) {
+
+ extension_number_ = value;
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionRequest.extension_number)
+}
+
+// -------------------------------------------------------------------
+
+// ServerReflectionResponse
+
+// optional string valid_host = 1;
+inline void ServerReflectionResponse::clear_valid_host() {
+ valid_host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& ServerReflectionResponse::valid_host() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+ return valid_host_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ServerReflectionResponse::set_valid_host(const ::std::string& value) {
+
+ valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+}
+inline void ServerReflectionResponse::set_valid_host(const char* value) {
+
+ valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+}
+inline void ServerReflectionResponse::set_valid_host(const char* value, size_t size) {
+
+ valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+}
+inline ::std::string* ServerReflectionResponse::mutable_valid_host() {
+
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+ return valid_host_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServerReflectionResponse::release_valid_host() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+
+ return valid_host_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ServerReflectionResponse::set_allocated_valid_host(::std::string* valid_host) {
+ if (valid_host != NULL) {
+
+ } else {
+
+ }
+ valid_host_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), valid_host);
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host)
+}
+
+// optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2;
+inline bool ServerReflectionResponse::has_original_request() const {
+ return !_is_default_instance_ && original_request_ != NULL;
+}
+inline void ServerReflectionResponse::clear_original_request() {
+ if (GetArenaNoVirtual() == NULL && original_request_ != NULL) delete original_request_;
+ original_request_ = NULL;
+}
+inline const ::grpc::reflection::v1alpha::ServerReflectionRequest& ServerReflectionResponse::original_request() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.original_request)
+ return original_request_ != NULL ? *original_request_ : *default_instance_->original_request_;
+}
+inline ::grpc::reflection::v1alpha::ServerReflectionRequest* ServerReflectionResponse::mutable_original_request() {
+
+ if (original_request_ == NULL) {
+ original_request_ = new ::grpc::reflection::v1alpha::ServerReflectionRequest;
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.original_request)
+ return original_request_;
+}
+inline ::grpc::reflection::v1alpha::ServerReflectionRequest* ServerReflectionResponse::release_original_request() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.original_request)
+
+ ::grpc::reflection::v1alpha::ServerReflectionRequest* temp = original_request_;
+ original_request_ = NULL;
+ return temp;
+}
+inline void ServerReflectionResponse::set_allocated_original_request(::grpc::reflection::v1alpha::ServerReflectionRequest* original_request) {
+ delete original_request_;
+ original_request_ = original_request;
+ if (original_request) {
+
+ } else {
+
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.original_request)
+}
+
+// optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4;
+inline bool ServerReflectionResponse::has_file_descriptor_response() const {
+ return message_response_case() == kFileDescriptorResponse;
+}
+inline void ServerReflectionResponse::set_has_file_descriptor_response() {
+ _oneof_case_[0] = kFileDescriptorResponse;
+}
+inline void ServerReflectionResponse::clear_file_descriptor_response() {
+ if (has_file_descriptor_response()) {
+ delete message_response_.file_descriptor_response_;
+ clear_has_message_response();
+ }
+}
+inline const ::grpc::reflection::v1alpha::FileDescriptorResponse& ServerReflectionResponse::file_descriptor_response() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response)
+ return has_file_descriptor_response()
+ ? *message_response_.file_descriptor_response_
+ : ::grpc::reflection::v1alpha::FileDescriptorResponse::default_instance();
+}
+inline ::grpc::reflection::v1alpha::FileDescriptorResponse* ServerReflectionResponse::mutable_file_descriptor_response() {
+ if (!has_file_descriptor_response()) {
+ clear_message_response();
+ set_has_file_descriptor_response();
+ message_response_.file_descriptor_response_ = new ::grpc::reflection::v1alpha::FileDescriptorResponse;
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response)
+ return message_response_.file_descriptor_response_;
+}
+inline ::grpc::reflection::v1alpha::FileDescriptorResponse* ServerReflectionResponse::release_file_descriptor_response() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response)
+ if (has_file_descriptor_response()) {
+ clear_has_message_response();
+ ::grpc::reflection::v1alpha::FileDescriptorResponse* temp = message_response_.file_descriptor_response_;
+ message_response_.file_descriptor_response_ = NULL;
+ return temp;
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionResponse::set_allocated_file_descriptor_response(::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response) {
+ clear_message_response();
+ if (file_descriptor_response) {
+ set_has_file_descriptor_response();
+ message_response_.file_descriptor_response_ = file_descriptor_response;
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response)
+}
+
+// optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5;
+inline bool ServerReflectionResponse::has_all_extension_numbers_response() const {
+ return message_response_case() == kAllExtensionNumbersResponse;
+}
+inline void ServerReflectionResponse::set_has_all_extension_numbers_response() {
+ _oneof_case_[0] = kAllExtensionNumbersResponse;
+}
+inline void ServerReflectionResponse::clear_all_extension_numbers_response() {
+ if (has_all_extension_numbers_response()) {
+ delete message_response_.all_extension_numbers_response_;
+ clear_has_message_response();
+ }
+}
+inline const ::grpc::reflection::v1alpha::ExtensionNumberResponse& ServerReflectionResponse::all_extension_numbers_response() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response)
+ return has_all_extension_numbers_response()
+ ? *message_response_.all_extension_numbers_response_
+ : ::grpc::reflection::v1alpha::ExtensionNumberResponse::default_instance();
+}
+inline ::grpc::reflection::v1alpha::ExtensionNumberResponse* ServerReflectionResponse::mutable_all_extension_numbers_response() {
+ if (!has_all_extension_numbers_response()) {
+ clear_message_response();
+ set_has_all_extension_numbers_response();
+ message_response_.all_extension_numbers_response_ = new ::grpc::reflection::v1alpha::ExtensionNumberResponse;
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response)
+ return message_response_.all_extension_numbers_response_;
+}
+inline ::grpc::reflection::v1alpha::ExtensionNumberResponse* ServerReflectionResponse::release_all_extension_numbers_response() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response)
+ if (has_all_extension_numbers_response()) {
+ clear_has_message_response();
+ ::grpc::reflection::v1alpha::ExtensionNumberResponse* temp = message_response_.all_extension_numbers_response_;
+ message_response_.all_extension_numbers_response_ = NULL;
+ return temp;
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionResponse::set_allocated_all_extension_numbers_response(::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response) {
+ clear_message_response();
+ if (all_extension_numbers_response) {
+ set_has_all_extension_numbers_response();
+ message_response_.all_extension_numbers_response_ = all_extension_numbers_response;
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response)
+}
+
+// optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6;
+inline bool ServerReflectionResponse::has_list_services_response() const {
+ return message_response_case() == kListServicesResponse;
+}
+inline void ServerReflectionResponse::set_has_list_services_response() {
+ _oneof_case_[0] = kListServicesResponse;
+}
+inline void ServerReflectionResponse::clear_list_services_response() {
+ if (has_list_services_response()) {
+ delete message_response_.list_services_response_;
+ clear_has_message_response();
+ }
+}
+inline const ::grpc::reflection::v1alpha::ListServiceResponse& ServerReflectionResponse::list_services_response() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response)
+ return has_list_services_response()
+ ? *message_response_.list_services_response_
+ : ::grpc::reflection::v1alpha::ListServiceResponse::default_instance();
+}
+inline ::grpc::reflection::v1alpha::ListServiceResponse* ServerReflectionResponse::mutable_list_services_response() {
+ if (!has_list_services_response()) {
+ clear_message_response();
+ set_has_list_services_response();
+ message_response_.list_services_response_ = new ::grpc::reflection::v1alpha::ListServiceResponse;
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response)
+ return message_response_.list_services_response_;
+}
+inline ::grpc::reflection::v1alpha::ListServiceResponse* ServerReflectionResponse::release_list_services_response() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response)
+ if (has_list_services_response()) {
+ clear_has_message_response();
+ ::grpc::reflection::v1alpha::ListServiceResponse* temp = message_response_.list_services_response_;
+ message_response_.list_services_response_ = NULL;
+ return temp;
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionResponse::set_allocated_list_services_response(::grpc::reflection::v1alpha::ListServiceResponse* list_services_response) {
+ clear_message_response();
+ if (list_services_response) {
+ set_has_list_services_response();
+ message_response_.list_services_response_ = list_services_response;
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response)
+}
+
+// optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7;
+inline bool ServerReflectionResponse::has_error_response() const {
+ return message_response_case() == kErrorResponse;
+}
+inline void ServerReflectionResponse::set_has_error_response() {
+ _oneof_case_[0] = kErrorResponse;
+}
+inline void ServerReflectionResponse::clear_error_response() {
+ if (has_error_response()) {
+ delete message_response_.error_response_;
+ clear_has_message_response();
+ }
+}
+inline const ::grpc::reflection::v1alpha::ErrorResponse& ServerReflectionResponse::error_response() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.error_response)
+ return has_error_response()
+ ? *message_response_.error_response_
+ : ::grpc::reflection::v1alpha::ErrorResponse::default_instance();
+}
+inline ::grpc::reflection::v1alpha::ErrorResponse* ServerReflectionResponse::mutable_error_response() {
+ if (!has_error_response()) {
+ clear_message_response();
+ set_has_error_response();
+ message_response_.error_response_ = new ::grpc::reflection::v1alpha::ErrorResponse;
+ }
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.error_response)
+ return message_response_.error_response_;
+}
+inline ::grpc::reflection::v1alpha::ErrorResponse* ServerReflectionResponse::release_error_response() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.error_response)
+ if (has_error_response()) {
+ clear_has_message_response();
+ ::grpc::reflection::v1alpha::ErrorResponse* temp = message_response_.error_response_;
+ message_response_.error_response_ = NULL;
+ return temp;
+ } else {
+ return NULL;
+ }
+}
+inline void ServerReflectionResponse::set_allocated_error_response(::grpc::reflection::v1alpha::ErrorResponse* error_response) {
+ clear_message_response();
+ if (error_response) {
+ set_has_error_response();
+ message_response_.error_response_ = error_response;
+ }
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.error_response)
+}
+
+inline bool ServerReflectionResponse::has_message_response() const {
+ return message_response_case() != MESSAGE_RESPONSE_NOT_SET;
+}
+inline void ServerReflectionResponse::clear_has_message_response() {
+ _oneof_case_[0] = MESSAGE_RESPONSE_NOT_SET;
+}
+inline ServerReflectionResponse::MessageResponseCase ServerReflectionResponse::message_response_case() const {
+ return ServerReflectionResponse::MessageResponseCase(_oneof_case_[0]);
+}
+// -------------------------------------------------------------------
+
+// FileDescriptorResponse
+
+// repeated bytes file_descriptor_proto = 1;
+inline int FileDescriptorResponse::file_descriptor_proto_size() const {
+ return file_descriptor_proto_.size();
+}
+inline void FileDescriptorResponse::clear_file_descriptor_proto() {
+ file_descriptor_proto_.Clear();
+}
+inline const ::std::string& FileDescriptorResponse::file_descriptor_proto(int index) const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+ return file_descriptor_proto_.Get(index);
+}
+inline ::std::string* FileDescriptorResponse::mutable_file_descriptor_proto(int index) {
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+ return file_descriptor_proto_.Mutable(index);
+}
+inline void FileDescriptorResponse::set_file_descriptor_proto(int index, const ::std::string& value) {
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+ file_descriptor_proto_.Mutable(index)->assign(value);
+}
+inline void FileDescriptorResponse::set_file_descriptor_proto(int index, const char* value) {
+ file_descriptor_proto_.Mutable(index)->assign(value);
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+}
+inline void FileDescriptorResponse::set_file_descriptor_proto(int index, const void* value, size_t size) {
+ file_descriptor_proto_.Mutable(index)->assign(
+ reinterpret_cast<const char*>(value), size);
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+}
+inline ::std::string* FileDescriptorResponse::add_file_descriptor_proto() {
+ // @@protoc_insertion_point(field_add_mutable:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+ return file_descriptor_proto_.Add();
+}
+inline void FileDescriptorResponse::add_file_descriptor_proto(const ::std::string& value) {
+ file_descriptor_proto_.Add()->assign(value);
+ // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+}
+inline void FileDescriptorResponse::add_file_descriptor_proto(const char* value) {
+ file_descriptor_proto_.Add()->assign(value);
+ // @@protoc_insertion_point(field_add_char:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+}
+inline void FileDescriptorResponse::add_file_descriptor_proto(const void* value, size_t size) {
+ file_descriptor_proto_.Add()->assign(reinterpret_cast<const char*>(value), size);
+ // @@protoc_insertion_point(field_add_pointer:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+}
+inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+FileDescriptorResponse::file_descriptor_proto() const {
+ // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+ return file_descriptor_proto_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+FileDescriptorResponse::mutable_file_descriptor_proto() {
+ // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto)
+ return &file_descriptor_proto_;
+}
+
+// -------------------------------------------------------------------
+
+// ExtensionNumberResponse
+
+// optional string base_type_name = 1;
+inline void ExtensionNumberResponse::clear_base_type_name() {
+ base_type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& ExtensionNumberResponse::base_type_name() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+ return base_type_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ExtensionNumberResponse::set_base_type_name(const ::std::string& value) {
+
+ base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+}
+inline void ExtensionNumberResponse::set_base_type_name(const char* value) {
+
+ base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+}
+inline void ExtensionNumberResponse::set_base_type_name(const char* value, size_t size) {
+
+ base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+}
+inline ::std::string* ExtensionNumberResponse::mutable_base_type_name() {
+
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+ return base_type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ExtensionNumberResponse::release_base_type_name() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+
+ return base_type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ExtensionNumberResponse::set_allocated_base_type_name(::std::string* base_type_name) {
+ if (base_type_name != NULL) {
+
+ } else {
+
+ }
+ base_type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), base_type_name);
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name)
+}
+
+// repeated int32 extension_number = 2;
+inline int ExtensionNumberResponse::extension_number_size() const {
+ return extension_number_.size();
+}
+inline void ExtensionNumberResponse::clear_extension_number() {
+ extension_number_.Clear();
+}
+inline ::google::protobuf::int32 ExtensionNumberResponse::extension_number(int index) const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number)
+ return extension_number_.Get(index);
+}
+inline void ExtensionNumberResponse::set_extension_number(int index, ::google::protobuf::int32 value) {
+ extension_number_.Set(index, value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number)
+}
+inline void ExtensionNumberResponse::add_extension_number(::google::protobuf::int32 value) {
+ extension_number_.Add(value);
+ // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+ExtensionNumberResponse::extension_number() const {
+ // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number)
+ return extension_number_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+ExtensionNumberResponse::mutable_extension_number() {
+ // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number)
+ return &extension_number_;
+}
+
+// -------------------------------------------------------------------
+
+// ListServiceResponse
+
+// repeated .grpc.reflection.v1alpha.ServiceResponse service = 1;
+inline int ListServiceResponse::service_size() const {
+ return service_.size();
+}
+inline void ListServiceResponse::clear_service() {
+ service_.Clear();
+}
+inline const ::grpc::reflection::v1alpha::ServiceResponse& ListServiceResponse::service(int index) const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ListServiceResponse.service)
+ return service_.Get(index);
+}
+inline ::grpc::reflection::v1alpha::ServiceResponse* ListServiceResponse::mutable_service(int index) {
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ListServiceResponse.service)
+ return service_.Mutable(index);
+}
+inline ::grpc::reflection::v1alpha::ServiceResponse* ListServiceResponse::add_service() {
+ // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.ListServiceResponse.service)
+ return service_.Add();
+}
+inline ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >*
+ListServiceResponse::mutable_service() {
+ // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.ListServiceResponse.service)
+ return &service_;
+}
+inline const ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >&
+ListServiceResponse::service() const {
+ // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.ListServiceResponse.service)
+ return service_;
+}
+
+// -------------------------------------------------------------------
+
+// ServiceResponse
+
+// optional string name = 1;
+inline void ServiceResponse::clear_name() {
+ name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& ServiceResponse::name() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServiceResponse.name)
+ return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ServiceResponse::set_name(const ::std::string& value) {
+
+ name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServiceResponse.name)
+}
+inline void ServiceResponse::set_name(const char* value) {
+
+ name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServiceResponse.name)
+}
+inline void ServiceResponse::set_name(const char* value, size_t size) {
+
+ name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServiceResponse.name)
+}
+inline ::std::string* ServiceResponse::mutable_name() {
+
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServiceResponse.name)
+ return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ServiceResponse::release_name() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServiceResponse.name)
+
+ return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ServiceResponse::set_allocated_name(::std::string* name) {
+ if (name != NULL) {
+
+ } else {
+
+ }
+ name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServiceResponse.name)
+}
+
+// -------------------------------------------------------------------
+
+// ErrorResponse
+
+// optional int32 error_code = 1;
+inline void ErrorResponse::clear_error_code() {
+ error_code_ = 0;
+}
+inline ::google::protobuf::int32 ErrorResponse::error_code() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ErrorResponse.error_code)
+ return error_code_;
+}
+inline void ErrorResponse::set_error_code(::google::protobuf::int32 value) {
+
+ error_code_ = value;
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ErrorResponse.error_code)
+}
+
+// optional string error_message = 2;
+inline void ErrorResponse::clear_error_message() {
+ error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline const ::std::string& ErrorResponse::error_message() const {
+ // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ErrorResponse.error_message)
+ return error_message_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ErrorResponse::set_error_message(const ::std::string& value) {
+
+ error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+ // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ErrorResponse.error_message)
+}
+inline void ErrorResponse::set_error_message(const char* value) {
+
+ error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+ // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ErrorResponse.error_message)
+}
+inline void ErrorResponse::set_error_message(const char* value, size_t size) {
+
+ error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+ ::std::string(reinterpret_cast<const char*>(value), size));
+ // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ErrorResponse.error_message)
+}
+inline ::std::string* ErrorResponse::mutable_error_message() {
+
+ // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ErrorResponse.error_message)
+ return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline ::std::string* ErrorResponse::release_error_message() {
+ // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ErrorResponse.error_message)
+
+ return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+}
+inline void ErrorResponse::set_allocated_error_message(::std::string* error_message) {
+ if (error_message != NULL) {
+
+ } else {
+
+ }
+ error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message);
+ // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ErrorResponse.error_message)
+}
+
+#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
+// -------------------------------------------------------------------
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+} // namespace v1alpha
+} // namespace reflection
+} // namespace grpc
+
+// @@protoc_insertion_point(global_scope)
+
+#endif // PROTOBUF_reflection_2eproto__INCLUDED
diff --git a/include/grpc++/grpc++.h b/include/grpc++/grpc++.h
index b7d5fb0bbc..ef07e19975 100644
--- a/include/grpc++/grpc++.h
+++ b/include/grpc++/grpc++.h
@@ -57,8 +57,10 @@
#include <grpc++/client_context.h>
#include <grpc++/completion_queue.h>
#include <grpc++/create_channel.h>
+#include <grpc++/create_channel_posix.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_posix.h>
#endif // GRPCXX_GRPCXX_H
diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h
index a607a47106..e96d224ddb 100644
--- a/include/grpc++/impl/codegen/async_stream.h
+++ b/include/grpc++/impl/codegen/async_stream.h
@@ -52,11 +52,14 @@ class ClientAsyncStreamingInterface {
/// Request notification of the reading of the initial metadata. Completion
/// will be notified by \a tag on the associated completion queue.
+ /// This call is optional, but if it is used, it cannot be used concurrently
+ /// with or after the \a Read method.
///
/// \param[in] tag Tag identifying this request.
virtual void ReadInitialMetadata(void* tag) = 0;
- /// Request notification completion.
+ /// Indicate that the stream is to be finished and request notification
+ /// Should not be used concurrently with other operations
///
/// \param[out] status To be updated with the operation status.
/// \param[in] tag Tag identifying this request.
@@ -71,6 +74,11 @@ class AsyncReaderInterface {
/// Read a message of type \a R into \a msg. Completion will be notified by \a
/// tag on the associated completion queue.
+ /// This is thread-safe with respect to \a Write or \a WritesDone methods. It
+ /// should not be called concurrently with other streaming APIs
+ /// on the same stream. It is not meaningful to call it concurrently
+ /// with another \a Read on the same stream since reads on the same stream
+ /// are delivered in order.
///
/// \param[out] msg Where to eventually store the read message.
/// \param[in] tag The tag identifying the operation.
@@ -88,6 +96,7 @@ class AsyncWriterInterface {
/// Only one write may be outstanding at any given time. This means that
/// after calling Write, one must wait to receive \a tag from the completion
/// queue BEFORE calling Write again.
+ /// This is thread-safe with respect to \a Read
///
/// \param[in] msg The message to be written.
/// \param[in] tag The tag identifying the operation.
@@ -158,6 +167,7 @@ class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface,
public AsyncWriterInterface<W> {
public:
/// Signal the client is done with the writes.
+ /// Thread-safe with respect to \a Read
///
/// \param[in] tag The tag identifying the operation.
virtual void WritesDone(void* tag) = 0;
@@ -172,6 +182,7 @@ class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
R* response, void* tag)
: context_(context), call_(channel->CreateCall(method, context, cq)) {
finish_ops_.RecvMessage(response);
+ finish_ops_.AllowNoMessage();
init_ops_.set_output_tag(tag);
init_ops_.SendInitialMetadata(context->send_initial_metadata_,
@@ -228,6 +239,7 @@ class ClientAsyncReaderWriterInterface : public ClientAsyncStreamingInterface,
public AsyncReaderInterface<R> {
public:
/// Signal the client is done with the writes.
+ /// Thread-safe with respect to \a Read
///
/// \param[in] tag The tag identifying the operation.
virtual void WritesDone(void* tag) = 0;
@@ -298,8 +310,16 @@ class ClientAsyncReaderWriter GRPC_FINAL
};
template <class W, class R>
-class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
- public AsyncReaderInterface<R> {
+class ServerAsyncReaderInterface : public ServerAsyncStreamingInterface,
+ public AsyncReaderInterface<R> {
+ public:
+ virtual void Finish(const W& msg, const Status& status, void* tag) = 0;
+
+ virtual void FinishWithError(const Status& status, void* tag) = 0;
+};
+
+template <class W, class R>
+class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface<W, R> {
public:
explicit ServerAsyncReader(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -320,7 +340,7 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&read_ops_);
}
- void Finish(const W& msg, const Status& status, void* tag) {
+ void Finish(const W& msg, const Status& status, void* tag) GRPC_OVERRIDE {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_,
@@ -337,7 +357,7 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&finish_ops_);
}
- void FinishWithError(const Status& status, void* tag) {
+ void FinishWithError(const Status& status, void* tag) GRPC_OVERRIDE {
GPR_CODEGEN_ASSERT(!status.ok());
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
@@ -362,8 +382,14 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
};
template <class W>
-class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
- public AsyncWriterInterface<W> {
+class ServerAsyncWriterInterface : public ServerAsyncStreamingInterface,
+ public AsyncWriterInterface<W> {
+ public:
+ virtual void Finish(const Status& status, void* tag) = 0;
+};
+
+template <class W>
+class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface<W> {
public:
explicit ServerAsyncWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -390,7 +416,7 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&write_ops_);
}
- void Finish(const Status& status, void* tag) {
+ void Finish(const Status& status, void* tag) GRPC_OVERRIDE {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_,
@@ -413,9 +439,16 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
/// Server-side interface for asynchronous bi-directional streaming.
template <class W, class R>
-class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
- public AsyncWriterInterface<W>,
- public AsyncReaderInterface<R> {
+class ServerAsyncReaderWriterInterface : public ServerAsyncStreamingInterface,
+ public AsyncWriterInterface<W>,
+ public AsyncReaderInterface<R> {
+ public:
+ virtual void Finish(const Status& status, void* tag) = 0;
+};
+
+template <class W, class R>
+class ServerAsyncReaderWriter GRPC_FINAL
+ : public ServerAsyncReaderWriterInterface<W, R> {
public:
explicit ServerAsyncReaderWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -448,7 +481,7 @@ class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&write_ops_);
}
- void Finish(const Status& status, void* tag) {
+ void Finish(const Status& status, void* tag) GRPC_OVERRIDE {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_,
diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h
index 55c9788fbd..05681e2242 100644
--- a/include/grpc++/impl/codegen/async_unary_call.h
+++ b/include/grpc++/impl/codegen/async_unary_call.h
@@ -65,7 +65,7 @@ class ClientAsyncResponseReader GRPC_FINAL
const W& request)
: context_(context),
call_(channel->CreateCall(method, context, cq)),
- collection_(new CallOpSetCollection) {
+ collection_(std::make_shared<CallOpSetCollection>()) {
collection_->init_buf_.SetCollection(collection_);
collection_->init_buf_.SendInitialMetadata(
context->send_initial_metadata_, context->initial_metadata_flags());
@@ -91,6 +91,7 @@ class ClientAsyncResponseReader GRPC_FINAL
collection_->finish_buf_.RecvInitialMetadata(context_);
}
collection_->finish_buf_.RecvMessage(msg);
+ collection_->finish_buf_.AllowNoMessage();
collection_->finish_buf_.ClientRecvStatus(context_, status);
call_.PerformOps(&collection_->finish_buf_);
}
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h
index d457f03fa6..fab85d1517 100644
--- a/include/grpc++/impl/codegen/call.h
+++ b/include/grpc++/impl/codegen/call.h
@@ -47,7 +47,9 @@
#include <grpc++/impl/codegen/serialization_traits.h>
#include <grpc++/impl/codegen/status.h>
#include <grpc++/impl/codegen/string_ref.h>
+
#include <grpc/impl/codegen/alloc.h>
+#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/grpc_types.h>
struct grpc_byte_buffer;
@@ -187,6 +189,8 @@ class CallOpSendInitialMetadata {
flags_ = flags;
initial_metadata_count_ = metadata.size();
initial_metadata_ = FillMetadataArray(metadata);
+ // TODO(dgq): expose compression level in API so it can be properly set.
+ maybe_compression_level_.is_set = false;
}
protected:
@@ -198,6 +202,10 @@ class CallOpSendInitialMetadata {
op->reserved = NULL;
op->data.send_initial_metadata.count = initial_metadata_count_;
op->data.send_initial_metadata.metadata = initial_metadata_;
+ op->data.send_initial_metadata.maybe_compression_level.is_set =
+ maybe_compression_level_.is_set;
+ op->data.send_initial_metadata.maybe_compression_level.level =
+ maybe_compression_level_.level;
}
void FinishOp(bool* status, int max_message_size) {
if (!send_) return;
@@ -209,6 +217,10 @@ class CallOpSendInitialMetadata {
uint32_t flags_;
size_t initial_metadata_count_;
grpc_metadata* initial_metadata_;
+ struct {
+ bool is_set;
+ grpc_compression_level level;
+ } maybe_compression_level_;
};
class CallOpSendMessage {
@@ -261,10 +273,16 @@ Status CallOpSendMessage::SendMessage(const M& message) {
template <class R>
class CallOpRecvMessage {
public:
- CallOpRecvMessage() : got_message(false), message_(nullptr) {}
+ CallOpRecvMessage()
+ : got_message(false),
+ message_(nullptr),
+ allow_not_getting_message_(false) {}
void RecvMessage(R* message) { message_ = message; }
+ // Do not change status if no message is received.
+ void AllowNoMessage() { allow_not_getting_message_ = true; }
+
bool got_message;
protected:
@@ -290,7 +308,9 @@ class CallOpRecvMessage {
}
} else {
got_message = false;
- *status = false;
+ if (!allow_not_getting_message_) {
+ *status = false;
+ }
}
message_ = nullptr;
}
@@ -298,6 +318,7 @@ class CallOpRecvMessage {
private:
R* message_;
grpc_byte_buffer* recv_buf_;
+ bool allow_not_getting_message_;
};
namespace CallOpGenericRecvMessageHelper {
@@ -316,7 +337,7 @@ class DeserializeFuncType GRPC_FINAL : public DeserializeFunc {
return SerializationTraits<R>::Deserialize(buf, message_, max_message_size);
}
- ~DeserializeFuncType() override {}
+ ~DeserializeFuncType() GRPC_OVERRIDE {}
private:
R* message_; // Not a managed pointer because management is external to this
@@ -325,7 +346,8 @@ class DeserializeFuncType GRPC_FINAL : public DeserializeFunc {
class CallOpGenericRecvMessage {
public:
- CallOpGenericRecvMessage() : got_message(false) {}
+ CallOpGenericRecvMessage()
+ : got_message(false), allow_not_getting_message_(false) {}
template <class R>
void RecvMessage(R* message) {
@@ -336,6 +358,9 @@ class CallOpGenericRecvMessage {
deserialize_.reset(func);
}
+ // Do not change status if no message is received.
+ void AllowNoMessage() { allow_not_getting_message_ = true; }
+
bool got_message;
protected:
@@ -360,7 +385,9 @@ class CallOpGenericRecvMessage {
}
} else {
got_message = false;
- *status = false;
+ if (!allow_not_getting_message_) {
+ *status = false;
+ }
}
deserialize_.reset();
}
@@ -368,6 +395,7 @@ class CallOpGenericRecvMessage {
private:
std::unique_ptr<CallOpGenericRecvMessageHelper::DeserializeFunc> deserialize_;
grpc_byte_buffer* recv_buf_;
+ bool allow_not_getting_message_;
};
class CallOpClientSendClose {
diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h
index e23fd4eda3..012bcc2bbe 100644
--- a/include/grpc++/impl/codegen/client_context.h
+++ b/include/grpc++/impl/codegen/client_context.h
@@ -41,7 +41,7 @@
///
/// Context settings are only relevant to the call they are invoked with, that
/// is to say, they aren't sticky. Some of these settings, such as the
-/// compression options, can be made persistant at channel construction time
+/// compression options, can be made persistent at channel construction time
/// (see \a grpc::CreateCustomChannel).
///
/// \warning ClientContext instances should \em not be reused across rpcs.
@@ -193,7 +193,7 @@ class ClientContext {
///
/// \return A multimap of initial metadata key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
- GetServerInitialMetadata() {
+ GetServerInitialMetadata() const {
GPR_CODEGEN_ASSERT(initial_metadata_received_);
return recv_initial_metadata_;
}
@@ -205,7 +205,7 @@ class ClientContext {
///
/// \return A multimap of metadata trailing key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
- GetServerTrailingMetadata() {
+ GetServerTrailingMetadata() const {
// TODO(yangg) check finished
return trailing_metadata_;
}
@@ -230,13 +230,13 @@ class ClientContext {
#ifndef GRPC_CXX0X_NO_CHRONO
/// Return the deadline for the client call.
- std::chrono::system_clock::time_point deadline() {
+ std::chrono::system_clock::time_point deadline() const {
return Timespec2Timepoint(deadline_);
}
#endif // !GRPC_CXX0X_NO_CHRONO
/// Return a \a gpr_timespec representation of the client call's deadline.
- gpr_timespec raw_deadline() { return deadline_; }
+ gpr_timespec raw_deadline() const { return deadline_; }
/// Set the per call authority header (see
/// https://tools.ietf.org/html/rfc7540#section-8.1.2.3).
@@ -337,7 +337,7 @@ class ClientContext {
const InputMessage& request,
OutputMessage* result);
- grpc_call* call() { return call_; }
+ grpc_call* call() const { return call_; }
void set_call(grpc_call* call, const std::shared_ptr<Channel>& channel);
uint32_t initial_metadata_flags() const {
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h
index 1b84b44705..03009e0561 100644
--- a/include/grpc++/impl/codegen/completion_queue.h
+++ b/include/grpc++/impl/codegen/completion_queue.h
@@ -31,8 +31,19 @@
*
*/
-/// A completion queue implements a concurrent producer-consumer queue, with two
-/// main methods, \a Next and \a AsyncNext.
+/// A completion queue implements a concurrent producer-consumer queue, with
+/// two main API-exposed methods: \a Next and \a AsyncNext. These
+/// methods are the essential component of the gRPC C++ asynchronous API.
+/// There is also a \a Shutdown method to indicate that a given completion queue
+/// will no longer have regular events. This must be called before the
+/// completion queue is destroyed.
+/// All completion queue APIs are thread-safe and may be used concurrently with
+/// any other completion queue API invocation; it is acceptable to have
+/// multiple threads calling \a Next or \a AsyncNext on the same or different
+/// completion queues, or to call these methods concurrently with a \a Shutdown
+/// elsewhere.
+/// \remark{All other API calls on completion queue should be completed before
+/// a completion queue destructor is called.}
#ifndef GRPCXX_IMPL_CODEGEN_COMPLETION_QUEUE_H
#define GRPCXX_IMPL_CODEGEN_COMPLETION_QUEUE_H
diff --git a/include/grpc++/impl/codegen/config.h b/include/grpc++/impl/codegen/config.h
index d782d5f571..0c75438868 100644
--- a/include/grpc++/impl/codegen/config.h
+++ b/include/grpc++/impl/codegen/config.h
@@ -54,6 +54,7 @@
// nullptr was added in gcc 4.6
#if (__GNUC__ * 100 + __GNUC_MINOR__ < 406)
#define GRPC_CXX0X_NO_NULLPTR 1
+#define GRPC_CXX0X_LIMITED_TOSTRING 1
#endif
// final and override were added in gcc 4.7
#if (__GNUC__ * 100 + __GNUC_MINOR__ < 407)
@@ -78,6 +79,7 @@
#endif
#ifdef GRPC_CXX0X_NO_NULLPTR
+#include <functional>
#include <memory>
namespace grpc {
const class {
@@ -95,6 +97,10 @@ const class {
return std::shared_ptr<T>(static_cast<T *>(0));
}
operator bool() const { return false; }
+ template <class F>
+ operator std::function<F>() const {
+ return std::function<F>();
+ }
private:
void operator&() const = delete;
@@ -111,6 +117,17 @@ namespace grpc {
typedef GRPC_CUSTOM_STRING string;
+#ifdef GRPC_CXX0X_LIMITED_TOSTRING
+inline grpc::string to_string(const int x) {
+ return std::to_string(static_cast<const long long int>(x));
+}
+inline grpc::string to_string(const unsigned int x) {
+ return std::to_string(static_cast<const long long unsigned int>(x));
+}
+#else
+using std::to_string;
+#endif
+
} // namespace grpc
#endif // GRPCXX_IMPL_CODEGEN_CONFIG_H
diff --git a/include/grpc++/impl/codegen/config_protobuf.h b/include/grpc++/impl/codegen/config_protobuf.h
index f1b6beaca7..6ab67721e5 100644
--- a/include/grpc++/impl/codegen/config_protobuf.h
+++ b/include/grpc++/impl/codegen/config_protobuf.h
@@ -40,9 +40,27 @@
#endif
#ifndef GRPC_CUSTOM_MESSAGE
+#ifdef GRPC_USE_PROTO_LITE
+#include <google/protobuf/message_lite.h>
+#define GRPC_CUSTOM_MESSAGE ::google::protobuf::MessageLite
+#else
#include <google/protobuf/message.h>
#define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
#endif
+#endif
+
+#ifndef GRPC_CUSTOM_DESCRIPTOR
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/descriptor.pb.h>
+#define GRPC_CUSTOM_DESCRIPTOR ::google::protobuf::Descriptor
+#define GRPC_CUSTOM_DESCRIPTORPOOL ::google::protobuf::DescriptorPool
+#define GRPC_CUSTOM_FIELDDESCRIPTOR ::google::protobuf::FieldDescriptor
+#define GRPC_CUSTOM_FILEDESCRIPTOR ::google::protobuf::FileDescriptor
+#define GRPC_CUSTOM_FILEDESCRIPTORPROTO ::google::protobuf::FileDescriptorProto
+#define GRPC_CUSTOM_METHODDESCRIPTOR ::google::protobuf::MethodDescriptor
+#define GRPC_CUSTOM_SERVICEDESCRIPTOR ::google::protobuf::ServiceDescriptor
+#define GRPC_CUSTOM_SOURCELOCATION ::google::protobuf::SourceLocation
+#endif
#ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
#include <google/protobuf/io/coded_stream.h>
@@ -60,6 +78,15 @@ namespace protobuf {
typedef GRPC_CUSTOM_MESSAGE Message;
typedef GRPC_CUSTOM_PROTOBUF_INT64 int64;
+typedef GRPC_CUSTOM_DESCRIPTOR Descriptor;
+typedef GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool;
+typedef GRPC_CUSTOM_FIELDDESCRIPTOR FieldDescriptor;
+typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor;
+typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto;
+typedef GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor;
+typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor;
+typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation;
+
namespace io {
typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
diff --git a/include/grpc++/impl/codegen/core_codegen.h b/include/grpc++/impl/codegen/core_codegen.h
new file mode 100644
index 0000000000..9699abfb43
--- /dev/null
+++ b/include/grpc++/impl/codegen/core_codegen.h
@@ -0,0 +1,85 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+// This file should be compiled as part of grpc++.
+
+#include <grpc++/impl/codegen/core_codegen_interface.h>
+#include <grpc/byte_buffer.h>
+#include <grpc/impl/codegen/grpc_types.h>
+
+namespace grpc {
+
+/// Implementation of the core codegen interface.
+class CoreCodegen : public CoreCodegenInterface {
+ private:
+ grpc_completion_queue* grpc_completion_queue_create(void* reserved)
+ GRPC_OVERRIDE;
+ void grpc_completion_queue_destroy(grpc_completion_queue* cq) GRPC_OVERRIDE;
+ grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag,
+ gpr_timespec deadline,
+ void* reserved) GRPC_OVERRIDE;
+
+ void* gpr_malloc(size_t size) GRPC_OVERRIDE;
+ void gpr_free(void* p) GRPC_OVERRIDE;
+
+ void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) GRPC_OVERRIDE;
+
+ int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
+ grpc_byte_buffer* buffer) GRPC_OVERRIDE;
+ void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader* reader)
+ GRPC_OVERRIDE;
+ int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
+ gpr_slice* slice) GRPC_OVERRIDE;
+
+ grpc_byte_buffer* grpc_raw_byte_buffer_create(gpr_slice* slice,
+ size_t nslices) GRPC_OVERRIDE;
+
+ gpr_slice gpr_slice_malloc(size_t length) GRPC_OVERRIDE;
+ void gpr_slice_unref(gpr_slice slice) GRPC_OVERRIDE;
+ gpr_slice gpr_slice_split_tail(gpr_slice* s, size_t split) GRPC_OVERRIDE;
+ void gpr_slice_buffer_add(gpr_slice_buffer* sb,
+ gpr_slice slice) GRPC_OVERRIDE;
+ void gpr_slice_buffer_pop(gpr_slice_buffer* sb) GRPC_OVERRIDE;
+
+ void grpc_metadata_array_init(grpc_metadata_array* array) GRPC_OVERRIDE;
+ void grpc_metadata_array_destroy(grpc_metadata_array* array) GRPC_OVERRIDE;
+
+ gpr_timespec gpr_inf_future(gpr_clock_type type) GRPC_OVERRIDE;
+
+ virtual const Status& ok() GRPC_OVERRIDE;
+ virtual const Status& cancelled() GRPC_OVERRIDE;
+
+ void assert_fail(const char* failed_assertion) GRPC_OVERRIDE;
+};
+
+} // namespace grpc
diff --git a/include/grpc++/impl/codegen/core_codegen_interface.h b/include/grpc++/impl/codegen/core_codegen_interface.h
index aa9013c4ce..f9a8f9b980 100644
--- a/include/grpc++/impl/codegen/core_codegen_interface.h
+++ b/include/grpc++/impl/codegen/core_codegen_interface.h
@@ -34,7 +34,7 @@
#ifndef GRPCXX_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
#define GRPCXX_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
-#include <grpc++/impl/codegen/config_protobuf.h>
+#include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/status.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -65,8 +65,9 @@ class CoreCodegenInterface {
virtual void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) = 0;
- virtual void grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
- grpc_byte_buffer* buffer) = 0;
+ virtual int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
+ grpc_byte_buffer* buffer)
+ GRPC_MUST_USE_RESULT = 0;
virtual void grpc_byte_buffer_reader_destroy(
grpc_byte_buffer_reader* reader) = 0;
virtual int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader* reader,
diff --git a/include/grpc++/impl/codegen/impl/async_stream.h b/include/grpc++/impl/codegen/impl/async_stream.h
index 8f99e7eea4..7d7a956807 100644
--- a/include/grpc++/impl/codegen/impl/async_stream.h
+++ b/include/grpc++/impl/codegen/impl/async_stream.h
@@ -295,8 +295,16 @@ class ClientAsyncReaderWriter GRPC_FINAL
};
template <class W, class R>
-class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
- public AsyncReaderInterface<R> {
+class ServerAsyncReaderInterface : public ServerAsyncStreamingInterface,
+ public AsyncReaderInterface<R> {
+ public:
+ virtual void Finish(const W& msg, const Status& status, void* tag) = 0;
+
+ virtual void FinishWithError(const Status& status, void* tag) = 0;
+};
+
+template <class W, class R>
+class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface<W, R> {
public:
explicit ServerAsyncReader(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -316,7 +324,7 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&read_ops_);
}
- void Finish(const W& msg, const Status& status, void* tag) {
+ void Finish(const W& msg, const Status& status, void* tag) GRPC_OVERRIDE {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
@@ -332,7 +340,7 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&finish_ops_);
}
- void FinishWithError(const Status& status, void* tag) {
+ void FinishWithError(const Status& status, void* tag) GRPC_OVERRIDE {
GPR_CODEGEN_ASSERT(!status.ok());
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
@@ -356,8 +364,14 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
};
template <class W>
-class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
- public AsyncWriterInterface<W> {
+class ServerAsyncWriterInterface : public ServerAsyncStreamingInterface,
+ public AsyncWriterInterface<W> {
+ public:
+ virtual void Finish(const Status& status, void* tag) = 0;
+};
+
+template <class W>
+class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface<W> {
public:
explicit ServerAsyncWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -382,7 +396,7 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&write_ops_);
}
- void Finish(const Status& status, void* tag) {
+ void Finish(const Status& status, void* tag) GRPC_OVERRIDE {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
@@ -404,9 +418,16 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
/// Server-side interface for asynchronous bi-directional streaming.
template <class W, class R>
-class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
- public AsyncWriterInterface<W>,
- public AsyncReaderInterface<R> {
+class ServerAsyncReaderWriterInterface : public ServerAsyncStreamingInterface,
+ public AsyncWriterInterface<W>,
+ public AsyncReaderInterface<R> {
+ public:
+ virtual void Finish(const Status& status, void* tag) = 0;
+};
+
+template <class W, class R>
+class ServerAsyncReaderWriter GRPC_FINAL
+ : public ServerAsyncReaderWriterInterface<W, R> {
public:
explicit ServerAsyncReaderWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@@ -437,7 +458,7 @@ class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
call_.PerformOps(&write_ops_);
}
- void Finish(const Status& status, void* tag) {
+ void Finish(const Status& status, void* tag) GRPC_OVERRIDE {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
diff --git a/include/grpc++/impl/codegen/impl/status_code_enum.h b/include/grpc++/impl/codegen/impl/status_code_enum.h
deleted file mode 100644
index f8caec0c11..0000000000
--- a/include/grpc++/impl/codegen/impl/status_code_enum.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *
- * Copyright 2016, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef GRPCXX_IMPL_CODEGEN_IMPL_STATUS_CODE_ENUM_H
-#define GRPCXX_IMPL_CODEGEN_IMPL_STATUS_CODE_ENUM_H
-
-namespace grpc {
-
-enum StatusCode {
- /// Not an error; returned on success.
- OK = 0,
-
- /// The operation was cancelled (typically by the caller).
- CANCELLED = 1,
-
- /// Unknown error. An example of where this error may be returned is if a
- /// Status value received from another address space belongs to an error-space
- /// that is not known in this address space. Also errors raised by APIs that
- /// do not return enough error information may be converted to this error.
- UNKNOWN = 2,
-
- /// Client specified an invalid argument. Note that this differs from
- /// FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are
- /// problematic regardless of the state of the system (e.g., a malformed file
- /// name).
- INVALID_ARGUMENT = 3,
-
- /// Deadline expired before operation could complete. For operations that
- /// change the state of the system, this error may be returned even if the
- /// operation has completed successfully. For example, a successful response
- /// from a server could have been delayed long enough for the deadline to
- /// expire.
- DEADLINE_EXCEEDED = 4,
-
- /// Some requested entity (e.g., file or directory) was not found.
- NOT_FOUND = 5,
-
- /// Some entity that we attempted to create (e.g., file or directory) already
- /// exists.
- ALREADY_EXISTS = 6,
-
- /// The caller does not have permission to execute the specified operation.
- /// PERMISSION_DENIED must not be used for rejections caused by exhausting
- /// some resource (use RESOURCE_EXHAUSTED instead for those errors).
- /// PERMISSION_DENIED must not be used if the caller can not be identified
- /// (use UNAUTHENTICATED instead for those errors).
- PERMISSION_DENIED = 7,
-
- /// The request does not have valid authentication credentials for the
- /// operation.
- UNAUTHENTICATED = 16,
-
- /// Some resource has been exhausted, perhaps a per-user quota, or perhaps the
- /// entire file system is out of space.
- RESOURCE_EXHAUSTED = 8,
-
- /// Operation was rejected because the system is not in a state required for
- /// the operation's execution. For example, directory to be deleted may be
- /// non-empty, an rmdir operation is applied to a non-directory, etc.
- ///
- /// A litmus test that may help a service implementor in deciding
- /// between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
- /// (a) Use UNAVAILABLE if the client can retry just the failing call.
- /// (b) Use ABORTED if the client should retry at a higher-level
- /// (e.g., restarting a read-modify-write sequence).
- /// (c) Use FAILED_PRECONDITION if the client should not retry until
- /// the system state has been explicitly fixed. E.g., if an "rmdir"
- /// fails because the directory is non-empty, FAILED_PRECONDITION
- /// should be returned since the client should not retry unless
- /// they have first fixed up the directory by deleting files from it.
- /// (d) Use FAILED_PRECONDITION if the client performs conditional
- /// REST Get/Update/Delete on a resource and the resource on the
- /// server does not match the condition. E.g., conflicting
- /// read-modify-write on the same resource.
- FAILED_PRECONDITION = 9,
-
- /// The operation was aborted, typically due to a concurrency issue like
- /// sequencer check failures, transaction aborts, etc.
- ///
- /// See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
- /// and UNAVAILABLE.
- ABORTED = 10,
-
- /// Operation was attempted past the valid range. E.g., seeking or reading
- /// past end of file.
- ///
- /// Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed
- /// if the system state changes. For example, a 32-bit file system will
- /// generate INVALID_ARGUMENT if asked to read at an offset that is not in the
- /// range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from
- /// an offset past the current file size.
- ///
- /// There is a fair bit of overlap between FAILED_PRECONDITION and
- /// OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)
- /// when it applies so that callers who are iterating through a space can
- /// easily look for an OUT_OF_RANGE error to detect when they are done.
- OUT_OF_RANGE = 11,
-
- /// Operation is not implemented or not supported/enabled in this service.
- UNIMPLEMENTED = 12,
-
- /// Internal errors. Means some invariants expected by underlying System has
- /// been broken. If you see one of these errors, Something is very broken.
- INTERNAL = 13,
-
- /// The service is currently unavailable. This is a most likely a transient
- /// condition and may be corrected by retrying with a backoff.
- ///
- /// See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
- /// and UNAVAILABLE.
- UNAVAILABLE = 14,
-
- /// Unrecoverable data loss or corruption.
- DATA_LOSS = 15,
-
- /// Force users to include a default branch:
- DO_NOT_USE = -1
-};
-
-} // namespace grpc
-
-#endif // GRPCXX_IMPL_CODEGEN_IMPL_STATUS_CODE_ENUM_H
diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h
index 3bad468a74..d4599c5fff 100644
--- a/include/grpc++/impl/codegen/proto_utils.h
+++ b/include/grpc++/impl/codegen/proto_utils.h
@@ -111,14 +111,21 @@ class GrpcBufferReader GRPC_FINAL
: public ::grpc::protobuf::io::ZeroCopyInputStream {
public:
explicit GrpcBufferReader(grpc_byte_buffer* buffer)
- : byte_count_(0), backup_count_(0) {
- g_core_codegen_interface->grpc_byte_buffer_reader_init(&reader_, buffer);
+ : byte_count_(0), backup_count_(0), status_() {
+ if (!g_core_codegen_interface->grpc_byte_buffer_reader_init(&reader_,
+ buffer)) {
+ status_ = Status(StatusCode::INTERNAL,
+ "Couldn't initialize byte buffer reader");
+ }
}
~GrpcBufferReader() GRPC_OVERRIDE {
g_core_codegen_interface->grpc_byte_buffer_reader_destroy(&reader_);
}
bool Next(const void** data, int* size) GRPC_OVERRIDE {
+ if (!status_.ok()) {
+ return false;
+ }
if (backup_count_ > 0) {
*data = GPR_SLICE_START_PTR(slice_) + GPR_SLICE_LENGTH(slice_) -
backup_count_;
@@ -139,6 +146,8 @@ class GrpcBufferReader GRPC_FINAL
return true;
}
+ Status status() const { return status_; }
+
void BackUp(int count) GRPC_OVERRIDE { backup_count_ = count; }
bool Skip(int count) GRPC_OVERRIDE {
@@ -165,6 +174,7 @@ class GrpcBufferReader GRPC_FINAL
int64_t backup_count_;
grpc_byte_buffer_reader reader_;
gpr_slice slice_;
+ Status status_;
};
} // namespace internal
@@ -202,6 +212,9 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of<
Status result = g_core_codegen_interface->ok();
{
internal::GrpcBufferReader reader(buffer);
+ if (!reader.status().ok()) {
+ return reader.status();
+ }
::grpc::protobuf::io::CodedInputStream decoder(&reader);
if (max_message_size > 0) {
decoder.SetTotalBytesLimit(max_message_size, max_message_size);
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h
index a1e1ed176f..cea13a513f 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -94,12 +94,12 @@ class ServerContext {
~ServerContext();
#ifndef GRPC_CXX0X_NO_CHRONO
- std::chrono::system_clock::time_point deadline() {
+ std::chrono::system_clock::time_point deadline() const {
return Timespec2Timepoint(deadline_);
}
#endif // !GRPC_CXX0X_NO_CHRONO
- gpr_timespec raw_deadline() { return deadline_; }
+ gpr_timespec raw_deadline() const { return deadline_; }
void AddInitialMetadata(const grpc::string& key, const grpc::string& value);
void AddTrailingMetadata(const grpc::string& key, const grpc::string& value);
@@ -122,7 +122,8 @@ class ServerContext {
// was called.
void TryCancel() const;
- const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata() {
+ const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata()
+ const {
return client_metadata_;
}
diff --git a/include/grpc++/impl/codegen/server_interface.h b/include/grpc++/impl/codegen/server_interface.h
index 7b7d5aa90b..3a3e052d9e 100644
--- a/include/grpc++/impl/codegen/server_interface.h
+++ b/include/grpc++/impl/codegen/server_interface.h
@@ -62,6 +62,10 @@ class ServerInterface : public CallHook {
/// Shutdown the server, blocking until all rpc processing finishes.
/// Forcefully terminate pending calls after \a deadline expires.
///
+ /// All completion queue associated with the server (for example, for async
+ /// serving) must be shutdown *after* this method has returned:
+ /// See \a ServerBuilder::AddCompletionQueue for details.
+ ///
/// \param deadline How long to wait until pending rpcs are forcefully
/// terminated.
template <class T>
@@ -70,6 +74,10 @@ class ServerInterface : public CallHook {
}
/// Shutdown the server, waiting for all rpc processing to finish.
+ ///
+ /// All completion queue associated with the server (for example, for async
+ /// serving) must be shutdown *after* this method has returned:
+ /// See \a ServerBuilder::AddCompletionQueue for details.
void Shutdown() { ShutdownInternal(gpr_inf_future(GPR_CLOCK_MONOTONIC)); }
/// Block waiting for all work to complete.
diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h
index 9100ce09a2..cbfa410699 100644
--- a/include/grpc++/impl/codegen/sync_stream.h
+++ b/include/grpc++/impl/codegen/sync_stream.h
@@ -71,6 +71,9 @@ class ReaderInterface {
virtual ~ReaderInterface() {}
/// Blocking read a message and parse to \a msg. Returns \a true on success.
+ /// This is thread-safe with respect to \a Write or \WritesDone methods on
+ /// the same stream. It should not be called concurrently with another \a
+ /// Read on the same stream as the order of delivery will not be defined.
///
/// \param[out] msg The read message.
///
@@ -87,6 +90,7 @@ class WriterInterface {
virtual ~WriterInterface() {}
/// Blocking write \a msg to the stream with options.
+ /// This is thread-safe with respect to \a Read
///
/// \param msg The message to be written to the stream.
/// \param options Options affecting the write operation.
@@ -95,6 +99,7 @@ class WriterInterface {
virtual bool Write(const W& msg, const WriteOptions& options) = 0;
/// Blocking write \a msg to the stream with default options.
+ /// This is thread-safe with respect to \a Read
///
/// \param msg The message to be written to the stream.
///
@@ -174,7 +179,8 @@ class ClientWriterInterface : public ClientStreamingInterface,
public WriterInterface<W> {
public:
/// Half close writing from the client.
- /// Block until writes are completed.
+ /// Block until currently-pending writes are completed.
+ /// Thread safe with respect to \a Read operations only
///
/// \return Whether the writes were successful.
virtual bool WritesDone() = 0;
@@ -189,6 +195,7 @@ class ClientWriter : public ClientWriterInterface<W> {
ClientContext* context, R* response)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) {
finish_ops_.RecvMessage(response);
+ finish_ops_.AllowNoMessage();
CallOpSet<CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(context->send_initial_metadata_,
@@ -256,7 +263,8 @@ class ClientReaderWriterInterface : public ClientStreamingInterface,
/// the metadata will be available in ClientContext after the first read.
virtual void WaitForInitialMetadata() = 0;
- /// Block until writes are completed.
+ /// Block until currently-pending writes are completed.
+ /// Thread-safe with respect to \a Read
///
/// \return Whether the writes were successful.
virtual bool WritesDone() = 0;
diff --git a/include/grpc++/impl/grpc_library.h b/include/grpc++/impl/grpc_library.h
index 175cf99a82..1184d1bf09 100644
--- a/include/grpc++/impl/grpc_library.h
+++ b/include/grpc++/impl/grpc_library.h
@@ -37,11 +37,10 @@
#include <iostream>
#include <grpc++/impl/codegen/config.h>
+#include <grpc++/impl/codegen/core_codegen.h>
#include <grpc++/impl/codegen/grpc_library.h>
#include <grpc/grpc.h>
-#include "src/cpp/common/core_codegen.h"
-
namespace grpc {
namespace internal {
diff --git a/include/grpc++/impl/server_builder_option.h b/include/grpc++/impl/server_builder_option.h
index 2b7e89f5e5..bd2018fa6b 100644
--- a/include/grpc++/impl/server_builder_option.h
+++ b/include/grpc++/impl/server_builder_option.h
@@ -50,8 +50,7 @@ class ServerBuilderOption {
virtual void UpdateArguments(ChannelArguments* args) = 0;
/// Alter the ServerBuilderPlugin map that will be added into ServerBuilder.
virtual void UpdatePlugins(
- std::map<grpc::string, std::unique_ptr<ServerBuilderPlugin> >*
- plugins) = 0;
+ std::vector<std::unique_ptr<ServerBuilderPlugin>>* plugins) = 0;
};
} // namespace grpc
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index a0ee0e98e4..6876961e21 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -93,6 +93,12 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibraryCodegen {
/// until all server objects in the process have been destroyed.
static void SetGlobalCallbacks(GlobalCallbacks* callbacks);
+ // Returns a \em raw pointer to the underlying grpc_server instance.
+ grpc_server* c_server();
+
+ // Returns a \em raw pointer to the underlying CompletionQueue.
+ CompletionQueue* completion_queue();
+
private:
friend class AsyncGenericService;
friend class ServerBuilder;
@@ -173,10 +179,13 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibraryCodegen {
grpc::mutex mu_;
bool started_;
bool shutdown_;
+ bool shutdown_notified_;
// The number of threads which are running callbacks.
int num_running_cb_;
grpc::condition_variable callback_cv_;
+ grpc::condition_variable shutdown_cv_;
+
std::shared_ptr<GlobalCallbacks> global_callbacks_;
std::list<SyncRequest>* sync_methods_;
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index 8525cb70cb..b9c49f0b19 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -66,29 +66,43 @@ class ServerBuilder {
/// The service must exist for the lifetime of the \a Server instance returned
/// by \a BuildAndStart().
/// Matches requests with any :authority
- void RegisterService(Service* service);
+ ServerBuilder& RegisterService(Service* service);
/// Register a generic service.
/// Matches requests with any :authority
- void RegisterAsyncGenericService(AsyncGenericService* service);
+ ServerBuilder& RegisterAsyncGenericService(AsyncGenericService* service);
/// Register a service. This call does not take ownership of the service.
/// The service must exist for the lifetime of the \a Server instance returned
/// by BuildAndStart().
/// Only matches requests with :authority \a host
- void RegisterService(const grpc::string& host, Service* service);
+ ServerBuilder& RegisterService(const grpc::string& host, Service* service);
/// Set max message size in bytes.
- void SetMaxMessageSize(int max_message_size) {
+ ServerBuilder& SetMaxMessageSize(int max_message_size) {
max_message_size_ = max_message_size;
+ return *this;
}
- /// Set the compression options to be used by the server.
- void SetCompressionOptions(const grpc_compression_options& options) {
- compression_options_ = options;
- }
+ /// Set the support status for compression algorithms. All algorithms are
+ /// enabled by default.
+ ///
+ /// Incoming calls compressed with an unsupported algorithm will fail with
+ /// GRPC_STATUS_UNIMPLEMENTED.
+ ServerBuilder& SetCompressionAlgorithmSupportStatus(
+ grpc_compression_algorithm algorithm, bool enabled);
+
+ /// The default compression level to use for all channel calls in the
+ /// absence of a call-specific level.
+ ServerBuilder& SetDefaultCompressionLevel(grpc_compression_level level);
+
+ /// The default compression algorithm to use for all channel calls in the
+ /// absence of a call-specific level. Note that it overrides any compression
+ /// level set by \a SetDefaultCompressionLevel.
+ ServerBuilder& SetDefaultCompressionAlgorithm(
+ grpc_compression_algorithm algorithm);
- void SetOption(std::unique_ptr<ServerBuilderOption> option);
+ ServerBuilder& SetOption(std::unique_ptr<ServerBuilderOption> option);
/// Tries to bind \a server to the given \a addr.
///
@@ -101,13 +115,24 @@ class ServerBuilder {
/// number. \a nullptr otherwise.
///
// TODO(dgq): the "port" part seems to be a misnomer.
- void AddListeningPort(const grpc::string& addr,
- std::shared_ptr<ServerCredentials> creds,
- int* selected_port = nullptr);
+ ServerBuilder& AddListeningPort(const grpc::string& addr,
+ std::shared_ptr<ServerCredentials> creds,
+ int* selected_port = nullptr);
- /// Add a completion queue for handling asynchronous services
- /// Caller is required to keep this completion queue live until
- /// the server is destroyed.
+ /// Add a completion queue for handling asynchronous services.
+ ///
+ /// Caller is required to shutdown the server prior to shutting down the
+ /// returned completion queue. A typical usage scenario:
+ ///
+ /// // While building the server:
+ /// ServerBuilder builder;
+ /// ...
+ /// cq_ = builder.AddCompletionQueue();
+ /// server_ = builder.BuildAndStart();
+ ///
+ /// // While shutting down the server;
+ /// server_->Shutdown();
+ /// cq_->Shutdown(); // Always *after* the associated server's Shutdown()!
///
/// \param is_frequently_polled This is an optional parameter to inform GRPC
/// library about whether this completion queue would be frequently polled
@@ -144,14 +169,22 @@ class ServerBuilder {
};
int max_message_size_;
- grpc_compression_options compression_options_;
std::vector<std::unique_ptr<ServerBuilderOption>> options_;
std::vector<std::unique_ptr<NamedService>> services_;
std::vector<Port> ports_;
std::vector<ServerCompletionQueue*> cqs_;
std::shared_ptr<ServerCredentials> creds_;
- std::map<grpc::string, std::unique_ptr<ServerBuilderPlugin>> plugins_;
+ std::vector<std::unique_ptr<ServerBuilderPlugin>> plugins_;
AsyncGenericService* generic_service_;
+ struct {
+ bool is_set;
+ grpc_compression_level level;
+ } maybe_default_compression_level_;
+ struct {
+ bool is_set;
+ grpc_compression_algorithm algorithm;
+ } maybe_default_compression_algorithm_;
+ uint32_t enabled_compression_algorithms_bitset_;
};
} // namespace grpc
diff --git a/include/grpc++/impl/proto_utils.h b/include/grpc++/server_posix.h
index a34cf9bd6c..e6066d4eaa 100644
--- a/include/grpc++/impl/proto_utils.h
+++ b/include/grpc++/server_posix.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,9 +31,26 @@
*
*/
-#ifndef GRPCXX_IMPL_PROTO_UTILS_H
-#define GRPCXX_IMPL_PROTO_UTILS_H
+#ifndef GRPCXX_SERVER_POSIX_H
+#define GRPCXX_SERVER_POSIX_H
-#include <grpc++/impl/codegen/proto_utils.h>
+#include <memory>
-#endif // GRPCXX_IMPL_PROTO_UTILS_H
+#include <grpc++/server.h>
+#include <grpc/support/port_platform.h>
+
+namespace grpc {
+
+#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
+
+/// Adds new client to a \a Server communicating over given file descriptor
+///
+/// \param server The server to add a client to.
+/// \param fd The file descriptor representing a socket.
+void AddInsecureChannelFromFd(Server* server, int fd);
+
+#endif // GPR_SUPPORT_CHANNELS_FROM_FD
+
+} // namespace grpc
+
+#endif // GRPCXX_SERVER_POSIX_H
diff --git a/include/grpc++/support/byte_buffer.h b/include/grpc++/support/byte_buffer.h
index f6eb09638f..20bd407109 100644
--- a/include/grpc++/support/byte_buffer.h
+++ b/include/grpc++/support/byte_buffer.h
@@ -64,7 +64,7 @@ class ByteBuffer GRPC_FINAL {
ByteBuffer& operator=(const ByteBuffer&);
/// Dump (read) the buffer contents into \a slices.
- void Dump(std::vector<Slice>* slices) const;
+ Status Dump(std::vector<Slice>* slices) const;
/// Remove all data.
void Clear();
diff --git a/include/grpc++/support/slice.h b/include/grpc++/support/slice.h
index cec9062d4f..5874b4f5ae 100644
--- a/include/grpc++/support/slice.h
+++ b/include/grpc++/support/slice.h
@@ -77,6 +77,9 @@ class Slice GRPC_FINAL {
/// Raw pointer to the end (one byte \em past the last element) of the slice.
const uint8_t* end() const { return GPR_SLICE_END_PTR(slice_); }
+ /// Raw C slice. Caller needs to call gpr_slice_unref when done.
+ gpr_slice c_slice() const { return gpr_slice_ref(slice_); }
+
private:
friend class ByteBuffer;
diff --git a/include/grpc/compression.h b/include/grpc/compression.h
index 8de4b133d4..22bcf0e302 100644
--- a/include/grpc/compression.h
+++ b/include/grpc/compression.h
@@ -51,7 +51,8 @@ GRPCAPI int grpc_compression_algorithm_parse(
grpc_compression_algorithm *algorithm);
/** Updates \a name with the encoding name corresponding to a valid \a
- * algorithm. Returns 1 upon success, 0 otherwise. */
+ * algorithm. Note that \a name is statically allocated and must *not* be freed.
+ * Returns 1 upon success, 0 otherwise. */
GRPCAPI int grpc_compression_algorithm_name(
grpc_compression_algorithm algorithm, char **name);
diff --git a/include/grpc/grpc_posix.h b/include/grpc/grpc_posix.h
new file mode 100644
index 0000000000..5e89ae3b1e
--- /dev/null
+++ b/include/grpc/grpc_posix.h
@@ -0,0 +1,78 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_GRPC_POSIX_H
+#define GRPC_GRPC_POSIX_H
+
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \mainpage GRPC Core POSIX
+ *
+ * The GRPC Core POSIX library provides some POSIX-specific low-level
+ * functionality on top of GRPC Core.
+ */
+
+/** Create a client channel to 'target' using file descriptor 'fd'. The 'target'
+ argument will be used to indicate the name for this channel. See the comment
+ for grpc_insecure_channel_create for description of 'args' argument. */
+GRPCAPI grpc_channel *grpc_insecure_channel_create_from_fd(
+ const char *target, int fd, const grpc_channel_args *args);
+
+/** Add the connected communication channel based on file descriptor 'fd' to the
+ 'server'. The 'fd' must be an open file descriptor corresponding to a
+ connected socket. The 'cq' is a completion queue that will be getting events
+ from that descriptor. */
+GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
+ grpc_completion_queue *cq,
+ int fd);
+
+/** GRPC Core POSIX library may internally use signals to optimize some work.
+ The library uses (SIGRTMIN + 2) signal by default. Use this API to instruct
+ the library to use a different signal i.e 'signum' instead.
+ Note:
+ - To prevent GRPC library from using any signals, pass a 'signum' of -1
+ - This API is optional but if called, it MUST be called before grpc_init() */
+GRPCAPI void grpc_use_signal(int signum);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_GRPC_POSIX_H */
diff --git a/include/grpc/impl/codegen/byte_buffer.h b/include/grpc/impl/codegen/byte_buffer.h
index 3ae8ac50ba..fe1e215979 100644
--- a/include/grpc/impl/codegen/byte_buffer.h
+++ b/include/grpc/impl/codegen/byte_buffer.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -93,9 +93,10 @@ GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *byte_buffer);
struct grpc_byte_buffer_reader;
typedef struct grpc_byte_buffer_reader grpc_byte_buffer_reader;
-/** Initialize \a reader to read over \a buffer */
-GRPCAPI void grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
- grpc_byte_buffer *buffer);
+/** Initialize \a reader to read over \a buffer.
+ * Returns 1 upon success, 0 otherwise. */
+GRPCAPI int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
+ grpc_byte_buffer *buffer);
/** Cleanup and destroy \a reader */
GRPCAPI void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader);
diff --git a/include/grpc/impl/codegen/compression_types.h b/include/grpc/impl/codegen/compression_types.h
index 8d2ec3b9d7..3034182d4c 100644
--- a/include/grpc/impl/codegen/compression_types.h
+++ b/include/grpc/impl/codegen/compression_types.h
@@ -35,17 +35,38 @@
#define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
#include <grpc/impl/codegen/port_platform.h>
+#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
-/** To be used in channel arguments */
+/** To be used as initial metadata key for the request of a concrete compression
+ * algorithm */
+#define GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY \
+ "grpc-internal-encoding-request"
+
+/** To be used in channel arguments.
+ *
+ * \addtogroup grpc_arg_keys
+ * \{ */
+/** Default compression algorithm for the channel.
+ * Its value is an int from the \a grpc_compression_algorithm enum. */
#define GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM \
"grpc.default_compression_algorithm"
+/** Default compression level for the channel.
+ * Its value is an int from the \a grpc_compression_level enum. */
#define GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL "grpc.default_compression_level"
+/** Compression algorithms supported by the channel.
+ * Its value is a bitset (an int). Bits correspond to algorithms in \a
+ * grpc_compression_algorithm. For example, its LSB corresponds to
+ * GRPC_COMPRESS_NONE, the next bit to GRPC_COMPRESS_DEFLATE, etc.
+ * Unset bits disable support for the algorithm. By default all algorithms are
+ * supported. It's not possible to disable GRPC_COMPRESS_NONE (the attempt will
+ * be ignored). */
#define GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET \
"grpc.compression_enabled_algorithms_bitset"
+/** \} */
/* The various compression algorithms supported by gRPC */
typedef enum {
@@ -74,15 +95,24 @@ typedef struct grpc_compression_options {
*/
uint32_t enabled_algorithms_bitset;
- /** The default channel compression algorithm. It'll be used in the absence of
+ /** The default channel compression level. It'll be used in the absence of
* call specific settings. This option corresponds to the channel argument key
- * behind \a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM */
- grpc_compression_algorithm default_compression_algorithm;
+ * behind \a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present, takes
+ * precedence over \a default_algorithm.
+ * TODO(dgq): currently only available for server channels. */
+ struct {
+ bool is_set;
+ grpc_compression_level level;
+ } default_level;
- /** The default channel compression level. It'll be used in the absence of
+ /** The default channel compression algorithm. It'll be used in the absence of
* call specific settings. This option corresponds to the channel argument key
- * behind \a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL */
- grpc_compression_algorithm default_compression_level;
+ * behind \a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM. */
+ struct {
+ bool is_set;
+ grpc_compression_algorithm algorithm;
+ } default_algorithm;
+
} grpc_compression_options;
#ifdef __cplusplus
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 7181be4a34..e5a82883be 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -106,56 +106,66 @@ typedef struct {
by grpc_arg; keys are strings to allow easy backwards-compatible extension
by arbitrary parties.
All evaluation is performed at channel creation time (i.e. the values in
- this structure need only live through the creation invocation). */
+ this structure need only live through the creation invocation).
+
+ See the description of the \ref grpc_arg_keys "available args" for more
+ details. */
typedef struct {
size_t num_args;
grpc_arg *args;
} grpc_channel_args;
-/* Channel argument keys: */
-/** Enable census for tracing and stats collection */
+/** \defgroup grpc_arg_keys
+ * Channel argument keys.
+ * \{
+ */
+/** If non-zero, enable census for tracing and stats collection. */
#define GRPC_ARG_ENABLE_CENSUS "grpc.census"
-/** Enable load reporting */
+/** If non-zero, enable load reporting. */
#define GRPC_ARG_ENABLE_LOAD_REPORTING "grpc.loadreporting"
/** Maximum number of concurrent incoming streams to allow on a http2
- connection */
+ connection. Int valued. */
#define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams"
-/** Maximum message length that the channel can receive */
+/** Maximum message length that the channel can receive. Int valued, bytes. */
#define GRPC_ARG_MAX_MESSAGE_LENGTH "grpc.max_message_length"
-/** Initial sequence number for http2 transports */
+/** Initial sequence number for http2 transports. Int valued. */
#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
"grpc.http2.initial_sequence_number"
/** Amount to read ahead on individual streams. Defaults to 64kb, larger
values can help throughput on high-latency connections.
NOTE: at some point we'd like to auto-tune this, and this parameter
- will become a no-op. */
+ will become a no-op. Int valued, bytes. */
#define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES "grpc.http2.lookahead_bytes"
-/** How much memory to use for hpack decoding */
+/** How much memory to use for hpack decoding. Int valued, bytes. */
#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER \
"grpc.http2.hpack_table_size.decoder"
-/** How much memory to use for hpack encoding */
+/** How much memory to use for hpack encoding. Int valued, bytes. */
#define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \
"grpc.http2.hpack_table_size.encoder"
-/** Default authority to pass if none specified on call construction */
+/** Default authority to pass if none specified on call construction. A string.
+ * */
#define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority"
/** Primary user agent: goes at the start of the user-agent metadata
- sent on each request */
+ sent on each request. A string. */
#define GRPC_ARG_PRIMARY_USER_AGENT_STRING "grpc.primary_user_agent"
/** Secondary user agent: goes at the end of the user-agent metadata
- sent on each request */
+ sent on each request. A string. */
#define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
/** The maximum time between subsequent connection attempts, in ms */
#define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms"
/* The caller of the secure_channel_create functions may override the target
name used for SSL host name checking using this channel argument which is of
- type GRPC_ARG_STRING. This *should* be used for testing only.
+ type \a GRPC_ARG_STRING. This *should* be used for testing only.
If this argument is not specified, the name used for SSL host name checking
will be the target parameter (assuming that the secure channel is an SSL
channel). If this parameter is specified and the underlying is not an SSL
channel, it will just be ignored. */
#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override"
-/* Maximum metadata size */
+/* Maximum metadata size, in bytes. */
#define GRPC_ARG_MAX_METADATA_SIZE "grpc.max_metadata_size"
+/** If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) */
+#define GRPC_ARG_ALLOW_REUSEPORT "grpc.so_reuseport"
+/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
particular operation, the grpc_call_error returned will be GRPC_CALL_OK.
@@ -334,6 +344,12 @@ typedef struct grpc_op {
struct {
size_t count;
grpc_metadata *metadata;
+ /** If \a is_set, \a compression_level will be used for the call.
+ * Otherwise, \a compression_level won't be considered */
+ struct {
+ uint8_t is_set;
+ grpc_compression_level level;
+ } maybe_compression_level;
} send_initial_metadata;
grpc_byte_buffer *send_message;
struct {
diff --git a/include/grpc/impl/codegen/log.h b/include/grpc/impl/codegen/log.h
index aa86fc4c17..e5010c29da 100644
--- a/include/grpc/impl/codegen/log.h
+++ b/include/grpc/impl/codegen/log.h
@@ -34,6 +34,7 @@
#ifndef GRPC_IMPL_CODEGEN_LOG_H
#define GRPC_IMPL_CODEGEN_LOG_H
+#include <inttypes.h>
#include <stdarg.h>
#include <stdlib.h> /* for abort() */
@@ -74,7 +75,7 @@ const char *gpr_log_severity_string(gpr_log_severity severity);
/* Log a message. It's advised to use GPR_xxx above to generate the context
* for each message */
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity,
- const char *format, ...);
+ const char *format, ...) GPRC_PRINT_FORMAT_CHECK(4, 5);
GPRAPI void gpr_log_message(const char *file, int line,
gpr_log_severity severity, const char *message);
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index be4215a54b..3ad665a7a2 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -129,6 +129,7 @@
#define GPR_POSIX_SOCKETADDR 1
#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
#define GPR_POSIX_SOCKETUTILS 1
+#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#define GPR_HAVE_UNIX_SOCKET 1
#define GPR_HAVE_IP_PKTINFO 1
#define GPR_HAVE_IPV6_RECVPKTINFO 1
@@ -149,7 +150,11 @@
#elif defined(ANDROID) || defined(__ANDROID__)
#define GPR_PLATFORM_STRING "android"
#define GPR_ANDROID 1
+#ifdef _LP64
+#define GPR_ARCH_64 1
+#else /* _LP64 */
#define GPR_ARCH_32 1
+#endif /* _LP64 */
#define GPR_CPU_LINUX 1
#define GPR_GCC_SYNC 1
#define GPR_GCC_TLS 1
@@ -168,6 +173,7 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
+#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#define GPR_HAVE_MSG_NOSIGNAL 1
#define GPR_HAVE_UNIX_SOCKET 1
#define GPR_HAVE_IP_PKTINFO 1
@@ -194,12 +200,14 @@
#define GPR_POSIX_WAKEUP_FD 1
#define GPR_POSIX_SOCKET 1
#define GPR_POSIX_SOCKETADDR 1
+#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#define GPR_HAVE_UNIX_SOCKET 1
#define GPR_HAVE_IP_PKTINFO 1
#define GPR_HAVE_IPV6_RECVPKTINFO 1
#ifdef __GLIBC_PREREQ
#if __GLIBC_PREREQ(2, 9)
#define GPR_LINUX_EVENTFD 1
+#define GPR_LINUX_EPOLL 1
#endif
#if __GLIBC_PREREQ(2, 10)
#define GPR_LINUX_SOCKETUTILS 1
@@ -258,6 +266,7 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
+#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#define GPR_HAVE_SO_NOSIGPIPE 1
#define GPR_HAVE_UNIX_SOCKET 1
#define GPR_HAVE_IP_PKTINFO 1
@@ -289,6 +298,7 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
+#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#define GPR_HAVE_SO_NOSIGPIPE 1
#define GPR_HAVE_UNIX_SOCKET 1
#define GPR_HAVE_IP_PKTINFO 1
@@ -429,6 +439,15 @@ typedef unsigned __int64 uint64_t;
#endif
#endif
+#ifndef GPRC_PRINT_FORMAT_CHECK
+#ifdef __GNUC__
+#define GPRC_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \
+ __attribute__((format(printf, FORMAT_STR, ARGS)))
+#else
+#define GPRC_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS)
+#endif
+#endif /* GPRC_PRINT_FORMAT_CHECK */
+
#if GPR_FORBID_UNREACHABLE_CODE
#define GPR_UNREACHABLE_CODE(STATEMENT)
#else
diff --git a/include/grpc/module.modulemap b/include/grpc/module.modulemap
new file mode 100644
index 0000000000..ae11a78b74
--- /dev/null
+++ b/include/grpc/module.modulemap
@@ -0,0 +1,5 @@
+framework module grpc {
+ umbrella header "grpc.h"
+ export *
+ module * { export * }
+}
diff --git a/include/grpc/support/avl.h b/include/grpc/support/avl.h
index d71592dcbc..f5bf32c719 100644
--- a/include/grpc/support/avl.h
+++ b/include/grpc/support/avl.h
@@ -88,5 +88,10 @@ GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void *key);
does not mutate avl.
returns NULL if key is not found. */
GPRAPI void *gpr_avl_get(gpr_avl avl, void *key);
+/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
+ its value*/
+GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void *key, void **value);
+/** Return 1 if avl is empty, 0 otherwise */
+GPRAPI int gpr_avl_is_empty(gpr_avl avl);
#endif /* GRPC_SUPPORT_AVL_H */
diff --git a/include/grpc/support/string_util.h b/include/grpc/support/string_util.h
index f981bc0db0..952cbfc26b 100644
--- a/include/grpc/support/string_util.h
+++ b/include/grpc/support/string_util.h
@@ -54,7 +54,8 @@ GPRAPI char *gpr_strdup(const char *src);
On error, returns -1 and sets *strp to NULL. If the format string is bad,
the result is undefined. */
-GPRAPI int gpr_asprintf(char **strp, const char *format, ...);
+GPRAPI int gpr_asprintf(char **strp, const char *format, ...)
+ GPRC_PRINT_FORMAT_CHECK(2, 3);
#ifdef __cplusplus
}