|
|
@ -27,7 +27,6 @@ |
|
|
|
#include "src/proto/grpc/testing/compiler_test.pb.h" |
|
|
|
#include "src/proto/grpc/testing/compiler_test.pb.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <functional> |
|
|
|
#include <functional> |
|
|
|
#include <grpc/impl/codegen/port_platform.h> |
|
|
|
|
|
|
|
#include <grpcpp/impl/codegen/async_generic_service.h> |
|
|
|
#include <grpcpp/impl/codegen/async_generic_service.h> |
|
|
|
#include <grpcpp/impl/codegen/async_stream.h> |
|
|
|
#include <grpcpp/impl/codegen/async_stream.h> |
|
|
|
#include <grpcpp/impl/codegen/async_unary_call.h> |
|
|
|
#include <grpcpp/impl/codegen/async_unary_call.h> |
|
|
@ -107,49 +106,29 @@ class ServiceA final { |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(PrepareAsyncMethodA4Raw(context, cq)); |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::testing::Request, ::grpc::testing::Response>>(PrepareAsyncMethodA4Raw(context, cq)); |
|
|
|
} |
|
|
|
} |
|
|
|
// Method A4 trailing comment 1 |
|
|
|
// Method A4 trailing comment 1 |
|
|
|
class experimental_async_interface { |
|
|
|
class async_interface { |
|
|
|
public: |
|
|
|
public: |
|
|
|
virtual ~experimental_async_interface() {} |
|
|
|
virtual ~async_interface() {} |
|
|
|
// MethodA1 leading comment 1 |
|
|
|
// MethodA1 leading comment 1 |
|
|
|
virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; |
|
|
|
virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
|
|
|
virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
|
|
|
#else |
|
|
|
|
|
|
|
virtual void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// MethodA1 trailing comment 1 |
|
|
|
// MethodA1 trailing comment 1 |
|
|
|
// MethodA2 detached leading comment 1 |
|
|
|
// MethodA2 detached leading comment 1 |
|
|
|
// |
|
|
|
// |
|
|
|
// Method A2 leading comment 1 |
|
|
|
// Method A2 leading comment 1 |
|
|
|
// Method A2 leading comment 2 |
|
|
|
// Method A2 leading comment 2 |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::ClientWriteReactor< ::grpc::testing::Request>* reactor) = 0; |
|
|
|
virtual void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::ClientWriteReactor< ::grpc::testing::Request>* reactor) = 0; |
|
|
|
#else |
|
|
|
|
|
|
|
virtual void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::experimental::ClientWriteReactor< ::grpc::testing::Request>* reactor) = 0; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// MethodA2 trailing comment 1 |
|
|
|
// MethodA2 trailing comment 1 |
|
|
|
// Method A3 leading comment 1 |
|
|
|
// Method A3 leading comment 1 |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0; |
|
|
|
virtual void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0; |
|
|
|
#else |
|
|
|
|
|
|
|
virtual void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) = 0; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// Method A3 trailing comment 1 |
|
|
|
// Method A3 trailing comment 1 |
|
|
|
// Method A4 leading comment 1 |
|
|
|
// Method A4 leading comment 1 |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) = 0; |
|
|
|
virtual void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) = 0; |
|
|
|
#else |
|
|
|
|
|
|
|
virtual void MethodA4(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) = 0; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// Method A4 trailing comment 1 |
|
|
|
// Method A4 trailing comment 1 |
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
typedef class async_interface experimental_async_interface; |
|
|
|
typedef class experimental_async_interface async_interface; |
|
|
|
virtual class async_interface* async() { return experimental_async(); } |
|
|
|
#endif |
|
|
|
virtual class async_interface* experimental_async() { return nullptr; } |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
async_interface* async() { return experimental_async(); } |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
virtual class experimental_async_interface* experimental_async() { return nullptr; } |
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
@ -200,41 +179,26 @@ class ServiceA final { |
|
|
|
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> PrepareAsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { |
|
|
|
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>> PrepareAsyncMethodA4(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(PrepareAsyncMethodA4Raw(context, cq)); |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::testing::Request, ::grpc::testing::Response>>(PrepareAsyncMethodA4Raw(context, cq)); |
|
|
|
} |
|
|
|
} |
|
|
|
class experimental_async final : |
|
|
|
class async final : |
|
|
|
public StubInterface::experimental_async_interface { |
|
|
|
public StubInterface::async_interface { |
|
|
|
public: |
|
|
|
public: |
|
|
|
void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; |
|
|
|
void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; |
|
|
|
void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; |
|
|
|
#else |
|
|
|
|
|
|
|
void MethodA1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::ClientWriteReactor< ::grpc::testing::Request>* reactor) override; |
|
|
|
void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::ClientWriteReactor< ::grpc::testing::Request>* reactor) override; |
|
|
|
#else |
|
|
|
|
|
|
|
void MethodA2(::grpc::ClientContext* context, ::grpc::testing::Response* response, ::grpc::experimental::ClientWriteReactor< ::grpc::testing::Request>* reactor) override; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) override; |
|
|
|
void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::ClientReadReactor< ::grpc::testing::Response>* reactor) override; |
|
|
|
#else |
|
|
|
|
|
|
|
void MethodA3(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::experimental::ClientReadReactor< ::grpc::testing::Response>* reactor) override; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) override; |
|
|
|
void MethodA4(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) override; |
|
|
|
#else |
|
|
|
|
|
|
|
void MethodA4(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::grpc::testing::Request,::grpc::testing::Response>* reactor) override; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
friend class Stub; |
|
|
|
friend class Stub; |
|
|
|
explicit experimental_async(Stub* stub): stub_(stub) { } |
|
|
|
explicit async(Stub* stub): stub_(stub) { } |
|
|
|
Stub* stub() { return stub_; } |
|
|
|
Stub* stub() { return stub_; } |
|
|
|
Stub* stub_; |
|
|
|
Stub* stub_; |
|
|
|
}; |
|
|
|
}; |
|
|
|
class experimental_async_interface* experimental_async() override { return &async_stub_; } |
|
|
|
class async* async() override { return experimental_async(); } |
|
|
|
|
|
|
|
class async* experimental_async() override { return &async_stub_; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
std::shared_ptr< ::grpc::ChannelInterface> channel_; |
|
|
|
std::shared_ptr< ::grpc::ChannelInterface> channel_; |
|
|
|
class experimental_async async_stub_{this}; |
|
|
|
class async async_stub_{this}; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodA1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientWriter< ::grpc::testing::Request>* MethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response) override; |
|
|
|
::grpc::ClientWriter< ::grpc::testing::Request>* MethodA2Raw(::grpc::ClientContext* context, ::grpc::testing::Response* response) override; |
|
|
@ -355,36 +319,22 @@ class ServiceA final { |
|
|
|
}; |
|
|
|
}; |
|
|
|
typedef WithAsyncMethod_MethodA1<WithAsyncMethod_MethodA2<WithAsyncMethod_MethodA3<WithAsyncMethod_MethodA4<Service > > > > AsyncService; |
|
|
|
typedef WithAsyncMethod_MethodA1<WithAsyncMethod_MethodA2<WithAsyncMethod_MethodA3<WithAsyncMethod_MethodA4<Service > > > > AsyncService; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithCallbackMethod_MethodA1 : public BaseClass { |
|
|
|
class WithCallbackMethod_MethodA1 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithCallbackMethod_MethodA1() { |
|
|
|
WithCallbackMethod_MethodA1() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodCallback(0, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodCallback(0, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) { return this->MethodA1(context, request, response); }));} |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) { return this->MethodA1(context, request, response); }));} |
|
|
|
|
|
|
|
void SetMessageAllocatorFor_MethodA1( |
|
|
|
void SetMessageAllocatorFor_MethodA1( |
|
|
|
::grpc::experimental::MessageAllocator< ::grpc::testing::Request, ::grpc::testing::Response>* allocator) { |
|
|
|
::grpc::MessageAllocator< ::grpc::testing::Request, ::grpc::testing::Response>* allocator) { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); |
|
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); |
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
static_cast<::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>*>(handler) |
|
|
|
static_cast<::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>*>(handler) |
|
|
|
->SetMessageAllocator(allocator); |
|
|
|
->SetMessageAllocator(allocator); |
|
|
|
} |
|
|
|
} |
|
|
|
~ExperimentalWithCallbackMethod_MethodA1() override { |
|
|
|
~WithCallbackMethod_MethodA1() override { |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -392,37 +342,21 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodA1( |
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodA1( |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerUnaryReactor* MethodA1( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithCallbackMethod_MethodA2 : public BaseClass { |
|
|
|
class WithCallbackMethod_MethodA2 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithCallbackMethod_MethodA2() { |
|
|
|
WithCallbackMethod_MethodA2() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodCallback(1, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodCallback(1, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackClientStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
new ::grpc::internal::CallbackClientStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, ::grpc::testing::Response* response) { return this->MethodA2(context, response); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithCallbackMethod_MethodA2() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, ::grpc::testing::Response* response) { return this->MethodA2(context, response); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithCallbackMethod_MethodA2() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -430,37 +364,21 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerReadReactor< ::grpc::testing::Request>* MethodA2( |
|
|
|
virtual ::grpc::ServerReadReactor< ::grpc::testing::Request>* MethodA2( |
|
|
|
::grpc::CallbackServerContext* /*context*/, ::grpc::testing::Response* /*response*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, ::grpc::testing::Response* /*response*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerReadReactor< ::grpc::testing::Request>* MethodA2( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, ::grpc::testing::Response* /*response*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithCallbackMethod_MethodA3 : public BaseClass { |
|
|
|
class WithCallbackMethod_MethodA3 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithCallbackMethod_MethodA3() { |
|
|
|
WithCallbackMethod_MethodA3() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodCallback(2, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodCallback(2, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, const ::grpc::testing::Request* request) { return this->MethodA3(context, request); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithCallbackMethod_MethodA3() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, const ::grpc::testing::Request* request) { return this->MethodA3(context, request); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithCallbackMethod_MethodA3() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -468,37 +386,21 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerWriteReactor< ::grpc::testing::Response>* MethodA3( |
|
|
|
virtual ::grpc::ServerWriteReactor< ::grpc::testing::Response>* MethodA3( |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerWriteReactor< ::grpc::testing::Response>* MethodA3( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithCallbackMethod_MethodA4 : public BaseClass { |
|
|
|
class WithCallbackMethod_MethodA4 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithCallbackMethod_MethodA4() { |
|
|
|
WithCallbackMethod_MethodA4() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodCallback(3, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodCallback(3, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackBidiHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
new ::grpc::internal::CallbackBidiHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context) { return this->MethodA4(context); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithCallbackMethod_MethodA4() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context) { return this->MethodA4(context); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithCallbackMethod_MethodA4() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -506,20 +408,12 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerBidiReactor< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4( |
|
|
|
virtual ::grpc::ServerBidiReactor< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4( |
|
|
|
::grpc::CallbackServerContext* /*context*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/) |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerBidiReactor< ::grpc::testing::Request, ::grpc::testing::Response>* MethodA4( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
{ return nullptr; } |
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
typedef WithCallbackMethod_MethodA1<WithCallbackMethod_MethodA2<WithCallbackMethod_MethodA3<WithCallbackMethod_MethodA4<Service > > > > CallbackService; |
|
|
|
typedef ExperimentalWithCallbackMethod_MethodA1<ExperimentalWithCallbackMethod_MethodA2<ExperimentalWithCallbackMethod_MethodA3<ExperimentalWithCallbackMethod_MethodA4<Service > > > > CallbackService; |
|
|
|
typedef CallbackService ExperimentalCallbackService; |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef ExperimentalWithCallbackMethod_MethodA1<ExperimentalWithCallbackMethod_MethodA2<ExperimentalWithCallbackMethod_MethodA3<ExperimentalWithCallbackMethod_MethodA4<Service > > > > ExperimentalCallbackService; |
|
|
|
|
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class WithGenericMethod_MethodA1 : public BaseClass { |
|
|
|
class WithGenericMethod_MethodA1 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
@ -669,27 +563,17 @@ class ServiceA final { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithRawCallbackMethod_MethodA1 : public BaseClass { |
|
|
|
class WithRawCallbackMethod_MethodA1 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithRawCallbackMethod_MethodA1() { |
|
|
|
WithRawCallbackMethod_MethodA1() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodRawCallback(0, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodRawCallback(0, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MethodA1(context, request, response); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithRawCallbackMethod_MethodA1() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MethodA1(context, request, response); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithRawCallbackMethod_MethodA1() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -697,37 +581,21 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodA1( |
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodA1( |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerUnaryReactor* MethodA1( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithRawCallbackMethod_MethodA2 : public BaseClass { |
|
|
|
class WithRawCallbackMethod_MethodA2 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithRawCallbackMethod_MethodA2() { |
|
|
|
WithRawCallbackMethod_MethodA2() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodRawCallback(1, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodRawCallback(1, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackClientStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
new ::grpc::internal::CallbackClientStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, ::grpc::ByteBuffer* response) { return this->MethodA2(context, response); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithRawCallbackMethod_MethodA2() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, ::grpc::ByteBuffer* response) { return this->MethodA2(context, response); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithRawCallbackMethod_MethodA2() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -735,37 +603,21 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerReadReactor< ::grpc::ByteBuffer>* MethodA2( |
|
|
|
virtual ::grpc::ServerReadReactor< ::grpc::ByteBuffer>* MethodA2( |
|
|
|
::grpc::CallbackServerContext* /*context*/, ::grpc::ByteBuffer* /*response*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerReadReactor< ::grpc::ByteBuffer>* MethodA2( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, ::grpc::ByteBuffer* /*response*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithRawCallbackMethod_MethodA3 : public BaseClass { |
|
|
|
class WithRawCallbackMethod_MethodA3 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithRawCallbackMethod_MethodA3() { |
|
|
|
WithRawCallbackMethod_MethodA3() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodRawCallback(2, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodRawCallback(2, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
new ::grpc::internal::CallbackServerStreamingHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, const::grpc::ByteBuffer* request) { return this->MethodA3(context, request); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithRawCallbackMethod_MethodA3() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, const::grpc::ByteBuffer* request) { return this->MethodA3(context, request); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithRawCallbackMethod_MethodA3() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -773,37 +625,21 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* MethodA3( |
|
|
|
virtual ::grpc::ServerWriteReactor< ::grpc::ByteBuffer>* MethodA3( |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerWriteReactor< ::grpc::ByteBuffer>* MethodA3( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithRawCallbackMethod_MethodA4 : public BaseClass { |
|
|
|
class WithRawCallbackMethod_MethodA4 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithRawCallbackMethod_MethodA4() { |
|
|
|
WithRawCallbackMethod_MethodA4() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodRawCallback(3, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodRawCallback(3, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context) { return this->MethodA4(context); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithRawCallbackMethod_MethodA4() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context) { return this->MethodA4(context); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithRawCallbackMethod_MethodA4() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -811,13 +647,8 @@ class ServiceA final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* MethodA4( |
|
|
|
virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* MethodA4( |
|
|
|
::grpc::CallbackServerContext* /*context*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/) |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* MethodA4( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
{ return nullptr; } |
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
@ -897,25 +728,17 @@ class ServiceB final { |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>>(PrepareAsyncMethodB1Raw(context, request, cq)); |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>>(PrepareAsyncMethodB1Raw(context, request, cq)); |
|
|
|
} |
|
|
|
} |
|
|
|
// MethodB1 trailing comment 1 |
|
|
|
// MethodB1 trailing comment 1 |
|
|
|
class experimental_async_interface { |
|
|
|
class async_interface { |
|
|
|
public: |
|
|
|
public: |
|
|
|
virtual ~experimental_async_interface() {} |
|
|
|
virtual ~async_interface() {} |
|
|
|
// MethodB1 leading comment 1 |
|
|
|
// MethodB1 leading comment 1 |
|
|
|
virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; |
|
|
|
virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) = 0; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
|
|
|
virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) = 0; |
|
|
|
#else |
|
|
|
|
|
|
|
virtual void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// MethodB1 trailing comment 1 |
|
|
|
// MethodB1 trailing comment 1 |
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
typedef class async_interface experimental_async_interface; |
|
|
|
typedef class experimental_async_interface async_interface; |
|
|
|
virtual class async_interface* async() { return experimental_async(); } |
|
|
|
#endif |
|
|
|
virtual class async_interface* experimental_async() { return nullptr; } |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
async_interface* async() { return experimental_async(); } |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
virtual class experimental_async_interface* experimental_async() { return nullptr; } |
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
|
virtual ::grpc::ClientAsyncResponseReaderInterface< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) = 0; |
|
|
@ -930,26 +753,23 @@ class ServiceB final { |
|
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>> PrepareAsyncMethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { |
|
|
|
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>> PrepareAsyncMethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) { |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>>(PrepareAsyncMethodB1Raw(context, request, cq)); |
|
|
|
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>>(PrepareAsyncMethodB1Raw(context, request, cq)); |
|
|
|
} |
|
|
|
} |
|
|
|
class experimental_async final : |
|
|
|
class async final : |
|
|
|
public StubInterface::experimental_async_interface { |
|
|
|
public StubInterface::async_interface { |
|
|
|
public: |
|
|
|
public: |
|
|
|
void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; |
|
|
|
void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, std::function<void(::grpc::Status)>) override; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; |
|
|
|
void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::ClientUnaryReactor* reactor) override; |
|
|
|
#else |
|
|
|
|
|
|
|
void MethodB1(::grpc::ClientContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
friend class Stub; |
|
|
|
friend class Stub; |
|
|
|
explicit experimental_async(Stub* stub): stub_(stub) { } |
|
|
|
explicit async(Stub* stub): stub_(stub) { } |
|
|
|
Stub* stub() { return stub_; } |
|
|
|
Stub* stub() { return stub_; } |
|
|
|
Stub* stub_; |
|
|
|
Stub* stub_; |
|
|
|
}; |
|
|
|
}; |
|
|
|
class experimental_async_interface* experimental_async() override { return &async_stub_; } |
|
|
|
class async* async() override { return experimental_async(); } |
|
|
|
|
|
|
|
class async* experimental_async() override { return &async_stub_; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
std::shared_ptr< ::grpc::ChannelInterface> channel_; |
|
|
|
std::shared_ptr< ::grpc::ChannelInterface> channel_; |
|
|
|
class experimental_async async_stub_{this}; |
|
|
|
class async async_stub_{this}; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* AsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
::grpc::ClientAsyncResponseReader< ::grpc::testing::Response>* PrepareAsyncMethodB1Raw(::grpc::ClientContext* context, const ::grpc::testing::Request& request, ::grpc::CompletionQueue* cq) override; |
|
|
|
const ::grpc::internal::RpcMethod rpcmethod_MethodB1_; |
|
|
|
const ::grpc::internal::RpcMethod rpcmethod_MethodB1_; |
|
|
@ -986,36 +806,22 @@ class ServiceB final { |
|
|
|
}; |
|
|
|
}; |
|
|
|
typedef WithAsyncMethod_MethodB1<Service > AsyncService; |
|
|
|
typedef WithAsyncMethod_MethodB1<Service > AsyncService; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithCallbackMethod_MethodB1 : public BaseClass { |
|
|
|
class WithCallbackMethod_MethodB1 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithCallbackMethod_MethodB1() { |
|
|
|
WithCallbackMethod_MethodB1() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodCallback(0, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodCallback(0, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) { return this->MethodB1(context, request, response); }));} |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, const ::grpc::testing::Request* request, ::grpc::testing::Response* response) { return this->MethodB1(context, request, response); }));} |
|
|
|
|
|
|
|
void SetMessageAllocatorFor_MethodB1( |
|
|
|
void SetMessageAllocatorFor_MethodB1( |
|
|
|
::grpc::experimental::MessageAllocator< ::grpc::testing::Request, ::grpc::testing::Response>* allocator) { |
|
|
|
::grpc::MessageAllocator< ::grpc::testing::Request, ::grpc::testing::Response>* allocator) { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); |
|
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0); |
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::internal::MethodHandler* const handler = ::grpc::Service::experimental().GetHandler(0); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
static_cast<::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>*>(handler) |
|
|
|
static_cast<::grpc::internal::CallbackUnaryHandler< ::grpc::testing::Request, ::grpc::testing::Response>*>(handler) |
|
|
|
->SetMessageAllocator(allocator); |
|
|
|
->SetMessageAllocator(allocator); |
|
|
|
} |
|
|
|
} |
|
|
|
~ExperimentalWithCallbackMethod_MethodB1() override { |
|
|
|
~WithCallbackMethod_MethodB1() override { |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -1023,20 +829,11 @@ class ServiceB final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodB1( |
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodB1( |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerUnaryReactor* MethodB1( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::testing::Request* /*request*/, ::grpc::testing::Response* /*response*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
typedef WithCallbackMethod_MethodB1<Service > CallbackService; |
|
|
|
typedef ExperimentalWithCallbackMethod_MethodB1<Service > CallbackService; |
|
|
|
typedef CallbackService ExperimentalCallbackService; |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef ExperimentalWithCallbackMethod_MethodB1<Service > ExperimentalCallbackService; |
|
|
|
|
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class WithGenericMethod_MethodB1 : public BaseClass { |
|
|
|
class WithGenericMethod_MethodB1 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
@ -1075,27 +872,17 @@ class ServiceB final { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class ExperimentalWithRawCallbackMethod_MethodB1 : public BaseClass { |
|
|
|
class WithRawCallbackMethod_MethodB1 : public BaseClass { |
|
|
|
private: |
|
|
|
private: |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} |
|
|
|
public: |
|
|
|
public: |
|
|
|
ExperimentalWithRawCallbackMethod_MethodB1() { |
|
|
|
WithRawCallbackMethod_MethodB1() { |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::Service::MarkMethodRawCallback(0, |
|
|
|
::grpc::Service:: |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
::grpc::Service::experimental(). |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MarkMethodRawCallback(0, |
|
|
|
|
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( |
|
|
|
[this]( |
|
|
|
[this]( |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MethodB1(context, request, response); })); |
|
|
|
::grpc::CallbackServerContext* |
|
|
|
} |
|
|
|
#else |
|
|
|
~WithRawCallbackMethod_MethodB1() override { |
|
|
|
::grpc::experimental::CallbackServerContext* |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->MethodB1(context, request, response); })); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
~ExperimentalWithRawCallbackMethod_MethodB1() override { |
|
|
|
|
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
BaseClassMustBeDerivedFromService(this); |
|
|
|
} |
|
|
|
} |
|
|
|
// disable synchronous version of this method |
|
|
|
// disable synchronous version of this method |
|
|
@ -1103,14 +890,8 @@ class ServiceB final { |
|
|
|
abort(); |
|
|
|
abort(); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL |
|
|
|
|
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodB1( |
|
|
|
virtual ::grpc::ServerUnaryReactor* MethodB1( |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
|
|
|
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; } |
|
|
|
#else |
|
|
|
|
|
|
|
virtual ::grpc::experimental::ServerUnaryReactor* MethodB1( |
|
|
|
|
|
|
|
::grpc::experimental::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
{ return nullptr; } |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
template <class BaseClass> |
|
|
|
template <class BaseClass> |
|
|
|
class WithStreamedUnaryMethod_MethodB1 : public BaseClass { |
|
|
|
class WithStreamedUnaryMethod_MethodB1 : public BaseClass { |
|
|
|