diff options
Diffstat (limited to 'include/grpc++/impl/service_type.h')
-rw-r--r-- | include/grpc++/impl/service_type.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/grpc++/impl/service_type.h b/include/grpc++/impl/service_type.h index 96b42c94fe..655aa91cdc 100644 --- a/include/grpc++/impl/service_type.h +++ b/include/grpc++/impl/service_type.h @@ -61,6 +61,7 @@ class ServerAsyncStreamingInterface { class Service { public: + Service() : server_(nullptr) {} virtual ~Service() {} bool has_async_methods() const { @@ -117,6 +118,18 @@ class Service { notification_cq, tag); } + void AddMethod(RpcServiceMethod* method) { methods_.emplace_back(method); } + + void MarkMethodAsync(const grpc::string& method_name) { + for (auto it = methods_.begin(); it != methods_.end(); ++it) { + if ((*it)->name() == method_name) { + (*it)->ResetHandler(); + return; + } + } + abort(); + } + private: friend class Server; |