VLink  2.0.0
A high-performance communication middleware
subscriber_impl.h File Reference

Transport-neutral base class for every event-model subscriber implementation. More...

#include "./node_impl.h"
Include dependency graph for subscriber_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vlink::SubscriberImpl
 Event-model receive base shared by every transport-specific subscriber. More...
 

Namespaces

 

Detailed Description

Transport-neutral base class for every event-model subscriber implementation.

This is an internal implementation header used by the public Subscriber template; applications should depend on subscriber.h. SubscriberImpl extends NodeImpl with the receive-side semantics: two listen overloads cover the serialised wire path (the default) and the zero-copy in-process path used only by the intra backend, plus optional latency / loss tracking that mirrors GetterImpl.

ImplType
The constructor stamps impl_type with kSubscriber so subscriptions are tagged correctly in discovery, recording and proxy paths.
Lifecycle
  • Constructed by the matching Conf::create_subscriber().
  • The public Subscriber template calls listen() once the user installs a callback; is_listened becomes true on success.
  • set_latency_and_lost_enabled() may be toggled before or after listen.
  • init() / deinit() inherited from NodeImpl drive the transport.
Role table
Capability Provider
Wire receive callback Subclass override of listen(MsgCallback&&)
Zero-copy in-process callback IntraSubscriberImpl override of listen(IntraMsgCallback&&)
Latency / loss reporting Subclass overrides of the optional getters
Listen state flag is_listened (set by Subscriber)
Internal API contract
Method Default Subclass duty
listen(MsgCallback&&) Pure virtual Wire transport receiver
listen(IntraMsgCallback&&) Warns, returns false Only intra:// overrides
set_latency_and_lost_enabled(bool) No-op Toggle instrumentation
is_latency_and_lost_enabled() const Returns false Report tracking state
get_latency() const Returns 0 Latest measured latency
get_lost() const Returns zero SampleLostInfo Cumulative loss stats