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

Method GetChannelResource

src/interface/aimrt_module_cpp_interface/context/context.h:179–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178template <class T>
179auto Context::GetChannelResource(const res::Channel<T>& res, std::source_location loc) -> ChannelResource& {
180 AIMRT_ASSERT_WITH_LOC(loc, res.IsValid(), "Channel [{}] is invalid.", res.GetName());
181 AIMRT_ASSERT_WITH_LOC(loc, res.context_id_ == id_, "Channel [{}] belongs to context [{}], but current context is [{}].", res.GetName(), res.context_id_, id_);
182 AIMRT_ASSERT_WITH_LOC(loc, res.idx_ < channel_resources_.size(), "Channel [{}] index [{}] out of range (size = {}).", res.GetName(), res.idx_, channel_resources_.size());
183 return channel_resources_[res.idx_];
184}
185
186template <class Q, class P>
187auto Context::GetRpcResource(const res::Service<Q, P>& res, std::source_location loc) -> RpcResource& {

Callers 2

PublishMethod · 0.80
DoSubscribeMethod · 0.80

Calls 1

IsValidMethod · 0.80

Tested by

no test coverage detected