1 Star 1 Fork 6

满天星/grpc-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hello.grpc.pb.h 10.46 KB
一键复制 编辑 原始数据 按行查看 历史
mantianrong 提交于 2022-12-23 17:05 . init
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: hello.proto
#ifndef GRPC_hello_2eproto__INCLUDED
#define GRPC_hello_2eproto__INCLUDED
#include "hello.pb.h"
#include <functional>
#include <grpcpp/impl/codegen/async_generic_service.h>
#include <grpcpp/impl/codegen/async_stream.h>
#include <grpcpp/impl/codegen/async_unary_call.h>
#include <grpcpp/impl/codegen/client_callback.h>
#include <grpcpp/impl/codegen/client_context.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/impl/codegen/message_allocator.h>
#include <grpcpp/impl/codegen/method_handler.h>
#include <grpcpp/impl/codegen/proto_utils.h>
#include <grpcpp/impl/codegen/rpc_method.h>
#include <grpcpp/impl/codegen/server_callback.h>
#include <grpcpp/impl/codegen/server_callback_handlers.h>
#include <grpcpp/impl/codegen/server_context.h>
#include <grpcpp/impl/codegen/service_type.h>
#include <grpcpp/impl/codegen/status.h>
#include <grpcpp/impl/codegen/stub_options.h>
#include <grpcpp/impl/codegen/sync_stream.h>
namespace hello {
class HelloService final {
public:
static constexpr char const* service_full_name() {
return "hello.HelloService";
}
class StubInterface {
public:
virtual ~StubInterface() {}
std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>> hello(::grpc::ClientContext* context) {
return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>>(helloRaw(context));
}
std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>> Asynchello(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>>(AsynchelloRaw(context, cq, tag));
}
std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>> PrepareAsynchello(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>>(PrepareAsynchelloRaw(context, cq));
}
class async_interface {
public:
virtual ~async_interface() {}
virtual void hello(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::hello::HelloMsg,::hello::HelloMsg>* reactor) = 0;
};
typedef class async_interface experimental_async_interface;
virtual class async_interface* async() { return nullptr; }
class async_interface* experimental_async() { return async(); }
private:
virtual ::grpc::ClientReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>* helloRaw(::grpc::ClientContext* context) = 0;
virtual ::grpc::ClientAsyncReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>* AsynchelloRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0;
virtual ::grpc::ClientAsyncReaderWriterInterface< ::hello::HelloMsg, ::hello::HelloMsg>* PrepareAsynchelloRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0;
};
class Stub final : public StubInterface {
public:
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
std::unique_ptr< ::grpc::ClientReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>> hello(::grpc::ClientContext* context) {
return std::unique_ptr< ::grpc::ClientReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>>(helloRaw(context));
}
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>> Asynchello(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>>(AsynchelloRaw(context, cq, tag));
}
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>> PrepareAsynchello(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>>(PrepareAsynchelloRaw(context, cq));
}
class async final :
public StubInterface::async_interface {
public:
void hello(::grpc::ClientContext* context, ::grpc::ClientBidiReactor< ::hello::HelloMsg,::hello::HelloMsg>* reactor) override;
private:
friend class Stub;
explicit async(Stub* stub): stub_(stub) { }
Stub* stub() { return stub_; }
Stub* stub_;
};
class async* async() override { return &async_stub_; }
private:
std::shared_ptr< ::grpc::ChannelInterface> channel_;
class async async_stub_{this};
::grpc::ClientReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* helloRaw(::grpc::ClientContext* context) override;
::grpc::ClientAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* AsynchelloRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override;
::grpc::ClientAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* PrepareAsynchelloRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override;
const ::grpc::internal::RpcMethod rpcmethod_hello_;
};
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
class Service : public ::grpc::Service {
public:
Service();
virtual ~Service();
virtual ::grpc::Status hello(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* stream);
};
template <class BaseClass>
class WithAsyncMethod_hello : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithAsyncMethod_hello() {
::grpc::Service::MarkMethodAsync(0);
}
~WithAsyncMethod_hello() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status hello(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* /*stream*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void Requesthello(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag);
}
};
typedef WithAsyncMethod_hello<Service > AsyncService;
template <class BaseClass>
class WithCallbackMethod_hello : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithCallbackMethod_hello() {
::grpc::Service::MarkMethodCallback(0,
new ::grpc::internal::CallbackBidiHandler< ::hello::HelloMsg, ::hello::HelloMsg>(
[this](
::grpc::CallbackServerContext* context) { return this->hello(context); }));
}
~WithCallbackMethod_hello() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status hello(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* /*stream*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerBidiReactor< ::hello::HelloMsg, ::hello::HelloMsg>* hello(
::grpc::CallbackServerContext* /*context*/)
{ return nullptr; }
};
typedef WithCallbackMethod_hello<Service > CallbackService;
typedef CallbackService ExperimentalCallbackService;
template <class BaseClass>
class WithGenericMethod_hello : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithGenericMethod_hello() {
::grpc::Service::MarkMethodGeneric(0);
}
~WithGenericMethod_hello() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status hello(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* /*stream*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
template <class BaseClass>
class WithRawMethod_hello : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawMethod_hello() {
::grpc::Service::MarkMethodRaw(0);
}
~WithRawMethod_hello() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status hello(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* /*stream*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void Requesthello(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithRawCallbackMethod_hello : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawCallbackMethod_hello() {
::grpc::Service::MarkMethodRawCallback(0,
new ::grpc::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
[this](
::grpc::CallbackServerContext* context) { return this->hello(context); }));
}
~WithRawCallbackMethod_hello() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status hello(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::hello::HelloMsg, ::hello::HelloMsg>* /*stream*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* hello(
::grpc::CallbackServerContext* /*context*/)
{ return nullptr; }
};
typedef Service StreamedUnaryService;
typedef Service SplitStreamedService;
typedef Service StreamedService;
};
} // namespace hello
#endif // GRPC_hello_2eproto__INCLUDED
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/evilskyman/grpc-demo.git
[email protected]:evilskyman/grpc-demo.git
evilskyman
grpc-demo
grpc-demo
master

搜索帮助