MethodInfo.cc 768 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright: All Rights Reserved
  2. // Author: egametang@gmail.com (tanghai)
  3. #include "Rpc/MethodInfo.h"
  4. namespace Egametang {
  5. MethodInfo::MethodInfo(
  6. ProtobufServicePtr service, const google::protobuf::MethodDescriptor* methodDescriptor):
  7. service(service), methodDescriptor(methodDescriptor)
  8. {
  9. }
  10. ProtobufServicePtr MethodInfo::GetService()
  11. {
  12. return service;
  13. }
  14. const google::protobuf::MethodDescriptor& MethodInfo::GetMethodDescriptor() const
  15. {
  16. return *methodDescriptor;
  17. }
  18. const google::protobuf::Message& MethodInfo::GetRequestPrototype() const
  19. {
  20. return service->GetRequestPrototype(methodDescriptor);
  21. }
  22. const google::protobuf::Message& MethodInfo::GetResponsePrototype() const
  23. {
  24. return service->GetResponsePrototype(methodDescriptor);
  25. }
  26. } // Egametang