MCPcopy Create free account
hub / github.com/apache/brpc / Map

Method Map

test/brpc_channel_unittest.cpp:576–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574
575 class GetReqAndAddRes : public brpc::CallMapper {
576 brpc::SubCall Map(
577 int channel_index,
578 const google::protobuf::MethodDescriptor* method,
579 const google::protobuf::Message* req_base,
580 google::protobuf::Message* res_base) override {
581 const test::ComboRequest* req =
582 dynamic_cast<const test::ComboRequest*>(req_base);
583 test::ComboResponse* res = dynamic_cast<test::ComboResponse*>(res_base);
584 if (method->name() != "ComboEcho" ||
585 res == NULL || req == NULL ||
586 req->requests_size() <= channel_index) {
587 return brpc::SubCall::Bad();
588 }
589 return brpc::SubCall(::test::EchoService::descriptor()->method(0),
590 &req->requests(channel_index),
591 res->add_responses(), 0);
592 }
593 };
594
595 class SuccessLimitCallMapper : public brpc::CallMapper {

Callers

nothing calls this directly

Calls 3

SubCallClass · 0.85
nameMethod · 0.45
methodMethod · 0.45

Tested by

no test coverage detected