VLink  2.0.0
A high-performance communication middleware
subscriber_impl.h 文件参考

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

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

浏览源代码.

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

命名空间

 

详细描述

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