VLink  2.0.0
A high-performance communication middleware
vlink::GetterImpl Class Referenceabstract

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

#include <getter_impl.h>

Inheritance diagram for vlink::GetterImpl:
Collaboration diagram for vlink::GetterImpl:

Public Member Functions

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

Public Attributes

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

Protected Member Functions

 GetterImpl ()
 Stamps the node as kGetter. More...
 

Additional Inherited Members

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~GetterImpl()

vlink::GetterImpl::~GetterImpl ( )
override

Releases backend resources.

◆ GetterImpl()

vlink::GetterImpl::GetterImpl ( )
protected

Stamps the node as kGetter.

Member Function Documentation

◆ 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.

Returns
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.

Returns
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.

Returns
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.

Parameters
callbackCallable void(const Bytes&) invoked on each update.
Returns
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.

Parameters
enabletrue to start tracking; false to stop.

Member Data Documentation

◆ is_listened

bool vlink::GetterImpl::is_listened {false}

true once listen() has been registered successfully.


The documentation for this class was generated from the following file: