VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::SetterImpl Class Referenceabstract

Transport-agnostic base for setter (field writer) node implementations. More...

#include <setter_impl.h>

Inheritance diagram for vlink::SetterImpl:
Collaboration diagram for vlink::SetterImpl:

Public Member Functions

 ~SetterImpl () override
 Destructor.
virtual void write (const Bytes &msg_data)=0
 Writes a new field value to all connected getter nodes.
virtual void sync (SyncCallback &&callback)=0
 Waits for the most recently written value to be propagated, then fires the completion callback.

Protected Member Functions

 SetterImpl ()
 Protected constructor; initialises the setter with kSetter role.

Additional Inherited Members

Detailed Description

Transport-agnostic base for setter (field writer) node implementations.

Concrete backends override write() to push the serialised value onto the transport and sync() to provide a completion notification after the value has been accepted by the underlying transport.

Constructor & Destructor Documentation

◆ ~SetterImpl()

vlink::SetterImpl::~SetterImpl ( )
override

Destructor.

◆ SetterImpl()

vlink::SetterImpl::SetterImpl ( )
protected

Protected constructor; initialises the setter with kSetter role.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ sync()

virtual void vlink::SetterImpl::sync ( SyncCallback && callback)
pure virtual

Waits for the most recently written value to be propagated, then fires the completion callback.

Must be implemented by each concrete transport backend. The exact semantics depend on the transport: some backends fire the callback immediately after the write is queued; others wait until the value has been acknowledged by all connected getters.

Parameters
callbackCallable invoked once the synchronisation is complete.

◆ write()

virtual void vlink::SetterImpl::write ( const Bytes & msg_data)
pure virtual

Writes a new field value to all connected getter nodes.

Must be implemented by each concrete transport backend. msg_data contains the fully serialised latest value produced by Serializer::serialize(). The write overwrites any previously stored value on the topic.

Parameters
msg_dataSerialised field value bytes to transmit.

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