| 512 | // OpSrv::ServeInline implementation |
| 513 | template <class Q, class P, concepts::SupportedServer<Q, P> TServer> |
| 514 | void OpSrv::ServeInline(const res::Service<Q, P>& srv, TServer server) { |
| 515 | auto& rpc_ctx = ctx_.GetRpcResource(srv, loc_); |
| 516 | |
| 517 | auto standardized_server = StandardizeServer<Q, P, TServer>(std::move(server)); |
| 518 | rpc_ctx.serve_f = Context::Server<Q, P>( |
| 519 | [server_func = std::move(standardized_server), ctx_ptr = ctx_.weak_from_this()]( |
| 520 | aimrt::rpc::ContextRef rpc_ctx, const Q& q, P& p) -> aimrt::co::Task<aimrt::rpc::Status> { |
| 521 | if (auto ctx = ctx_ptr.lock()) { |
| 522 | ctx->LetMe(); |
| 523 | co_return co_await server_func(rpc_ctx, q, p); |
| 524 | } |
| 525 | co_return aimrt::rpc::Status(AIMRT_RPC_STATUS_SVR_NOT_READY); |
| 526 | }); |
| 527 | } |
| 528 | |
| 529 | // OpSrv::ServeOn implementation |
| 530 | template <class Q, class P, concepts::SupportedServer<Q, P> TServer> |
no test coverage detected