testservice.grpc.pb.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // Generated by the gRPC C++ plugin.
  2. // If you make any local change, they will be lost.
  3. // source: testservice.proto
  4. #ifndef GRPC_testservice_2eproto__INCLUDED
  5. #define GRPC_testservice_2eproto__INCLUDED
  6. #include "testservice.pb.h"
  7. #include <grpcpp/impl/codegen/async_generic_service.h>
  8. #include <grpcpp/impl/codegen/async_stream.h>
  9. #include <grpcpp/impl/codegen/async_unary_call.h>
  10. #include <grpcpp/impl/codegen/method_handler_impl.h>
  11. #include <grpcpp/impl/codegen/proto_utils.h>
  12. #include <grpcpp/impl/codegen/rpc_method.h>
  13. #include <grpcpp/impl/codegen/service_type.h>
  14. #include <grpcpp/impl/codegen/status.h>
  15. #include <grpcpp/impl/codegen/stub_options.h>
  16. #include <grpcpp/impl/codegen/sync_stream.h>
  17. namespace grpc {
  18. class CompletionQueue;
  19. class Channel;
  20. class ServerCompletionQueue;
  21. class ServerContext;
  22. } // namespace grpc
  23. namespace qtprotobufnamespace {
  24. namespace tests {
  25. class TestService final {
  26. public:
  27. static constexpr char const* service_full_name() {
  28. return "qtprotobufnamespace.tests.TestService";
  29. }
  30. class StubInterface {
  31. public:
  32. virtual ~StubInterface() {}
  33. virtual ::grpc::Status testMethod(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::qtprotobufnamespace::tests::SimpleStringMessage* response) = 0;
  34. std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::qtprotobufnamespace::tests::SimpleStringMessage>> AsynctestMethod(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) {
  35. return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::qtprotobufnamespace::tests::SimpleStringMessage>>(AsynctestMethodRaw(context, request, cq));
  36. }
  37. std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::qtprotobufnamespace::tests::SimpleStringMessage>> PrepareAsynctestMethod(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) {
  38. return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::qtprotobufnamespace::tests::SimpleStringMessage>>(PrepareAsynctestMethodRaw(context, request, cq));
  39. }
  40. private:
  41. virtual ::grpc::ClientAsyncResponseReaderInterface< ::qtprotobufnamespace::tests::SimpleStringMessage>* AsynctestMethodRaw(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) = 0;
  42. virtual ::grpc::ClientAsyncResponseReaderInterface< ::qtprotobufnamespace::tests::SimpleStringMessage>* PrepareAsynctestMethodRaw(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) = 0;
  43. };
  44. class Stub final : public StubInterface {
  45. public:
  46. Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel);
  47. ::grpc::Status testMethod(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::qtprotobufnamespace::tests::SimpleStringMessage* response) override;
  48. std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::qtprotobufnamespace::tests::SimpleStringMessage>> AsynctestMethod(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) {
  49. return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::qtprotobufnamespace::tests::SimpleStringMessage>>(AsynctestMethodRaw(context, request, cq));
  50. }
  51. std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::qtprotobufnamespace::tests::SimpleStringMessage>> PrepareAsynctestMethod(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) {
  52. return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::qtprotobufnamespace::tests::SimpleStringMessage>>(PrepareAsynctestMethodRaw(context, request, cq));
  53. }
  54. private:
  55. std::shared_ptr< ::grpc::ChannelInterface> channel_;
  56. ::grpc::ClientAsyncResponseReader< ::qtprotobufnamespace::tests::SimpleStringMessage>* AsynctestMethodRaw(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) override;
  57. ::grpc::ClientAsyncResponseReader< ::qtprotobufnamespace::tests::SimpleStringMessage>* PrepareAsynctestMethodRaw(::grpc::ClientContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage& request, ::grpc::CompletionQueue* cq) override;
  58. const ::grpc::internal::RpcMethod rpcmethod_testMethod_;
  59. };
  60. static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
  61. class Service : public ::grpc::Service {
  62. public:
  63. Service();
  64. virtual ~Service();
  65. virtual ::grpc::Status testMethod(::grpc::ServerContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage* request, ::qtprotobufnamespace::tests::SimpleStringMessage* response);
  66. };
  67. template <class BaseClass>
  68. class WithAsyncMethod_testMethod : public BaseClass {
  69. private:
  70. void BaseClassMustBeDerivedFromService(const Service *service) {}
  71. public:
  72. WithAsyncMethod_testMethod() {
  73. ::grpc::Service::MarkMethodAsync(0);
  74. }
  75. ~WithAsyncMethod_testMethod() override {
  76. BaseClassMustBeDerivedFromService(this);
  77. }
  78. // disable synchronous version of this method
  79. ::grpc::Status testMethod(::grpc::ServerContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage* request, ::qtprotobufnamespace::tests::SimpleStringMessage* response) override {
  80. abort();
  81. return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
  82. }
  83. void RequesttestMethod(::grpc::ServerContext* context, ::qtprotobufnamespace::tests::SimpleStringMessage* request, ::grpc::ServerAsyncResponseWriter< ::qtprotobufnamespace::tests::SimpleStringMessage>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
  84. ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
  85. }
  86. };
  87. typedef WithAsyncMethod_testMethod<Service > AsyncService;
  88. template <class BaseClass>
  89. class WithGenericMethod_testMethod : public BaseClass {
  90. private:
  91. void BaseClassMustBeDerivedFromService(const Service *service) {}
  92. public:
  93. WithGenericMethod_testMethod() {
  94. ::grpc::Service::MarkMethodGeneric(0);
  95. }
  96. ~WithGenericMethod_testMethod() override {
  97. BaseClassMustBeDerivedFromService(this);
  98. }
  99. // disable synchronous version of this method
  100. ::grpc::Status testMethod(::grpc::ServerContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage* request, ::qtprotobufnamespace::tests::SimpleStringMessage* response) override {
  101. abort();
  102. return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
  103. }
  104. };
  105. template <class BaseClass>
  106. class WithRawMethod_testMethod : public BaseClass {
  107. private:
  108. void BaseClassMustBeDerivedFromService(const Service *service) {}
  109. public:
  110. WithRawMethod_testMethod() {
  111. ::grpc::Service::MarkMethodRaw(0);
  112. }
  113. ~WithRawMethod_testMethod() override {
  114. BaseClassMustBeDerivedFromService(this);
  115. }
  116. // disable synchronous version of this method
  117. ::grpc::Status testMethod(::grpc::ServerContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage* request, ::qtprotobufnamespace::tests::SimpleStringMessage* response) override {
  118. abort();
  119. return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
  120. }
  121. void RequesttestMethod(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
  122. ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
  123. }
  124. };
  125. template <class BaseClass>
  126. class WithStreamedUnaryMethod_testMethod : public BaseClass {
  127. private:
  128. void BaseClassMustBeDerivedFromService(const Service *service) {}
  129. public:
  130. WithStreamedUnaryMethod_testMethod() {
  131. ::grpc::Service::MarkMethodStreamed(0,
  132. new ::grpc::internal::StreamedUnaryHandler< ::qtprotobufnamespace::tests::SimpleStringMessage, ::qtprotobufnamespace::tests::SimpleStringMessage>(std::bind(&WithStreamedUnaryMethod_testMethod<BaseClass>::StreamedtestMethod, this, std::placeholders::_1, std::placeholders::_2)));
  133. }
  134. ~WithStreamedUnaryMethod_testMethod() override {
  135. BaseClassMustBeDerivedFromService(this);
  136. }
  137. // disable regular version of this method
  138. ::grpc::Status testMethod(::grpc::ServerContext* context, const ::qtprotobufnamespace::tests::SimpleStringMessage* request, ::qtprotobufnamespace::tests::SimpleStringMessage* response) override {
  139. abort();
  140. return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
  141. }
  142. // replace default version of method with streamed unary
  143. virtual ::grpc::Status StreamedtestMethod(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::qtprotobufnamespace::tests::SimpleStringMessage,::qtprotobufnamespace::tests::SimpleStringMessage>* server_unary_streamer) = 0;
  144. };
  145. typedef WithStreamedUnaryMethod_testMethod<Service > StreamedUnaryService;
  146. typedef Service SplitStreamedService;
  147. typedef WithStreamedUnaryMethod_testMethod<Service > StreamedService;
  148. };
  149. } // namespace tests
  150. } // namespace qtprotobufnamespace
  151. #endif // GRPC_testservice_2eproto__INCLUDED