| 455 | |
| 456 | template <class Q, class P, concepts::RawClient<Q, P> TClient> |
| 457 | res::Client<Q, P> OpCli::Init(std::string_view service_name, TClient&& client) { |
| 458 | RpcResource rpc_ctx; |
| 459 | |
| 460 | rpc_ctx.call_f = Context::Client<Q, P>( |
| 461 | [client = std::move(client)](aimrt::rpc::ContextRef ctx, const Q& q, P& p) -> aimrt::co::Task<aimrt::rpc::Status> { |
| 462 | co_return co_await client(ctx, q, p); |
| 463 | }); |
| 464 | |
| 465 | rpc_ctx.func_name = std::string(service_name); |
| 466 | |
| 467 | ctx_.rpc_resources_.push_back(std::move(rpc_ctx)); |
| 468 | |
| 469 | res::Client<Q, P> res; |
| 470 | res.name_ = std::string(service_name); |
| 471 | res.idx_ = ctx_.rpc_resources_.size() - 1; |
| 472 | res.context_id_ = ctx_.id_; |
| 473 | |
| 474 | return res; |
| 475 | } |
| 476 | |
| 477 | template <class Q, class P> |
| 478 | co::Task<aimrt::rpc::Status> OpCli::Call(const res::Service<Q, P>& srv, const Q& q, P& p) { |
no outgoing calls
no test coverage detected