| 546 | // OpSrv::Serving implementation |
| 547 | template <class Q, class P> |
| 548 | aimrt::co::Task<aimrt::rpc::Status> OpSrv::Serving(const res::Service<Q, P>& srv, aimrt::rpc::ContextRef ctx, const Q& q, P& p) { |
| 549 | details::GetCurrentContext(loc_)->LetMe(); |
| 550 | auto& rpc_ctx = ctx_.GetRpcResource(srv, loc_); |
| 551 | |
| 552 | if (!rpc_ctx.serve_f.has_value()) { |
| 553 | co_return aimrt::rpc::Status(AIMRT_RPC_STATUS_SVR_NOT_IMPLEMENTED); |
| 554 | } |
| 555 | |
| 556 | if (!ctx_.Running() || ctx_.GetSrvState() != context::RpcState::kOn) [[unlikely]] { |
| 557 | ctx_.log().Trace("Server is not ready to serve."); |
| 558 | co_return aimrt::rpc::Status(AIMRT_RPC_STATUS_SVR_NOT_READY); |
| 559 | } |
| 560 | |
| 561 | co_return co_await std::any_cast<Context::Server<Q, P>&>(rpc_ctx.serve_f)(ctx, q, p); |
| 562 | } |
| 563 | |
| 564 | // OpSrv::StandardizeServer implementation |
| 565 | template <class Q, class P, concepts::SupportedServer<Q, P> Func> |
nothing calls this directly
no test coverage detected