|
VLink
2.0.0
A high-performance communication middleware
|
JSON-driven substring rewriter for VLink topic URLs. 更多...
类 | |
| class | vlink::UrlRemap |
| Loads a JSON rewrite table and substitutes VLink URLs at runtime. 更多... | |
命名空间 | |
| vlink | |
JSON-driven substring rewriter for VLink topic URLs.
UrlRemap turns a flat JSON dictionary into a runtime topic-renaming layer. Each entry maps a fragment that should appear in an input URL to the replacement URL emitted to the transport, allowing operators to switch backends, redirect topics, or stage migrations without rebuilding application binaries.
| Source key (substring of input) | Target value (replacement URL) | Effect |
|---|---|---|
"intra://sensor/lidar" | "dds://vehicle/lidar" | promote local topic to DDS |
"shm://camera/front" | "zenoh://camera/front" | switch transport to Zenoh |
"dds://" | "ddst://" | force TCP DDS transport globally |
"fdbus://" | "intra://" | merge to intra-process bus |
Lookup is linear in the configured order; the first key that occurs as a substring of the input URL wins. Results are cached so repeated lookups for the same input are O(1).
UrlRemap is not thread-safe; serialise calls externally or confine to a single thread.convert() returns its input unchanged when the table is empty or unloaded.