• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated by the gRPC protobuf plugin.
2 // If you make any local change, they will be lost.
3 // source: monster_test
4 
5 #include "monster_test_generated.h"
6 #include "monster_test.grpc.fb.h"
7 
8 #include <grpc++/impl/codegen/async_stream.h>
9 #include <grpc++/impl/codegen/async_unary_call.h>
10 #include <grpc++/impl/codegen/channel_interface.h>
11 #include <grpc++/impl/codegen/client_unary_call.h>
12 #include <grpc++/impl/codegen/method_handler_impl.h>
13 #include <grpc++/impl/codegen/rpc_service_method.h>
14 #include <grpc++/impl/codegen/service_type.h>
15 #include <grpc++/impl/codegen/sync_stream.h>
16 
17 namespace MyGame {
18 namespace Example {
19 
20 static const char* MonsterStorage_method_names[] = {
21   "/MyGame.Example.MonsterStorage/Store",
22   "/MyGame.Example.MonsterStorage/Retrieve",
23 };
24 
NewStub(const std::shared_ptr<::grpc::ChannelInterface> & channel,const::grpc::StubOptions & options)25 std::unique_ptr< MonsterStorage::Stub> MonsterStorage::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
26   std::unique_ptr< MonsterStorage::Stub> stub(new MonsterStorage::Stub(channel));
27   return stub;
28 }
29 
Stub(const std::shared_ptr<::grpc::ChannelInterface> & channel)30 MonsterStorage::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel)
31   : channel_(channel)  , rpcmethod_Store_(MonsterStorage_method_names[0], ::grpc::RpcMethod::NORMAL_RPC, channel)
32   , rpcmethod_Retrieve_(MonsterStorage_method_names[1], ::grpc::RpcMethod::SERVER_STREAMING, channel)
33   {}
34 
Store(::grpc::ClientContext * context,const flatbuffers::BufferRef<Monster> & request,flatbuffers::BufferRef<Stat> * response)35 ::grpc::Status MonsterStorage::Stub::Store(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, flatbuffers::BufferRef<Stat>* response) {
36   return ::grpc::BlockingUnaryCall(channel_.get(), rpcmethod_Store_, context, request, response);
37 }
38 
AsyncStoreRaw(::grpc::ClientContext * context,const flatbuffers::BufferRef<Monster> & request,::grpc::CompletionQueue * cq)39 ::grpc::ClientAsyncResponseReader< flatbuffers::BufferRef<Stat>>* MonsterStorage::Stub::AsyncStoreRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, ::grpc::CompletionQueue* cq) {
40   return new ::grpc::ClientAsyncResponseReader< flatbuffers::BufferRef<Stat>>(channel_.get(), cq, rpcmethod_Store_, context, request);
41 }
42 
RetrieveRaw(::grpc::ClientContext * context,const flatbuffers::BufferRef<Stat> & request)43 ::grpc::ClientReader< flatbuffers::BufferRef<Monster>>* MonsterStorage::Stub::RetrieveRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request) {
44   return new ::grpc::ClientReader< flatbuffers::BufferRef<Monster>>(channel_.get(), rpcmethod_Retrieve_, context, request);
45 }
46 
AsyncRetrieveRaw(::grpc::ClientContext * context,const flatbuffers::BufferRef<Stat> & request,::grpc::CompletionQueue * cq,void * tag)47 ::grpc::ClientAsyncReader< flatbuffers::BufferRef<Monster>>* MonsterStorage::Stub::AsyncRetrieveRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request, ::grpc::CompletionQueue* cq, void* tag) {
48   return new ::grpc::ClientAsyncReader< flatbuffers::BufferRef<Monster>>(channel_.get(), cq, rpcmethod_Retrieve_, context, request, tag);
49 }
50 
Service()51 MonsterStorage::Service::Service() {
52   (void)MonsterStorage_method_names;
53   AddMethod(new ::grpc::RpcServiceMethod(
54       MonsterStorage_method_names[0],
55       ::grpc::RpcMethod::NORMAL_RPC,
56       new ::grpc::RpcMethodHandler< MonsterStorage::Service, flatbuffers::BufferRef<Monster>, flatbuffers::BufferRef<Stat>>(
57           std::mem_fn(&MonsterStorage::Service::Store), this)));
58   AddMethod(new ::grpc::RpcServiceMethod(
59       MonsterStorage_method_names[1],
60       ::grpc::RpcMethod::SERVER_STREAMING,
61       new ::grpc::ServerStreamingHandler< MonsterStorage::Service, flatbuffers::BufferRef<Stat>, flatbuffers::BufferRef<Monster>>(
62           std::mem_fn(&MonsterStorage::Service::Retrieve), this)));
63 }
64 
~Service()65 MonsterStorage::Service::~Service() {
66 }
67 
Store(::grpc::ServerContext * context,const flatbuffers::BufferRef<Monster> * request,flatbuffers::BufferRef<Stat> * response)68 ::grpc::Status MonsterStorage::Service::Store(::grpc::ServerContext* context, const flatbuffers::BufferRef<Monster>* request, flatbuffers::BufferRef<Stat>* response) {
69   (void) context;
70   (void) request;
71   (void) response;
72   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
73 }
74 
Retrieve(::grpc::ServerContext * context,const flatbuffers::BufferRef<Stat> * request,::grpc::ServerWriter<flatbuffers::BufferRef<Monster>> * writer)75 ::grpc::Status MonsterStorage::Service::Retrieve(::grpc::ServerContext* context, const flatbuffers::BufferRef<Stat>* request, ::grpc::ServerWriter< flatbuffers::BufferRef<Monster>>* writer) {
76   (void) context;
77   (void) request;
78   (void) writer;
79   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
80 }
81 
82 
83 }  // namespace MyGame
84 }  // namespace Example
85 
86