1 // Generated by the gRPC protobuf plugin. 2 // If you make any local change, they will be lost. 3 // source: monster_test 4 #ifndef GRPC_monster_5ftest__INCLUDED 5 #define GRPC_monster_5ftest__INCLUDED 6 7 #include "monster_test_generated.h" 8 #include "flatbuffers/grpc.h" 9 10 #include <grpc++/impl/codegen/async_stream.h> 11 #include <grpc++/impl/codegen/async_unary_call.h> 12 #include <grpc++/impl/codegen/rpc_method.h> 13 #include <grpc++/impl/codegen/service_type.h> 14 #include <grpc++/impl/codegen/status.h> 15 #include <grpc++/impl/codegen/stub_options.h> 16 #include <grpc++/impl/codegen/sync_stream.h> 17 18 namespace grpc { 19 class CompletionQueue; 20 class Channel; 21 class RpcService; 22 class ServerCompletionQueue; 23 class ServerContext; 24 } // namespace grpc 25 26 namespace MyGame { 27 namespace Example { 28 29 class MonsterStorage GRPC_FINAL { 30 public: 31 class StubInterface { 32 public: ~StubInterface()33 virtual ~StubInterface() {} 34 virtual ::grpc::Status Store(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, flatbuffers::BufferRef<Stat>* response) = 0; AsyncStore(::grpc::ClientContext * context,const flatbuffers::BufferRef<Monster> & request,::grpc::CompletionQueue * cq)35 std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::BufferRef<Stat>>> AsyncStore(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, ::grpc::CompletionQueue* cq) { 36 return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::BufferRef<Stat>>>(AsyncStoreRaw(context, request, cq)); 37 } Retrieve(::grpc::ClientContext * context,const flatbuffers::BufferRef<Stat> & request)38 std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::BufferRef<Monster>>> Retrieve(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request) { 39 return std::unique_ptr< ::grpc::ClientReaderInterface< flatbuffers::BufferRef<Monster>>>(RetrieveRaw(context, request)); 40 } AsyncRetrieve(::grpc::ClientContext * context,const flatbuffers::BufferRef<Stat> & request,::grpc::CompletionQueue * cq,void * tag)41 std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::BufferRef<Monster>>> AsyncRetrieve(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request, ::grpc::CompletionQueue* cq, void* tag) { 42 return std::unique_ptr< ::grpc::ClientAsyncReaderInterface< flatbuffers::BufferRef<Monster>>>(AsyncRetrieveRaw(context, request, cq, tag)); 43 } 44 private: 45 virtual ::grpc::ClientAsyncResponseReaderInterface< flatbuffers::BufferRef<Stat>>* AsyncStoreRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, ::grpc::CompletionQueue* cq) = 0; 46 virtual ::grpc::ClientReaderInterface< flatbuffers::BufferRef<Monster>>* RetrieveRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request) = 0; 47 virtual ::grpc::ClientAsyncReaderInterface< flatbuffers::BufferRef<Monster>>* AsyncRetrieveRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request, ::grpc::CompletionQueue* cq, void* tag) = 0; 48 }; 49 class Stub GRPC_FINAL : public StubInterface { 50 public: 51 Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); 52 ::grpc::Status Store(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, flatbuffers::BufferRef<Stat>* response) GRPC_OVERRIDE; AsyncStore(::grpc::ClientContext * context,const flatbuffers::BufferRef<Monster> & request,::grpc::CompletionQueue * cq)53 std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::BufferRef<Stat>>> AsyncStore(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, ::grpc::CompletionQueue* cq) { 54 return std::unique_ptr< ::grpc::ClientAsyncResponseReader< flatbuffers::BufferRef<Stat>>>(AsyncStoreRaw(context, request, cq)); 55 } Retrieve(::grpc::ClientContext * context,const flatbuffers::BufferRef<Stat> & request)56 std::unique_ptr< ::grpc::ClientReader< flatbuffers::BufferRef<Monster>>> Retrieve(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request) { 57 return std::unique_ptr< ::grpc::ClientReader< flatbuffers::BufferRef<Monster>>>(RetrieveRaw(context, request)); 58 } AsyncRetrieve(::grpc::ClientContext * context,const flatbuffers::BufferRef<Stat> & request,::grpc::CompletionQueue * cq,void * tag)59 std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::BufferRef<Monster>>> AsyncRetrieve(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request, ::grpc::CompletionQueue* cq, void* tag) { 60 return std::unique_ptr< ::grpc::ClientAsyncReader< flatbuffers::BufferRef<Monster>>>(AsyncRetrieveRaw(context, request, cq, tag)); 61 } 62 63 private: 64 std::shared_ptr< ::grpc::ChannelInterface> channel_; 65 ::grpc::ClientAsyncResponseReader< flatbuffers::BufferRef<Stat>>* AsyncStoreRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Monster>& request, ::grpc::CompletionQueue* cq) GRPC_OVERRIDE; 66 ::grpc::ClientReader< flatbuffers::BufferRef<Monster>>* RetrieveRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request) GRPC_OVERRIDE; 67 ::grpc::ClientAsyncReader< flatbuffers::BufferRef<Monster>>* AsyncRetrieveRaw(::grpc::ClientContext* context, const flatbuffers::BufferRef<Stat>& request, ::grpc::CompletionQueue* cq, void* tag) GRPC_OVERRIDE; 68 const ::grpc::RpcMethod rpcmethod_Store_; 69 const ::grpc::RpcMethod rpcmethod_Retrieve_; 70 }; 71 static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); 72 73 class Service : public ::grpc::Service { 74 public: 75 Service(); 76 virtual ~Service(); 77 virtual ::grpc::Status Store(::grpc::ServerContext* context, const flatbuffers::BufferRef<Monster>* request, flatbuffers::BufferRef<Stat>* response); 78 virtual ::grpc::Status Retrieve(::grpc::ServerContext* context, const flatbuffers::BufferRef<Stat>* request, ::grpc::ServerWriter< flatbuffers::BufferRef<Monster>>* writer); 79 }; 80 template <class BaseClass> 81 class WithAsyncMethod_Store : public BaseClass { 82 private: BaseClassMustBeDerivedFromService(const Service * service)83 void BaseClassMustBeDerivedFromService(const Service *service) {} 84 public: WithAsyncMethod_Store()85 WithAsyncMethod_Store() { 86 ::grpc::Service::MarkMethodAsync(0); 87 } ~WithAsyncMethod_Store()88 ~WithAsyncMethod_Store() GRPC_OVERRIDE { 89 BaseClassMustBeDerivedFromService(this); 90 } 91 // disable synchronous version of this method Store(::grpc::ServerContext * context,const flatbuffers::BufferRef<Monster> * request,flatbuffers::BufferRef<Stat> * response)92 ::grpc::Status Store(::grpc::ServerContext* context, const flatbuffers::BufferRef<Monster>* request, flatbuffers::BufferRef<Stat>* response) GRPC_FINAL GRPC_OVERRIDE { 93 abort(); 94 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 95 } RequestStore(::grpc::ServerContext * context,flatbuffers::BufferRef<Monster> * request,::grpc::ServerAsyncResponseWriter<flatbuffers::BufferRef<Stat>> * response,::grpc::CompletionQueue * new_call_cq,::grpc::ServerCompletionQueue * notification_cq,void * tag)96 void RequestStore(::grpc::ServerContext* context, flatbuffers::BufferRef<Monster>* request, ::grpc::ServerAsyncResponseWriter< flatbuffers::BufferRef<Stat>>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 97 ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); 98 } 99 }; 100 template <class BaseClass> 101 class WithAsyncMethod_Retrieve : public BaseClass { 102 private: BaseClassMustBeDerivedFromService(const Service * service)103 void BaseClassMustBeDerivedFromService(const Service *service) {} 104 public: WithAsyncMethod_Retrieve()105 WithAsyncMethod_Retrieve() { 106 ::grpc::Service::MarkMethodAsync(1); 107 } ~WithAsyncMethod_Retrieve()108 ~WithAsyncMethod_Retrieve() GRPC_OVERRIDE { 109 BaseClassMustBeDerivedFromService(this); 110 } 111 // disable synchronous version of this method Retrieve(::grpc::ServerContext * context,const flatbuffers::BufferRef<Stat> * request,::grpc::ServerWriter<flatbuffers::BufferRef<Monster>> * writer)112 ::grpc::Status Retrieve(::grpc::ServerContext* context, const flatbuffers::BufferRef<Stat>* request, ::grpc::ServerWriter< flatbuffers::BufferRef<Monster>>* writer) GRPC_FINAL GRPC_OVERRIDE { 113 abort(); 114 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 115 } RequestRetrieve(::grpc::ServerContext * context,flatbuffers::BufferRef<Stat> * request,::grpc::ServerAsyncWriter<flatbuffers::BufferRef<Monster>> * writer,::grpc::CompletionQueue * new_call_cq,::grpc::ServerCompletionQueue * notification_cq,void * tag)116 void RequestRetrieve(::grpc::ServerContext* context, flatbuffers::BufferRef<Stat>* request, ::grpc::ServerAsyncWriter< flatbuffers::BufferRef<Monster>>* writer, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { 117 ::grpc::Service::RequestAsyncServerStreaming(1, context, request, writer, new_call_cq, notification_cq, tag); 118 } 119 }; 120 typedef WithAsyncMethod_Store< WithAsyncMethod_Retrieve< Service > > AsyncService; 121 template <class BaseClass> 122 class WithGenericMethod_Store : public BaseClass { 123 private: BaseClassMustBeDerivedFromService(const Service * service)124 void BaseClassMustBeDerivedFromService(const Service *service) {} 125 public: WithGenericMethod_Store()126 WithGenericMethod_Store() { 127 ::grpc::Service::MarkMethodGeneric(0); 128 } ~WithGenericMethod_Store()129 ~WithGenericMethod_Store() GRPC_OVERRIDE { 130 BaseClassMustBeDerivedFromService(this); 131 } 132 // disable synchronous version of this method Store(::grpc::ServerContext * context,const flatbuffers::BufferRef<Monster> * request,flatbuffers::BufferRef<Stat> * response)133 ::grpc::Status Store(::grpc::ServerContext* context, const flatbuffers::BufferRef<Monster>* request, flatbuffers::BufferRef<Stat>* response) GRPC_FINAL GRPC_OVERRIDE { 134 abort(); 135 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 136 } 137 }; 138 template <class BaseClass> 139 class WithGenericMethod_Retrieve : public BaseClass { 140 private: BaseClassMustBeDerivedFromService(const Service * service)141 void BaseClassMustBeDerivedFromService(const Service *service) {} 142 public: WithGenericMethod_Retrieve()143 WithGenericMethod_Retrieve() { 144 ::grpc::Service::MarkMethodGeneric(1); 145 } ~WithGenericMethod_Retrieve()146 ~WithGenericMethod_Retrieve() GRPC_OVERRIDE { 147 BaseClassMustBeDerivedFromService(this); 148 } 149 // disable synchronous version of this method Retrieve(::grpc::ServerContext * context,const flatbuffers::BufferRef<Stat> * request,::grpc::ServerWriter<flatbuffers::BufferRef<Monster>> * writer)150 ::grpc::Status Retrieve(::grpc::ServerContext* context, const flatbuffers::BufferRef<Stat>* request, ::grpc::ServerWriter< flatbuffers::BufferRef<Monster>>* writer) GRPC_FINAL GRPC_OVERRIDE { 151 abort(); 152 return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 153 } 154 }; 155 }; 156 157 } // namespace Example 158 } // namespace MyGame 159 160 161 #endif // GRPC_monster_5ftest__INCLUDED 162