1// Generated by the gRPC C++ plugin. 2// If you make any local change, they will be lost. 3// source: src/proto/grpc/testing/compiler_test.proto 4// Original file comments: 5// Copyright 2016 gRPC authors. 6// 7// Licensed under the Apache License, Version 2.0 (the "License"); 8// you may not use this file except in compliance with the License. 9// You may obtain a copy of the License at 10// 11// http://www.apache.org/licenses/LICENSE-2.0 12// 13// Unless required by applicable law or agreed to in writing, software 14// distributed under the License is distributed on an "AS IS" BASIS, 15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16// See the License for the specific language governing permissions and 17// limitations under the License. 18// 19// File detached comment 1 20// 21// File detached comment 2 22// 23// File leading comment 1 24#ifndef GRPC_src_2fproto_2fgrpc_2ftesting_2fcompiler_5ftest_2eproto__INCLUDED 25#define GRPC_src_2fproto_2fgrpc_2ftesting_2fcompiler_5ftest_2eproto__INCLUDED 26 27#include "src/proto/grpc/testing/compiler_test.pb.h" 28 29#include <functional> 30#include <grpc/impl/codegen/port_platform.h> 31#include <grpcpp/impl/codegen/async_generic_service.h> 32#include <grpcpp/impl/codegen/async_stream.h> 33#include <grpcpp/impl/codegen/async_unary_call.h> 34#include <grpcpp/impl/codegen/client_callback.h> 35#include <grpcpp/impl/codegen/client_context.h> 36#include <grpcpp/impl/codegen/completion_queue.h> 37#include <grpcpp/impl/codegen/message_allocator.h> 38#include <grpcpp/impl/codegen/method_handler.h> 39#include <grpcpp/impl/codegen/proto_utils.h> 40#include <grpcpp/impl/codegen/rpc_method.h> 41#include <grpcpp/impl/codegen/server_callback.h> 42#include <grpcpp/impl/codegen/server_callback_handlers.h> 43#include <grpcpp/impl/codegen/server_context.h> 44#include <grpcpp/impl/codegen/service_type.h> 45#include <grpcpp/impl/codegen/status.h> 46#include <grpcpp/impl/codegen/stub_options.h> 47#include <grpcpp/impl/codegen/sync_stream.h> 48 49namespace grpc { 50namespace testing { 51 52// ServiceA detached comment 1 53// 54// ServiceA detached comment 2 55// 56// ServiceA leading comment 1 57class ServiceA final { 58 public: 59 static constexpr char const* service_full_name() { 60 return "grpc.testing.ServiceA"; 61 } 62 class StubInterface { 63 public: 64 virtual ~StubInterface() {} 65 // MethodA1 leading comment 1 66 virtual ::grpc::Status MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::testing::Response* response) = 0; 67 std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>> AsyncMethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 68 return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>>(AsyncMethodA1Raw(context, request, cq)); 69 } 70 std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>> PrepareAsyncMethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 71 return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>>(PrepareAsyncMethodA1Raw(context, request, cq)); 72 } 73 // MethodA1 trailing comment 1 74 // MethodA2 detached leading comment 1 75 // 76 // Method A2 leading comment 1 77 // Method A2 leading comment 2 78 std::unique_ptr< ::grpc::ClientWriterInterface< ::grpc::testing::Request>> MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response) { 79 return std::unique_ptr< ::grpc::ClientWriterInterface< ::grpc::testing::Request>>(MethodA2Raw(context, response)); 80 } 81 std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>> AsyncMethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) { 82 return std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>>(AsyncMethodA2Raw(context, response, cq, tag)); 83 } 84 std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>> PrepareAsyncMethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq) { 85 return std::unique_ptr< ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>>(PrepareAsyncMethodA2Raw(context, response, cq)); 86 } 87 // MethodA2 trailing comment 1 88 // Method A3 leading comment 1 89 std::unique_ptr< ::grpc::ClientReaderInterface< ::grpc::testing::Response>> MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request) { 90 return std::unique_ptr< ::grpc::ClientReaderInterface< ::grpc::testing::Response>>(MethodA3Raw(context, request)); 91 } 92 std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>> AsyncMethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) { 93 return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>>(AsyncMethodA3Raw(context, request, cq, tag)); 94 } 95 std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>> PrepareAsyncMethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 96 return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>>(PrepareAsyncMethodA3Raw(context, request, cq)); 97 } 98 // Method A3 trailing comment 1 99 // Method A4 leading comment 1 100 std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>> MethodA4(::grpc::ClientContext* context) { 101 return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(MethodA4Raw(context)); 102 } 103 std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>> AsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { 104 return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(AsyncMethodA4Raw(context, cq, tag)); 105 } 106 std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>> PrepareAsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { 107 return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(PrepareAsyncMethodA4Raw(context, cq)); 108 } 109 // Method A4 trailing comment 1 110 class experimental_async_interface { 111 public: 112 virtual ~experimental_async_interface() {} 113 // MethodA1 leading comment 1 114 virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; 115 virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; 116 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 117 virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; 118 #else 119 virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; 120 #endif 121 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 122 virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; 123 #else 124 virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; 125 #endif 126 // MethodA1 trailing comment 1 127 // MethodA2 detached leading comment 1 128 // 129 // Method A2 leading comment 1 130 // Method A2 leading comment 2 131 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 132 virtual void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::ClientWriteReactor< ::grpc::testing::Request>* reactor) = 0; 133 #else 134 virtual void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::experimental::ClientWriteReactor< ::grpc::testing::Request>* reactor) = 0; 135 #endif 136 // MethodA2 trailing comment 1 137 // Method A3 leading comment 1 138 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 139 virtual void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0; 140 #else 141 virtual void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0; 142 #endif 143 // Method A3 trailing comment 1 144 // Method A4 leading comment 1 145 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 146 virtual void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) = 0; 147 #else 148 virtual void MethodA4(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) = 0; 149 #endif 150 // Method A4 trailing comment 1 151 }; 152 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 153 typedef class experimental_async_interface async_interface; 154 #endif 155 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 156 async_interface* async() { return experimental_async(); } 157 #endif 158 virtual class experimental_async_interface* experimental_async() { return nullptr; } 159 private: 160 virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; 161 virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; 162 virtual ::grpc::ClientWriterInterface< ::grpc::testing::Request>* MethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response) = 0; 163 virtual ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>* AsyncMethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) = 0; 164 virtual ::grpc::ClientAsyncWriterInterface< ::grpc::testing::Request>* PrepareAsyncMethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq) = 0; 165 virtual ::grpc::ClientReaderInterface< ::grpc::testing::Response>* MethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request) = 0; 166 virtual ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>* AsyncMethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) = 0; 167 virtual ::grpc::ClientAsyncReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; 168 virtual ::grpc::ClientReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4Raw(::grpc::ClientContext* context) = 0; 169 virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>* AsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; 170 virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>* PrepareAsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; 171 }; 172 class Stub final : public StubInterface { 173 public: 174 Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); 175 ::grpc::Status MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::testing::Response* response) override; 176 std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>> AsyncMethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 177 return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>>(AsyncMethodA1Raw(context, request, cq)); 178 } 179 std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>> PrepareAsyncMethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 180 return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>>(PrepareAsyncMethodA1Raw(context, request, cq)); 181 } 182 std::unique_ptr< ::grpc::ClientWriter< ::grpc::testing::Request>> MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response) { 183 return std::unique_ptr< ::grpc::ClientWriter< ::grpc::testing::Request>>(MethodA2Raw(context, response)); 184 } 185 std::unique_ptr< ::grpc::ClientAsyncWriter< ::grpc::testing::Request>> AsyncMethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) { 186 return std::unique_ptr< ::grpc::ClientAsyncWriter< ::grpc::testing::Request>>(AsyncMethodA2Raw(context, response, cq, tag)); 187 } 188 std::unique_ptr< ::grpc::ClientAsyncWriter< ::grpc::testing::Request>> PrepareAsyncMethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq) { 189 return std::unique_ptr< ::grpc::ClientAsyncWriter< ::grpc::testing::Request>>(PrepareAsyncMethodA2Raw(context, response, cq)); 190 } 191 std::unique_ptr< ::grpc::ClientReader< ::grpc::testing::Response>> MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request) { 192 return std::unique_ptr< ::grpc::ClientReader< ::grpc::testing::Response>>(MethodA3Raw(context, request)); 193 } 194 std::unique_ptr< ::grpc::ClientAsyncReader< ::grpc::testing::Response>> AsyncMethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) { 195 return std::unique_ptr< ::grpc::ClientAsyncReader< ::grpc::testing::Response>>(AsyncMethodA3Raw(context, request, cq, tag)); 196 } 197 std::unique_ptr< ::grpc::ClientAsyncReader< ::grpc::testing::Response>> PrepareAsyncMethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 198 return std::unique_ptr< ::grpc::ClientAsyncReader< ::grpc::testing::Response>>(PrepareAsyncMethodA3Raw(context, request, cq)); 199 } 200 std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> MethodA4(::grpc::ClientContext* context) { 201 return std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(MethodA4Raw(context)); 202 } 203 std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> AsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { 204 return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(AsyncMethodA4Raw(context, cq, tag)); 205 } 206 std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> PrepareAsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { 207 return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(PrepareAsyncMethodA4Raw(context, cq)); 208 } 209 class experimental_async final : 210 public StubInterface::experimental_async_interface { 211 public: 212 void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; 213 void MethodA1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; 214 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 215 void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; 216 #else 217 void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; 218 #endif 219 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 220 void MethodA1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; 221 #else 222 void MethodA1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; 223 #endif 224 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 225 void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::ClientWriteReactor< ::grpc::testing::Request>* reactor) override; 226 #else 227 void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::experimental::ClientWriteReactor< ::grpc::testing::Request>* reactor) override; 228 #endif 229 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 230 void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) override; 231 #else 232 void MethodA3(::grpc::ClientContext* context, ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) override; 233 #endif 234 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 235 void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) override; 236 #else 237 void MethodA4(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) override; 238 #endif 239 private: 240 friend class Stub; 241 explicit experimental_async(Stub* stub): stub_(stub) { } 242 Stub* stub() { return stub_; } 243 Stub* stub_; 244 }; 245 class experimental_async_interface* experimental_async() override { return &async_stub_; } 246 247 private: 248 std::shared_ptr< ::grpc::ChannelInterface> channel_; 249 class experimental_async async_stub_{this}; 250 ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; 251 ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; 252 ::grpc::ClientWriter< ::grpc::testing::Request>* MethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response) override; 253 ::grpc::ClientAsyncWriter< ::grpc::testing::Request>* AsyncMethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq, void* tag) override; 254 ::grpc::ClientAsyncWriter< ::grpc::testing::Request>* PrepareAsyncMethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::CompletionQueue* cq) override; 255 ::grpc::ClientReader< ::grpc::testing::Response>* MethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request) override; 256 ::grpc::ClientAsyncReader< ::grpc::testing::Response>* AsyncMethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq, void* tag) override; 257 ::grpc::ClientAsyncReader< ::grpc::testing::Response>* PrepareAsyncMethodA3Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; 258 ::grpc::ClientReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4Raw(::grpc::ClientContext* context) override; 259 ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* AsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; 260 ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>* PrepareAsyncMethodA4Raw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; 261 const ::grpc::internal::RpcMethod rpcmethod_MethodA1_; 262 const ::grpc::internal::RpcMethod rpcmethod_MethodA2_; 263 const ::grpc::internal::RpcMethod rpcmethod_MethodA3_; 264 const ::grpc::internal::RpcMethod rpcmethod_MethodA4_; 265 }; 266 static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); 267 268 class Service : public ::grpc::Service { 269 public: 270 Service(); 271 virtual ~Service(); 272 // MethodA1 leading comment 1 273 virtual ::grpc::Status MethodA1(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response); 274 // MethodA1 trailing comment 1 275 // MethodA2 detached leading comment 1 276 // 277 // Method A2 leading comment 1 278 // Method A2 leading comment 2 279 virtual ::grpc::Status MethodA2(::grpc::ServerContext* context, ::grpc::ServerReader< ::grpc::testing::Request>* reader, ::grpc::testing::Response* response); 280 // MethodA2 trailing comment 1 281 // Method A3 leading comment 1 282 virtual ::grpc::Status MethodA3(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::ServerWriter< ::grpc::testing::Response>* writer); 283 // Method A3 trailing comment 1 284 // Method A4 leading comment 1 285 virtual ::grpc::Status MethodA4(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* stream); 286 // Method A4 trailing comment 1 287 }; 288 template <class BaseClass> 289 class WithAsyncMethod_MethodA1 : public BaseClass { 290 private: 291 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 292 public: 293 WithAsyncMethod_MethodA1() { 294 ::grpc::Service::MarkMethodAsync(0); 295 } 296 ~WithAsyncMethod_MethodA1() override { 297 BaseClassMustBeDerivedFromService(this); 298 } 299 // disable synchronous version of this method 300 ::grpc::Status MethodA1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 301 abort(); 302 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 303 } 304 void RequestMethodA1(::grpc::ServerContext* context, ::grpc::testing::Request* request, ::grpc::ServerAsyncResponseWriter< ::grpc::testing::Response>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 305 ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); 306 } 307 }; 308 template <class BaseClass> 309 class WithAsyncMethod_MethodA2 : public BaseClass { 310 private: 311 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 312 public: 313 WithAsyncMethod_MethodA2() { 314 ::grpc::Service::MarkMethodAsync(1); 315 } 316 ~WithAsyncMethod_MethodA2() override { 317 BaseClassMustBeDerivedFromService(this); 318 } 319 // disable synchronous version of this method 320 ::grpc::Status MethodA2(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::grpc::testing::Request>* /*reader*/, ::grpc::testing::Response* /*response*/) override { 321 abort(); 322 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 323 } 324 void RequestMethodA2(::grpc::ServerContext* context, ::grpc::ServerAsyncReader< ::grpc::testing::Response, ::grpc::testing::Request>* reader, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 325 ::grpc::Service::RequestAsyncClientStreaming(1, context, reader, new_call_cq, notification_cq, tag); 326 } 327 }; 328 template <class BaseClass> 329 class WithAsyncMethod_MethodA3 : public BaseClass { 330 private: 331 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 332 public: 333 WithAsyncMethod_MethodA3() { 334 ::grpc::Service::MarkMethodAsync(2); 335 } 336 ~WithAsyncMethod_MethodA3() override { 337 BaseClassMustBeDerivedFromService(this); 338 } 339 // disable synchronous version of this method 340 ::grpc::Status MethodA3(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::ServerWriter< ::grpc::testing::Response>* /*writer*/) override { 341 abort(); 342 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 343 } 344 void RequestMethodA3(::grpc::ServerContext* context, ::grpc::testing::Request* request, ::grpc::ServerAsyncWriter< ::grpc::testing::Response>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 345 ::grpc::Service::RequestAsyncServerStreaming(2, context, request, writer, new_call_cq, notification_cq, tag); 346 } 347 }; 348 template <class BaseClass> 349 class WithAsyncMethod_MethodA4 : public BaseClass { 350 private: 351 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 352 public: 353 WithAsyncMethod_MethodA4() { 354 ::grpc::Service::MarkMethodAsync(3); 355 } 356 ~WithAsyncMethod_MethodA4() override { 357 BaseClassMustBeDerivedFromService(this); 358 } 359 // disable synchronous version of this method 360 ::grpc::Status MethodA4(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* /*stream*/) override { 361 abort(); 362 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 363 } 364 void RequestMethodA4(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 365 ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag); 366 } 367 }; 368 typedef WithAsyncMethod_MethodA1<WithAsyncMethod_MethodA2<WithAsyncMethod_MethodA3<WithAsyncMethod_MethodA4<Service > > > > AsyncService; 369 template <class BaseClass> 370 class ExperimentalWithCallbackMethod_MethodA1 : public BaseClass { 371 private: 372 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 373 public: 374 ExperimentalWithCallbackMethod_MethodA1() { 375 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 376 ::grpc::Service:: 377 #else 378 ::grpc::Service::experimental(). 379 #endif 380 MarkMethodCallback(0, 381 new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>( 382 [this]( 383 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 384 ::grpc::CallbackServerContext* 385 #else 386 ::grpc::experimental::CallbackServerContext* 387 #endif 388 context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) { return this->MethodA1(context, request, response); }));} 389 void SetMessageAllocatorFor_MethodA1( 390 ::grpc::experimental::MessageAllocator< ::grpc::testing::Request, ::grpc::testing::Response>* allocator) { 391 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 392 ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); 393 #else 394 ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); 395 #endif 396 static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>*>(handler) 397 ->SetMessageAllocator(allocator); 398 } 399 ~ExperimentalWithCallbackMethod_MethodA1() override { 400 BaseClassMustBeDerivedFromService(this); 401 } 402 // disable synchronous version of this method 403 ::grpc::Status MethodA1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 404 abort(); 405 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 406 } 407 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 408 virtual ::grpc::ServerUnaryReactor* MethodA1( 409 ::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) 410 #else 411 virtual ::grpc::experimental::ServerUnaryReactor* MethodA1( 412 ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) 413 #endif 414 { return nullptr; } 415 }; 416 template <class BaseClass> 417 class ExperimentalWithCallbackMethod_MethodA2 : public BaseClass { 418 private: 419 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 420 public: 421 ExperimentalWithCallbackMethod_MethodA2() { 422 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 423 ::grpc::Service:: 424 #else 425 ::grpc::Service::experimental(). 426 #endif 427 MarkMethodCallback(1, 428 new ::grpc_impl::internal::CallbackClientStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>( 429 [this]( 430 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 431 ::grpc::CallbackServerContext* 432 #else 433 ::grpc::experimental::CallbackServerContext* 434 #endif 435 context, ::grpc::testing::Response* response) { return this->MethodA2(context, response); })); 436 } 437 ~ExperimentalWithCallbackMethod_MethodA2() override { 438 BaseClassMustBeDerivedFromService(this); 439 } 440 // disable synchronous version of this method 441 ::grpc::Status MethodA2(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::grpc::testing::Request>* /*reader*/, ::grpc::testing::Response* /*response*/) override { 442 abort(); 443 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 444 } 445 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 446 virtual ::grpc::ServerReadReactor< ::grpc::testing::Request>* MethodA2( 447 ::grpc::CallbackServerContext* /*context*/, ::grpc::testing::Response* /*response*/) 448 #else 449 virtual ::grpc::experimental::ServerReadReactor< ::grpc::testing::Request>* MethodA2( 450 ::grpc::experimental::CallbackServerContext* /*context*/, ::grpc::testing::Response* /*response*/) 451 #endif 452 { return nullptr; } 453 }; 454 template <class BaseClass> 455 class ExperimentalWithCallbackMethod_MethodA3 : public BaseClass { 456 private: 457 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 458 public: 459 ExperimentalWithCallbackMethod_MethodA3() { 460 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 461 ::grpc::Service:: 462 #else 463 ::grpc::Service::experimental(). 464 #endif 465 MarkMethodCallback(2, 466 new ::grpc_impl::internal::CallbackServerStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>( 467 [this]( 468 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 469 ::grpc::CallbackServerContext* 470 #else 471 ::grpc::experimental::CallbackServerContext* 472 #endif 473 context, const ::grpc::testing::Request* request) { return this->MethodA3(context, request); })); 474 } 475 ~ExperimentalWithCallbackMethod_MethodA3() override { 476 BaseClassMustBeDerivedFromService(this); 477 } 478 // disable synchronous version of this method 479 ::grpc::Status MethodA3(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::ServerWriter< ::grpc::testing::Response>* /*writer*/) override { 480 abort(); 481 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 482 } 483 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 484 virtual ::grpc::ServerWriteReactor< ::grpc::testing::Response>* MethodA3( 485 ::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/) 486 #else 487 virtual ::grpc::experimental::ServerWriteReactor< ::grpc::testing::Response>* MethodA3( 488 ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/) 489 #endif 490 { return nullptr; } 491 }; 492 template <class BaseClass> 493 class ExperimentalWithCallbackMethod_MethodA4 : public BaseClass { 494 private: 495 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 496 public: 497 ExperimentalWithCallbackMethod_MethodA4() { 498 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 499 ::grpc::Service:: 500 #else 501 ::grpc::Service::experimental(). 502 #endif 503 MarkMethodCallback(3, 504 new ::grpc_impl::internal::CallbackBidiHandler< ::grpc::testing::Request, ::grpc::testing::Response>( 505 [this]( 506 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 507 ::grpc::CallbackServerContext* 508 #else 509 ::grpc::experimental::CallbackServerContext* 510 #endif 511 context) { return this->MethodA4(context); })); 512 } 513 ~ExperimentalWithCallbackMethod_MethodA4() override { 514 BaseClassMustBeDerivedFromService(this); 515 } 516 // disable synchronous version of this method 517 ::grpc::Status MethodA4(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* /*stream*/) override { 518 abort(); 519 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 520 } 521 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 522 virtual ::grpc::ServerBidiReactor< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4( 523 ::grpc::CallbackServerContext* /*context*/) 524 #else 525 virtual ::grpc::experimental::ServerBidiReactor< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4( 526 ::grpc::experimental::CallbackServerContext* /*context*/) 527 #endif 528 { return nullptr; } 529 }; 530 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 531 typedef ExperimentalWithCallbackMethod_MethodA1<ExperimentalWithCallbackMethod_MethodA2<ExperimentalWithCallbackMethod_MethodA3<ExperimentalWithCallbackMethod_MethodA4<Service > > > > CallbackService; 532 #endif 533 534 typedef ExperimentalWithCallbackMethod_MethodA1<ExperimentalWithCallbackMethod_MethodA2<ExperimentalWithCallbackMethod_MethodA3<ExperimentalWithCallbackMethod_MethodA4<Service > > > > ExperimentalCallbackService; 535 template <class BaseClass> 536 class WithGenericMethod_MethodA1 : public BaseClass { 537 private: 538 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 539 public: 540 WithGenericMethod_MethodA1() { 541 ::grpc::Service::MarkMethodGeneric(0); 542 } 543 ~WithGenericMethod_MethodA1() override { 544 BaseClassMustBeDerivedFromService(this); 545 } 546 // disable synchronous version of this method 547 ::grpc::Status MethodA1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 548 abort(); 549 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 550 } 551 }; 552 template <class BaseClass> 553 class WithGenericMethod_MethodA2 : public BaseClass { 554 private: 555 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 556 public: 557 WithGenericMethod_MethodA2() { 558 ::grpc::Service::MarkMethodGeneric(1); 559 } 560 ~WithGenericMethod_MethodA2() override { 561 BaseClassMustBeDerivedFromService(this); 562 } 563 // disable synchronous version of this method 564 ::grpc::Status MethodA2(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::grpc::testing::Request>* /*reader*/, ::grpc::testing::Response* /*response*/) override { 565 abort(); 566 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 567 } 568 }; 569 template <class BaseClass> 570 class WithGenericMethod_MethodA3 : public BaseClass { 571 private: 572 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 573 public: 574 WithGenericMethod_MethodA3() { 575 ::grpc::Service::MarkMethodGeneric(2); 576 } 577 ~WithGenericMethod_MethodA3() override { 578 BaseClassMustBeDerivedFromService(this); 579 } 580 // disable synchronous version of this method 581 ::grpc::Status MethodA3(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::ServerWriter< ::grpc::testing::Response>* /*writer*/) override { 582 abort(); 583 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 584 } 585 }; 586 template <class BaseClass> 587 class WithGenericMethod_MethodA4 : public BaseClass { 588 private: 589 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 590 public: 591 WithGenericMethod_MethodA4() { 592 ::grpc::Service::MarkMethodGeneric(3); 593 } 594 ~WithGenericMethod_MethodA4() override { 595 BaseClassMustBeDerivedFromService(this); 596 } 597 // disable synchronous version of this method 598 ::grpc::Status MethodA4(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* /*stream*/) override { 599 abort(); 600 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 601 } 602 }; 603 template <class BaseClass> 604 class WithRawMethod_MethodA1 : public BaseClass { 605 private: 606 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 607 public: 608 WithRawMethod_MethodA1() { 609 ::grpc::Service::MarkMethodRaw(0); 610 } 611 ~WithRawMethod_MethodA1() override { 612 BaseClassMustBeDerivedFromService(this); 613 } 614 // disable synchronous version of this method 615 ::grpc::Status MethodA1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 616 abort(); 617 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 618 } 619 void RequestMethodA1(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 620 ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); 621 } 622 }; 623 template <class BaseClass> 624 class WithRawMethod_MethodA2 : public BaseClass { 625 private: 626 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 627 public: 628 WithRawMethod_MethodA2() { 629 ::grpc::Service::MarkMethodRaw(1); 630 } 631 ~WithRawMethod_MethodA2() override { 632 BaseClassMustBeDerivedFromService(this); 633 } 634 // disable synchronous version of this method 635 ::grpc::Status MethodA2(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::grpc::testing::Request>* /*reader*/, ::grpc::testing::Response* /*response*/) override { 636 abort(); 637 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 638 } 639 void RequestMethodA2(::grpc::ServerContext* context, ::grpc::ServerAsyncReader< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* reader, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 640 ::grpc::Service::RequestAsyncClientStreaming(1, context, reader, new_call_cq, notification_cq, tag); 641 } 642 }; 643 template <class BaseClass> 644 class WithRawMethod_MethodA3 : public BaseClass { 645 private: 646 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 647 public: 648 WithRawMethod_MethodA3() { 649 ::grpc::Service::MarkMethodRaw(2); 650 } 651 ~WithRawMethod_MethodA3() override { 652 BaseClassMustBeDerivedFromService(this); 653 } 654 // disable synchronous version of this method 655 ::grpc::Status MethodA3(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::ServerWriter< ::grpc::testing::Response>* /*writer*/) override { 656 abort(); 657 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 658 } 659 void RequestMethodA3(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncWriter< ::grpc::ByteBuffer>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 660 ::grpc::Service::RequestAsyncServerStreaming(2, context, request, writer, new_call_cq, notification_cq, tag); 661 } 662 }; 663 template <class BaseClass> 664 class WithRawMethod_MethodA4 : public BaseClass { 665 private: 666 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 667 public: 668 WithRawMethod_MethodA4() { 669 ::grpc::Service::MarkMethodRaw(3); 670 } 671 ~WithRawMethod_MethodA4() override { 672 BaseClassMustBeDerivedFromService(this); 673 } 674 // disable synchronous version of this method 675 ::grpc::Status MethodA4(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* /*stream*/) override { 676 abort(); 677 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 678 } 679 void RequestMethodA4(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 680 ::grpc::Service::RequestAsyncBidiStreaming(3, context, stream, new_call_cq, notification_cq, tag); 681 } 682 }; 683 template <class BaseClass> 684 class ExperimentalWithRawCallbackMethod_MethodA1 : public BaseClass { 685 private: 686 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 687 public: 688 ExperimentalWithRawCallbackMethod_MethodA1() { 689 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 690 ::grpc::Service:: 691 #else 692 ::grpc::Service::experimental(). 693 #endif 694 MarkMethodRawCallback(0, 695 new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( 696 [this]( 697 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 698 ::grpc::CallbackServerContext* 699 #else 700 ::grpc::experimental::CallbackServerContext* 701 #endif 702 context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MethodA1(context, request, response); })); 703 } 704 ~ExperimentalWithRawCallbackMethod_MethodA1() override { 705 BaseClassMustBeDerivedFromService(this); 706 } 707 // disable synchronous version of this method 708 ::grpc::Status MethodA1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 709 abort(); 710 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 711 } 712 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 713 virtual ::grpc::ServerUnaryReactor* MethodA1( 714 ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) 715 #else 716 virtual ::grpc::experimental::ServerUnaryReactor* MethodA1( 717 ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) 718 #endif 719 { return nullptr; } 720 }; 721 template <class BaseClass> 722 class ExperimentalWithRawCallbackMethod_MethodA2 : public BaseClass { 723 private: 724 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 725 public: 726 ExperimentalWithRawCallbackMethod_MethodA2() { 727 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 728 ::grpc::Service:: 729 #else 730 ::grpc::Service::experimental(). 731 #endif 732 MarkMethodRawCallback(1, 733 new ::grpc_impl::internal::CallbackClientStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( 734 [this]( 735 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 736 ::grpc::CallbackServerContext* 737 #else 738 ::grpc::experimental::CallbackServerContext* 739 #endif 740 context, ::grpc::ByteBuffer* response) { return this->MethodA2(context, response); })); 741 } 742 ~ExperimentalWithRawCallbackMethod_MethodA2() override { 743 BaseClassMustBeDerivedFromService(this); 744 } 745 // disable synchronous version of this method 746 ::grpc::Status MethodA2(::grpc::ServerContext* /*context*/, ::grpc::ServerReader< ::grpc::testing::Request>* /*reader*/, ::grpc::testing::Response* /*response*/) override { 747 abort(); 748 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 749 } 750 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 751 virtual ::grpc::ServerReadReactor< ::grpc::ByteBuffer>* MethodA2( 752 ::grpc::CallbackServerContext* /*context*/, ::grpc::ByteBuffer* /*response*/) 753 #else 754 virtual ::grpc::experimental::ServerReadReactor< ::grpc::ByteBuffer>* MethodA2( 755 ::grpc::experimental::CallbackServerContext* /*context*/, ::grpc::ByteBuffer* /*response*/) 756 #endif 757 { return nullptr; } 758 }; 759 template <class BaseClass> 760 class ExperimentalWithRawCallbackMethod_MethodA3 : public BaseClass { 761 private: 762 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 763 public: 764 ExperimentalWithRawCallbackMethod_MethodA3() { 765 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 766 ::grpc::Service:: 767 #else 768 ::grpc::Service::experimental(). 769 #endif 770 MarkMethodRawCallback(2, 771 new ::grpc_impl::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( 772 [this]( 773 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 774 ::grpc::CallbackServerContext* 775 #else 776 ::grpc::experimental::CallbackServerContext* 777 #endif 778 context, const::grpc::ByteBuffer* request) { return this->MethodA3(context, request); })); 779 } 780 ~ExperimentalWithRawCallbackMethod_MethodA3() override { 781 BaseClassMustBeDerivedFromService(this); 782 } 783 // disable synchronous version of this method 784 ::grpc::Status MethodA3(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::ServerWriter< ::grpc::testing::Response>* /*writer*/) override { 785 abort(); 786 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 787 } 788 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 789 virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* MethodA3( 790 ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) 791 #else 792 virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* MethodA3( 793 ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) 794 #endif 795 { return nullptr; } 796 }; 797 template <class BaseClass> 798 class ExperimentalWithRawCallbackMethod_MethodA4 : public BaseClass { 799 private: 800 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 801 public: 802 ExperimentalWithRawCallbackMethod_MethodA4() { 803 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 804 ::grpc::Service:: 805 #else 806 ::grpc::Service::experimental(). 807 #endif 808 MarkMethodRawCallback(3, 809 new ::grpc_impl::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( 810 [this]( 811 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 812 ::grpc::CallbackServerContext* 813 #else 814 ::grpc::experimental::CallbackServerContext* 815 #endif 816 context) { return this->MethodA4(context); })); 817 } 818 ~ExperimentalWithRawCallbackMethod_MethodA4() override { 819 BaseClassMustBeDerivedFromService(this); 820 } 821 // disable synchronous version of this method 822 ::grpc::Status MethodA4(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::grpc::testing::Response, ::grpc::testing::Request>* /*stream*/) override { 823 abort(); 824 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 825 } 826 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 827 virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* MethodA4( 828 ::grpc::CallbackServerContext* /*context*/) 829 #else 830 virtual ::grpc::experimental::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* MethodA4( 831 ::grpc::experimental::CallbackServerContext* /*context*/) 832 #endif 833 { return nullptr; } 834 }; 835 template <class BaseClass> 836 class WithStreamedUnaryMethod_MethodA1 : public BaseClass { 837 private: 838 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 839 public: 840 WithStreamedUnaryMethod_MethodA1() { 841 ::grpc::Service::MarkMethodStreamed(0, 842 new ::grpc::internal::StreamedUnaryHandler< 843 ::grpc::testing::Request, ::grpc::testing::Response>( 844 [this](::grpc_impl::ServerContext* context, 845 ::grpc_impl::ServerUnaryStreamer< 846 ::grpc::testing::Request, ::grpc::testing::Response>* streamer) { 847 return this->StreamedMethodA1(context, 848 streamer); 849 })); 850 } 851 ~WithStreamedUnaryMethod_MethodA1() override { 852 BaseClassMustBeDerivedFromService(this); 853 } 854 // disable regular version of this method 855 ::grpc::Status MethodA1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 856 abort(); 857 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 858 } 859 // replace default version of method with streamed unary 860 virtual ::grpc::Status StreamedMethodA1(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::grpc::testing::Request,::grpc::testing::Response>* server_unary_streamer) = 0; 861 }; 862 typedef WithStreamedUnaryMethod_MethodA1<Service > StreamedUnaryService; 863 template <class BaseClass> 864 class WithSplitStreamingMethod_MethodA3 : public BaseClass { 865 private: 866 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 867 public: 868 WithSplitStreamingMethod_MethodA3() { 869 ::grpc::Service::MarkMethodStreamed(2, 870 new ::grpc::internal::SplitServerStreamingHandler< 871 ::grpc::testing::Request, ::grpc::testing::Response>( 872 [this](::grpc_impl::ServerContext* context, 873 ::grpc_impl::ServerSplitStreamer< 874 ::grpc::testing::Request, ::grpc::testing::Response>* streamer) { 875 return this->StreamedMethodA3(context, 876 streamer); 877 })); 878 } 879 ~WithSplitStreamingMethod_MethodA3() override { 880 BaseClassMustBeDerivedFromService(this); 881 } 882 // disable regular version of this method 883 ::grpc::Status MethodA3(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::ServerWriter< ::grpc::testing::Response>* /*writer*/) override { 884 abort(); 885 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 886 } 887 // replace default version of method with split streamed 888 virtual ::grpc::Status StreamedMethodA3(::grpc::ServerContext* context, ::grpc::ServerSplitStreamer< ::grpc::testing::Request,::grpc::testing::Response>* server_split_streamer) = 0; 889 }; 890 typedef WithSplitStreamingMethod_MethodA3<Service > SplitStreamedService; 891 typedef WithStreamedUnaryMethod_MethodA1<WithSplitStreamingMethod_MethodA3<Service > > StreamedService; 892}; 893 894// ServiceB leading comment 1 895class ServiceB final { 896 public: 897 static constexpr char const* service_full_name() { 898 return "grpc.testing.ServiceB"; 899 } 900 class StubInterface { 901 public: 902 virtual ~StubInterface() {} 903 // MethodB1 leading comment 1 904 virtual ::grpc::Status MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::testing::Response* response) = 0; 905 std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>> AsyncMethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 906 return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>>(AsyncMethodB1Raw(context, request, cq)); 907 } 908 std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>> PrepareAsyncMethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 909 return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>>(PrepareAsyncMethodB1Raw(context, request, cq)); 910 } 911 // MethodB1 trailing comment 1 912 class experimental_async_interface { 913 public: 914 virtual ~experimental_async_interface() {} 915 // MethodB1 leading comment 1 916 virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; 917 virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; 918 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 919 virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; 920 #else 921 virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; 922 #endif 923 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 924 virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; 925 #else 926 virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; 927 #endif 928 // MethodB1 trailing comment 1 929 }; 930 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 931 typedef class experimental_async_interface async_interface; 932 #endif 933 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 934 async_interface* async() { return experimental_async(); } 935 #endif 936 virtual class experimental_async_interface* experimental_async() { return nullptr; } 937 private: 938 virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; 939 virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; 940 }; 941 class Stub final : public StubInterface { 942 public: 943 Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); 944 ::grpc::Status MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::testing::Response* response) override; 945 std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>> AsyncMethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 946 return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>>(AsyncMethodB1Raw(context, request, cq)); 947 } 948 std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>> PrepareAsyncMethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { 949 return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>>(PrepareAsyncMethodB1Raw(context, request, cq)); 950 } 951 class experimental_async final : 952 public StubInterface::experimental_async_interface { 953 public: 954 void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; 955 void MethodB1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; 956 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 957 void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; 958 #else 959 void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; 960 #endif 961 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 962 void MethodB1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; 963 #else 964 void MethodB1(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; 965 #endif 966 private: 967 friend class Stub; 968 explicit experimental_async(Stub* stub): stub_(stub) { } 969 Stub* stub() { return stub_; } 970 Stub* stub_; 971 }; 972 class experimental_async_interface* experimental_async() override { return &async_stub_; } 973 974 private: 975 std::shared_ptr< ::grpc::ChannelInterface> channel_; 976 class experimental_async async_stub_{this}; 977 ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; 978 ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; 979 const ::grpc::internal::RpcMethod rpcmethod_MethodB1_; 980 }; 981 static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); 982 983 class Service : public ::grpc::Service { 984 public: 985 Service(); 986 virtual ~Service(); 987 // MethodB1 leading comment 1 988 virtual ::grpc::Status MethodB1(::grpc::ServerContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response); 989 // MethodB1 trailing comment 1 990 }; 991 template <class BaseClass> 992 class WithAsyncMethod_MethodB1 : public BaseClass { 993 private: 994 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 995 public: 996 WithAsyncMethod_MethodB1() { 997 ::grpc::Service::MarkMethodAsync(0); 998 } 999 ~WithAsyncMethod_MethodB1() override { 1000 BaseClassMustBeDerivedFromService(this); 1001 } 1002 // disable synchronous version of this method 1003 ::grpc::Status MethodB1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 1004 abort(); 1005 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 1006 } 1007 void RequestMethodB1(::grpc::ServerContext* context, ::grpc::testing::Request* request, ::grpc::ServerAsyncResponseWriter< ::grpc::testing::Response>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 1008 ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); 1009 } 1010 }; 1011 typedef WithAsyncMethod_MethodB1<Service > AsyncService; 1012 template <class BaseClass> 1013 class ExperimentalWithCallbackMethod_MethodB1 : public BaseClass { 1014 private: 1015 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 1016 public: 1017 ExperimentalWithCallbackMethod_MethodB1() { 1018 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1019 ::grpc::Service:: 1020 #else 1021 ::grpc::Service::experimental(). 1022 #endif 1023 MarkMethodCallback(0, 1024 new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>( 1025 [this]( 1026 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1027 ::grpc::CallbackServerContext* 1028 #else 1029 ::grpc::experimental::CallbackServerContext* 1030 #endif 1031 context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) { return this->MethodB1(context, request, response); }));} 1032 void SetMessageAllocatorFor_MethodB1( 1033 ::grpc::experimental::MessageAllocator< ::grpc::testing::Request, ::grpc::testing::Response>* allocator) { 1034 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1035 ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); 1036 #else 1037 ::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); 1038 #endif 1039 static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>*>(handler) 1040 ->SetMessageAllocator(allocator); 1041 } 1042 ~ExperimentalWithCallbackMethod_MethodB1() override { 1043 BaseClassMustBeDerivedFromService(this); 1044 } 1045 // disable synchronous version of this method 1046 ::grpc::Status MethodB1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 1047 abort(); 1048 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 1049 } 1050 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1051 virtual ::grpc::ServerUnaryReactor* MethodB1( 1052 ::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) 1053 #else 1054 virtual ::grpc::experimental::ServerUnaryReactor* MethodB1( 1055 ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) 1056 #endif 1057 { return nullptr; } 1058 }; 1059 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1060 typedef ExperimentalWithCallbackMethod_MethodB1<Service > CallbackService; 1061 #endif 1062 1063 typedef ExperimentalWithCallbackMethod_MethodB1<Service > ExperimentalCallbackService; 1064 template <class BaseClass> 1065 class WithGenericMethod_MethodB1 : public BaseClass { 1066 private: 1067 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 1068 public: 1069 WithGenericMethod_MethodB1() { 1070 ::grpc::Service::MarkMethodGeneric(0); 1071 } 1072 ~WithGenericMethod_MethodB1() override { 1073 BaseClassMustBeDerivedFromService(this); 1074 } 1075 // disable synchronous version of this method 1076 ::grpc::Status MethodB1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 1077 abort(); 1078 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 1079 } 1080 }; 1081 template <class BaseClass> 1082 class WithRawMethod_MethodB1 : public BaseClass { 1083 private: 1084 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 1085 public: 1086 WithRawMethod_MethodB1() { 1087 ::grpc::Service::MarkMethodRaw(0); 1088 } 1089 ~WithRawMethod_MethodB1() override { 1090 BaseClassMustBeDerivedFromService(this); 1091 } 1092 // disable synchronous version of this method 1093 ::grpc::Status MethodB1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 1094 abort(); 1095 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 1096 } 1097 void RequestMethodB1(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 1098 ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); 1099 } 1100 }; 1101 template <class BaseClass> 1102 class ExperimentalWithRawCallbackMethod_MethodB1 : public BaseClass { 1103 private: 1104 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 1105 public: 1106 ExperimentalWithRawCallbackMethod_MethodB1() { 1107 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1108 ::grpc::Service:: 1109 #else 1110 ::grpc::Service::experimental(). 1111 #endif 1112 MarkMethodRawCallback(0, 1113 new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( 1114 [this]( 1115 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1116 ::grpc::CallbackServerContext* 1117 #else 1118 ::grpc::experimental::CallbackServerContext* 1119 #endif 1120 context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MethodB1(context, request, response); })); 1121 } 1122 ~ExperimentalWithRawCallbackMethod_MethodB1() override { 1123 BaseClassMustBeDerivedFromService(this); 1124 } 1125 // disable synchronous version of this method 1126 ::grpc::Status MethodB1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 1127 abort(); 1128 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 1129 } 1130 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL 1131 virtual ::grpc::ServerUnaryReactor* MethodB1( 1132 ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) 1133 #else 1134 virtual ::grpc::experimental::ServerUnaryReactor* MethodB1( 1135 ::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) 1136 #endif 1137 { return nullptr; } 1138 }; 1139 template <class BaseClass> 1140 class WithStreamedUnaryMethod_MethodB1 : public BaseClass { 1141 private: 1142 void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} 1143 public: 1144 WithStreamedUnaryMethod_MethodB1() { 1145 ::grpc::Service::MarkMethodStreamed(0, 1146 new ::grpc::internal::StreamedUnaryHandler< 1147 ::grpc::testing::Request, ::grpc::testing::Response>( 1148 [this](::grpc_impl::ServerContext* context, 1149 ::grpc_impl::ServerUnaryStreamer< 1150 ::grpc::testing::Request, ::grpc::testing::Response>* streamer) { 1151 return this->StreamedMethodB1(context, 1152 streamer); 1153 })); 1154 } 1155 ~WithStreamedUnaryMethod_MethodB1() override { 1156 BaseClassMustBeDerivedFromService(this); 1157 } 1158 // disable regular version of this method 1159 ::grpc::Status MethodB1(::grpc::ServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) override { 1160 abort(); 1161 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 1162 } 1163 // replace default version of method with streamed unary 1164 virtual ::grpc::Status StreamedMethodB1(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::grpc::testing::Request,::grpc::testing::Response>* server_unary_streamer) = 0; 1165 }; 1166 typedef WithStreamedUnaryMethod_MethodB1<Service > StreamedUnaryService; 1167 typedef Service SplitStreamedService; 1168 typedef WithStreamedUnaryMethod_MethodB1<Service > StreamedService; 1169}; 1170// ServiceB trailing comment 1 1171 1172} // namespace testing 1173} // namespace grpc 1174 1175 1176#endif // GRPC_src_2fproto_2fgrpc_2ftesting_2fcompiler_5ftest_2eproto__INCLUDED 1177