VLink  2.0.0
A high-performance communication middleware
vlink::GetterImpl类 参考abstract

Field-model receive base class shared by every transport-specific getter. 更多...

#include <getter_impl.h>

类 vlink::GetterImpl 继承关系图:
vlink::GetterImpl 的协作图:

Public 成员函数

 ~GetterImpl () override
 Releases backend resources. 更多...
 
virtual bool listen (MsgCallback &&callback)=0
 Installs the latest-value notification callback. 更多...
 
virtual void set_latency_and_lost_enabled (bool enable)
 Enables or disables per-update latency and loss tracking. 更多...
 
virtual bool is_latency_and_lost_enabled () const
 Reports whether tracking is currently enabled. 更多...
 
virtual int64_t get_latency () const
 Returns the most recent end-to-end latency measurement in nanoseconds. 更多...
 
virtual SampleLostInfo get_lost () const
 Returns cumulative delivered / lost counts for field updates. 更多...
 

Public 属性

bool is_listened {false}
 true once listen() has been registered successfully. 更多...
 

Protected 成员函数

 GetterImpl ()
 Stamps the node as kGetter. 更多...
 

额外继承的成员函数

详细描述

Field-model receive base class shared by every transport-specific getter.

Provides safe defaults for the optional latency / loss instrumentation so that backends without those signals can be plugged in without supplying empty overrides. Concrete backends override listen() to wire the transport receive path to the supplied MsgCallback.

构造及析构函数说明

◆ ~GetterImpl()

vlink::GetterImpl::~GetterImpl ( )
override

Releases backend resources.

◆ GetterImpl()

vlink::GetterImpl::GetterImpl ( )
protected

Stamps the node as kGetter.

成员函数说明

◆ get_latency()

virtual int64_t vlink::GetterImpl::get_latency ( ) const
virtual

Returns the most recent end-to-end latency measurement in nanoseconds.

Only meaningful when is_latency_and_lost_enabled() returns true.

返回
Latency in nanoseconds; 0 if tracking is disabled or unsupported.

◆ get_lost()

virtual SampleLostInfo vlink::GetterImpl::get_lost ( ) const
virtual

Returns cumulative delivered / lost counts for field updates.

返回
SampleLostInfo with total and lost counters.

◆ is_latency_and_lost_enabled()

virtual bool vlink::GetterImpl::is_latency_and_lost_enabled ( ) const
virtual

Reports whether tracking is currently enabled.

返回
true when the backend is collecting latency / loss data.

◆ listen()

virtual bool vlink::GetterImpl::listen ( MsgCallback &&  callback)
pure virtual

Installs the latest-value notification callback.

Pure virtual. Backends bind callback to the transport receive path so the public Getter sees every value written by the matching Setter. The owning Getter sets is_listened to true once this method succeeds.

参数
callbackCallable void(const Bytes&) invoked on each update.
返回
true on successful registration; false on error.

◆ set_latency_and_lost_enabled()

virtual void vlink::GetterImpl::set_latency_and_lost_enabled ( bool  enable)
virtual

Enables or disables per-update latency and loss tracking.

Default no-op. Backends that maintain timestamps and sequence numbers override the method to activate the instrumentation.

参数
enabletrue to start tracking; false to stop.

类成员变量说明

◆ is_listened

bool vlink::GetterImpl::is_listened {false}

true once listen() has been registered successfully.


该类的文档由以下文件生成: