• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated by the gRPC C++ 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 namespace MyGame {
17 namespace Example {
18 
19 static const char* MonsterStorage_method_names[] = {
20   "/MyGame.Example.MonsterStorage/Store",
21   "/MyGame.Example.MonsterStorage/Retrieve",
22   "/MyGame.Example.MonsterStorage/GetMaxHitPoint",
23   "/MyGame.Example.MonsterStorage/GetMinMaxHitPoints",
24 };
25 
NewStub(const std::shared_ptr<::grpc::ChannelInterface> & channel,const::grpc::StubOptions & options)26 std::unique_ptr< MonsterStorage::Stub> MonsterStorage::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
27   std::unique_ptr< MonsterStorage::Stub> stub(new MonsterStorage::Stub(channel));
28   return stub;
29 }
30 
Stub(const std::shared_ptr<::grpc::ChannelInterface> & channel)31 MonsterStorage::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel)
32   : channel_(channel)  , rpcmethod_Store_(MonsterStorage_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
33   , rpcmethod_Retrieve_(MonsterStorage_method_names[1], ::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
34   , rpcmethod_GetMaxHitPoint_(MonsterStorage_method_names[2], ::grpc::internal::RpcMethod::CLIENT_STREAMING, channel)
35   , rpcmethod_GetMinMaxHitPoints_(MonsterStorage_method_names[3], ::grpc::internal::RpcMethod::BIDI_STREAMING, channel)
36   {}
37 
Store(::grpc::ClientContext * context,const flatbuffers::grpc::Message<Monster> & request,flatbuffers::grpc::Message<Stat> * response)38 ::grpc::Status MonsterStorage::Stub::Store(::grpc::ClientContext* context, const flatbuffers::grpc::Message<Monster>& request, flatbuffers::grpc::Message<Stat>* response) {
39   return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Store_, context, request, response);
40 }
41 
AsyncStoreRaw(::grpc::ClientContext * context,const flatbuffers::grpc::Message<Monster> & request,::grpc::CompletionQueue * cq)42 ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<Stat>>* MonsterStorage::Stub::AsyncStoreRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<Monster>& request, ::grpc::CompletionQueue* cq) {
43   return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<Stat>>::Create(channel_.get(), cq, rpcmethod_Store_, context, request, true);
44 }
45 
PrepareAsyncStoreRaw(::grpc::ClientContext * context,const flatbuffers::grpc::Message<Monster> & request,::grpc::CompletionQueue * cq)46 ::grpc::ClientAsyncResponseReader< flatbuffers::grpc::Message<Stat>>* MonsterStorage::Stub::PrepareAsyncStoreRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<Monster>& request, ::grpc::CompletionQueue* cq) {
47   return ::grpc::internal::ClientAsyncResponseReaderFactory< flatbuffers::grpc::Message<Stat>>::Create(channel_.get(), cq, rpcmethod_Store_, context, request, false);
48 }
49 
RetrieveRaw(::grpc::ClientContext * context,const flatbuffers::grpc::Message<Stat> & request)50 ::grpc::ClientReader< flatbuffers::grpc::Message<Monster>>* MonsterStorage::Stub::RetrieveRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<Stat>& request) {
51   return ::grpc::internal::ClientReaderFactory< flatbuffers::grpc::Message<Monster>>::Create(channel_.get(), rpcmethod_Retrieve_, context, request);
52 }
53 
AsyncRetrieveRaw(::grpc::ClientContext * context,const flatbuffers::grpc::Message<Stat> & request,::grpc::CompletionQueue * cq,void * tag)54 ::grpc::ClientAsyncReader< flatbuffers::grpc::Message<Monster>>* MonsterStorage::Stub::AsyncRetrieveRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<Stat>& request, ::grpc::CompletionQueue* cq, void* tag) {
55   return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message<Monster>>::Create(channel_.get(), cq, rpcmethod_Retrieve_, context, request, true, tag);
56 }
57 
PrepareAsyncRetrieveRaw(::grpc::ClientContext * context,const flatbuffers::grpc::Message<Stat> & request,::grpc::CompletionQueue * cq)58 ::grpc::ClientAsyncReader< flatbuffers::grpc::Message<Monster>>* MonsterStorage::Stub::PrepareAsyncRetrieveRaw(::grpc::ClientContext* context, const flatbuffers::grpc::Message<Stat>& request, ::grpc::CompletionQueue* cq) {
59   return ::grpc::internal::ClientAsyncReaderFactory< flatbuffers::grpc::Message<Monster>>::Create(channel_.get(), cq, rpcmethod_Retrieve_, context, request, false, nullptr);
60 }
61 
GetMaxHitPointRaw(::grpc::ClientContext * context,flatbuffers::grpc::Message<Stat> * response)62 ::grpc::ClientWriter< flatbuffers::grpc::Message<Monster>>* MonsterStorage::Stub::GetMaxHitPointRaw(::grpc::ClientContext* context, flatbuffers::grpc::Message<Stat>* response) {
63   return ::grpc::internal::ClientWriterFactory< flatbuffers::grpc::Message<Monster>>::Create(channel_.get(), rpcmethod_GetMaxHitPoint_, context, response);
64 }
65 
AsyncGetMaxHitPointRaw(::grpc::ClientContext * context,flatbuffers::grpc::Message<Stat> * response,::grpc::CompletionQueue * cq,void * tag)66 ::grpc::ClientAsyncWriter< flatbuffers::grpc::Message<Monster>>* MonsterStorage::Stub::AsyncGetMaxHitPointRaw(::grpc::ClientContext* context, flatbuffers::grpc::Message<Stat>* response, ::grpc::CompletionQueue* cq, void* tag) {
67   return ::grpc::internal::ClientAsyncWriterFactory< flatbuffers::grpc::Message<Monster>>::Create(channel_.get(), cq, rpcmethod_GetMaxHitPoint_, context, response, true, tag);
68 }
69 
PrepareAsyncGetMaxHitPointRaw(::grpc::ClientContext * context,flatbuffers::grpc::Message<Stat> * response,::grpc::CompletionQueue * cq)70 ::grpc::ClientAsyncWriter< flatbuffers::grpc::Message<Monster>>* MonsterStorage::Stub::PrepareAsyncGetMaxHitPointRaw(::grpc::ClientContext* context, flatbuffers::grpc::Message<Stat>* response, ::grpc::CompletionQueue* cq) {
71   return ::grpc::internal::ClientAsyncWriterFactory< flatbuffers::grpc::Message<Monster>>::Create(channel_.get(), cq, rpcmethod_GetMaxHitPoint_, context, response, false, nullptr);
72 }
73 
GetMinMaxHitPointsRaw(::grpc::ClientContext * context)74 ::grpc::ClientReaderWriter< flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>* MonsterStorage::Stub::GetMinMaxHitPointsRaw(::grpc::ClientContext* context) {
75   return ::grpc::internal::ClientReaderWriterFactory< flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>::Create(channel_.get(), rpcmethod_GetMinMaxHitPoints_, context);
76 }
77 
AsyncGetMinMaxHitPointsRaw(::grpc::ClientContext * context,::grpc::CompletionQueue * cq,void * tag)78 ::grpc::ClientAsyncReaderWriter< flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>* MonsterStorage::Stub::AsyncGetMinMaxHitPointsRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
79   return ::grpc::internal::ClientAsyncReaderWriterFactory< flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>::Create(channel_.get(), cq, rpcmethod_GetMinMaxHitPoints_, context, true, tag);
80 }
81 
PrepareAsyncGetMinMaxHitPointsRaw(::grpc::ClientContext * context,::grpc::CompletionQueue * cq)82 ::grpc::ClientAsyncReaderWriter< flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>* MonsterStorage::Stub::PrepareAsyncGetMinMaxHitPointsRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) {
83   return ::grpc::internal::ClientAsyncReaderWriterFactory< flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>::Create(channel_.get(), cq, rpcmethod_GetMinMaxHitPoints_, context, false, nullptr);
84 }
85 
Service()86 MonsterStorage::Service::Service() {
87   AddMethod(new ::grpc::internal::RpcServiceMethod(
88       MonsterStorage_method_names[0],
89       ::grpc::internal::RpcMethod::NORMAL_RPC,
90       new ::grpc::internal::RpcMethodHandler< MonsterStorage::Service, flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>(
91           std::mem_fn(&MonsterStorage::Service::Store), this)));
92   AddMethod(new ::grpc::internal::RpcServiceMethod(
93       MonsterStorage_method_names[1],
94       ::grpc::internal::RpcMethod::SERVER_STREAMING,
95       new ::grpc::internal::ServerStreamingHandler< MonsterStorage::Service, flatbuffers::grpc::Message<Stat>, flatbuffers::grpc::Message<Monster>>(
96           std::mem_fn(&MonsterStorage::Service::Retrieve), this)));
97   AddMethod(new ::grpc::internal::RpcServiceMethod(
98       MonsterStorage_method_names[2],
99       ::grpc::internal::RpcMethod::CLIENT_STREAMING,
100       new ::grpc::internal::ClientStreamingHandler< MonsterStorage::Service, flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>(
101           std::mem_fn(&MonsterStorage::Service::GetMaxHitPoint), this)));
102   AddMethod(new ::grpc::internal::RpcServiceMethod(
103       MonsterStorage_method_names[3],
104       ::grpc::internal::RpcMethod::BIDI_STREAMING,
105       new ::grpc::internal::BidiStreamingHandler< MonsterStorage::Service, flatbuffers::grpc::Message<Monster>, flatbuffers::grpc::Message<Stat>>(
106           std::mem_fn(&MonsterStorage::Service::GetMinMaxHitPoints), this)));
107 }
108 
~Service()109 MonsterStorage::Service::~Service() {
110 }
111 
Store(::grpc::ServerContext * context,const flatbuffers::grpc::Message<Monster> * request,flatbuffers::grpc::Message<Stat> * response)112 ::grpc::Status MonsterStorage::Service::Store(::grpc::ServerContext* context, const flatbuffers::grpc::Message<Monster>* request, flatbuffers::grpc::Message<Stat>* response) {
113   (void) context;
114   (void) request;
115   (void) response;
116   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
117 }
118 
Retrieve(::grpc::ServerContext * context,const flatbuffers::grpc::Message<Stat> * request,::grpc::ServerWriter<flatbuffers::grpc::Message<Monster>> * writer)119 ::grpc::Status MonsterStorage::Service::Retrieve(::grpc::ServerContext* context, const flatbuffers::grpc::Message<Stat>* request, ::grpc::ServerWriter< flatbuffers::grpc::Message<Monster>>* writer) {
120   (void) context;
121   (void) request;
122   (void) writer;
123   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
124 }
125 
GetMaxHitPoint(::grpc::ServerContext * context,::grpc::ServerReader<flatbuffers::grpc::Message<Monster>> * reader,flatbuffers::grpc::Message<Stat> * response)126 ::grpc::Status MonsterStorage::Service::GetMaxHitPoint(::grpc::ServerContext* context, ::grpc::ServerReader< flatbuffers::grpc::Message<Monster>>* reader, flatbuffers::grpc::Message<Stat>* response) {
127   (void) context;
128   (void) reader;
129   (void) response;
130   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
131 }
132 
GetMinMaxHitPoints(::grpc::ServerContext * context,::grpc::ServerReaderWriter<flatbuffers::grpc::Message<Stat>,flatbuffers::grpc::Message<Monster>> * stream)133 ::grpc::Status MonsterStorage::Service::GetMinMaxHitPoints(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< flatbuffers::grpc::Message<Stat>, flatbuffers::grpc::Message<Monster>>* stream) {
134   (void) context;
135   (void) stream;
136   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
137 }
138 
139 
140 }  // namespace MyGame
141 }  // namespace Example
142 
143