MethodInfo.h 761 B

12345678910111213141516171819202122232425262728
  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. class MethodInfo
  8. {
  9. public:
  10. ProtobufServicePtr service;
  11. const google::protobuf::MethodDescriptor* methodDescriptor;
  12. const google::protobuf::Message* requestPrototype;
  13. const google::protobuf::Message* responsePrototype;
  14. MethodInfo(ProtobufServicePtr service, const google::protobuf::MethodDescriptor* methodDescriptor):
  15. service(service), methodDescriptor(methodDescriptor)
  16. {
  17. requestPrototype = &service->GetRequestPrototype(methodDescriptor);
  18. responsePrototype = &service->GetResponsePrototype(methodDescriptor);
  19. }
  20. };
  21. } // namespace Egametang
  22. #endif // RPC_METHODINFO_H