VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
publisher_impl.h 文件参考

Abstract base class for all transport-specific publisher implementations. 更多...

#include <chrono>
#include <memory>
#include "./node_impl.h"
publisher_impl.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

 Transport-agnostic base for publisher node implementations. 更多...

命名空间

详细描述

Abstract base class for all transport-specific publisher implementations.

PublisherImpl is the intermediate layer between the generic Publisher<T> template and a concrete transport backend (e.g. DdsPublisherImpl, ShmPublisherImpl). It inherits from NodeImpl and adds publish-side semantics:

  • Subscriber discovery and change notification via detect_subscribers() / update_subscribers().
  • Blocking wait for at least one subscriber with wait_for_subscribers().
  • Two write overloads: serialised Bytes for network transports and zero-copy IntraData for the intra:// backend.
Subscriber Discovery Flow
// Transport detects subscriber appearance or disappearance:
publisher_impl->update_subscribers();
// -> compares has_subscribers() against cached state
// -> notifies the condition variable
// -> fires the ConnectCallback registered via detect_subscribers()
注解
Concrete subclasses must implement has_subscribers() and write(const Bytes&). write(const IntraData&) is only overridden by the intra:// backend; all other transports inherit the base no-op that logs a warning and returns false.