| 258 | // publisher publish |
| 259 | template <class T> |
| 260 | void OpPub::Publish(const res::Channel<T>& ch, aimrt::channel::ContextRef ch_ctx, const T& msg) { |
| 261 | auto& channel_ctx = ctx_.GetChannelResource(ch, loc_); |
| 262 | if (!ctx_.Running() || ctx_.GetPubState() != context::ChannelState::kOn) [[unlikely]] { |
| 263 | ctx_.log().Trace("Publisher is not ready."); |
| 264 | return; |
| 265 | } |
| 266 | std::any_cast<typename Context::PublishFunction<T>&>(channel_ctx.pub_f)(channel_ctx.pub, ch_ctx, msg); |
| 267 | } |
| 268 | |
| 269 | template <class T> |
| 270 | void OpPub::Publish(const res::Channel<T>& ch, const T& msg) { |
nothing calls this directly
no test coverage detected