MCPcopy Create free account
hub / github.com/AimRT/AimRT / GetRpcResource

Method GetRpcResource

src/interface/aimrt_module_cpp_interface/context/context.h:187–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185
186template <class Q, class P>
187auto 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

Callers 4

CallMethod · 0.80
ServeInlineMethod · 0.80
ServeOnMethod · 0.80
ServingMethod · 0.80

Calls 1

IsValidMethod · 0.80

Tested by

no test coverage detected