MethodInfo.h 754 B

123456789101112131415161718192021222324252627
  1. #ifndef RPC_METHODINFO_H
  2. #define RPC_METHODINFO_H
  3. #include <google/protobuf/service.h>
  4. #include <google/protobuf/message.h>
  5. #include "Rpc/RpcTypedef.h"
  6. namespace Egametang {
  7. struct MethodInfo
  8. {
  9. RpcServicePtr service;
  10. const google::protobuf::MethodDescriptor* method_descriptor;
  11. const google::protobuf::Message* request_prototype;
  12. const google::protobuf::Message* response_prototype;
  13. MethodInfo(RpcServicePtr service, const google::protobuf::MethodDescriptor* method_descriptor):
  14. service(service), method_descriptor(method_descriptor)
  15. {
  16. request_prototype = &service->GetRequestPrototype(method_descriptor);
  17. response_prototype = &service->GetResponsePrototype(method_descriptor);
  18. }
  19. };
  20. } // namespace Egametang
  21. #endif // RPC_METHODINFO_H