|
VLink
2.0.0
A high-performance communication middleware
|
Write-side primitive of the VLink field communication model. 更多...
#include <memory>#include <mutex>#include <optional>#include <string>#include <type_traits>#include "./impl/setter_impl.h"#include "./node.h"#include "./internal/setter-inl.h"类 | |
| class | vlink::Setter< ValueT, SecT > |
| Type-safe latest-value writer for the VLink field communication model. 更多... | |
| class | vlink::SecuritySetter< ValueT > |
Convenience alias of Setter with per-message encryption enabled. 更多... | |
命名空间 | |
| vlink | |
Write-side primitive of the VLink field communication model.
Setter<ValueT, SecT> publishes the latest value for a field topic. Every call to set() updates the locally cached value and emits the new serialised payload over the transport. When a late Getter joins after the setter has already written, an internally registered sync() callback resends the cached value so the late peer receives the current state immediately.
The class is a thin, header-only template wrapper around SetterImpl.
* Setter<ValueT> Transport Back-end Getter<ValueT> * -------------- ------------------ --------------- * | set(v) | | * | cache value | | * | Serializer::serialize | | * |----------------------------->|--- latest-value frame ------>| * | | (overwrites any previous) | * | | |--> callback(v) * | | |--> get() => v * | <-- late joiner sync ------- | <-- sync() fired by impl --- | * | re-emit cached value | | * |----------------------------->|----------------------------->| *
| Feature | Setter<T> | Publisher<T> |
|---|---|---|
| Transport role tag | kSetter | kPublisher |
| Latest-value retention | Re-sent to late-joining getters | No re-send to late subscribers |
| Sync-on-connect callback | Yes (registered inside init()) | No |
| Cross-role bridge | mark_as_publisher() | mark_as_setter() |
Setter inherits durability behaviour from the transport's effective Qos profile. Common configurations:| Durability mode | Behaviour |
|---|---|
kVolatile | Cached in-process only; re-sent on local sync() hook. |
kTransientLocal | Cached inside the transport writer for late subscribers. |
kTransient | Persisted in an external durability service (DDS only). |
kPersistent | Persisted to stable storage (DDS only). |