VLink  2.0.0
A high-performance communication middleware
shm_conf.h 文件参考

Transport configuration for the shm:// Iceoryx shared-memory transport. 更多...

此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

详细描述

Transport configuration for the shm:// Iceoryx shared-memory transport.

ShmConf binds the shm:// URL scheme to the Eclipse Iceoryx zero-copy shared-memory transport. Publishers loan() a memory chunk directly from the RouDi-managed memory pool, fill it in place, and publish() it; subscribers receive the chunk by pointer and release it back to the pool when finished. No payload bytes are ever copied between processes, which makes this the lowest-latency option for large messages on a single host.

Shared-Memory Layout
RouDi (daemon)
+-----------------------------------------------+
| Mempool: fixed-size chunk segments |
| +------+ +------+ +------+ +------+ +------+ |
| | chk0 | | chk1 | | chk2 | | chk3 | | ... | |
| +------+ +------+ +------+ +------+ +------+ |
+--------^--------------------------^-----------+
| loan() | release()
| |
Publisher process Subscriber process
Loan / Release Flow
Publisher: chunk = loan(size); fill(chunk); publish(chunk);
\
\--> queue (per topic in RouDi)
\
Subscriber: chunk = take(); \--> chunk arrival
consume(chunk); release(chunk);
Supported Node Types
Publisher Subscriber Server Client Getter Setter
yes yes yes yes yes yes
URL Format
shm://<address>[?event=<name>&domain=<N>&depth=<N>&history=<N>&wait=<ms>]
Component Description
address Iceoryx service/topic name (URL host concatenated with path)
event Optional secondary event name (?event=)
domain Iceoryx domain ID (?domain=); defaults to 0
depth Queue capacity override; 0 uses the Iceoryx default
history History count (?history=); 0 from URL, or 1 for field nodes
wait Blocking-wait timeout in ms for pub/sub; not valid for RPC or fields
RouDi Lifecycle
RouDi is the Iceoryx memory-manager daemon. It can either be started externally (preferred for production) or hosted in-process for tests and single-process tools.
// Option A: embedded RouDi (single-process tools):
vlink::ShmConf::init_roudi();
// Option B: connect this process to an external RouDi daemon:
vlink::ShmConf::init_runtime("my_app");
// Option C: one-line preflight that picks whichever is needed:
vlink::ShmConf::auto_init_roudi();
// ... create shm:// nodes ...
vlink::ShmConf::deinit_runtime();
注解
Compiled only when VLINK_SUPPORT_SHM is defined.
Iceoryx caps address and event at 80 characters each.
wait mode is only valid for kPublisher / kSubscriber; using it with RPC or field nodes causes parse_protocol() to return false.