aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl/rpc_method.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grpc++/impl/rpc_method.h')
-rw-r--r--include/grpc++/impl/rpc_method.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/grpc++/impl/rpc_method.h b/include/grpc++/impl/rpc_method.h
index 50a160b08c..9800268062 100644
--- a/include/grpc++/impl/rpc_method.h
+++ b/include/grpc++/impl/rpc_method.h
@@ -34,6 +34,10 @@
#ifndef GRPCXX_IMPL_RPC_METHOD_H
#define GRPCXX_IMPL_RPC_METHOD_H
+#include <memory>
+
+#include <grpc++/channel.h>
+
namespace grpc {
class RpcMethod {
@@ -45,8 +49,14 @@ class RpcMethod {
BIDI_STREAMING
};
- RpcMethod(const char* name, RpcType type, void* channel_tag)
- : name_(name), method_type_(type), channel_tag_(channel_tag) {}
+ RpcMethod(const char* name, RpcType type)
+ : name_(name), method_type_(type), channel_tag_(NULL) {}
+
+ RpcMethod(const char* name, RpcType type,
+ const std::shared_ptr<Channel>& channel)
+ : name_(name),
+ method_type_(type),
+ channel_tag_(channel->RegisterMethod(name)) {}
const char* name() const { return name_; }
RpcType method_type() const { return method_type_; }