| 185 | |
| 186 | template <class Q, class P> |
| 187 | auto Context::GetRpcResource(const res::Service<Q, P>& res, std::source_location loc) -> RpcResource& { |
| 188 | AIMRT_ASSERT_WITH_LOC(loc, res.IsValid(), "Service [{}] is invalid.", res.GetName()); |
| 189 | AIMRT_ASSERT_WITH_LOC(loc, res.context_id_ == id_, "Service [{}] belongs to context [{}], but current context is [{}].", res.GetName(), res.context_id_, id_); |
| 190 | AIMRT_ASSERT_WITH_LOC(loc, res.idx_ < rpc_resources_.size(), "Service [{}] index [{}] out of range (size = {}).", res.GetName(), res.idx_, rpc_resources_.size()); |
| 191 | return rpc_resources_[res.idx_]; |
| 192 | } |
| 193 | |
| 194 | } // namespace aimrt::context |
| 195 |
no test coverage detected