VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
publisher_impl.h File Reference

Abstract base class for all transport-specific publisher implementations. More...

#include <chrono>
#include <memory>
#include "./node_impl.h"
Include dependency graph for publisher_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

 Transport-agnostic base for publisher node implementations. More...

Namespaces

Detailed Description

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()
Note
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.