Common CRTP base for every VLink communication primitive.
Node<ImplT, SecT> is the polymorphic base class shared by all six VLink communication primitives. It owns the transport-specific implementation pointer (impl_), drives the node lifecycle, and exposes the cross-cutting services that every primitive needs: zero-copy loans, peer-discovery toggling, message-loop attachment, recording, security installation, profiling, and SSL/TLS configuration.
- Class Hierarchy
* +--------------------------------------------------------------+
* | User-facing primitives |
* | Publisher<T> Subscriber<T> Setter<T> Getter<T> |
* | Client<Req,Resp> Server<Req,Resp> |
* +-----------------------------+--------------------------------+
* | inherits
* +-----------------------------v--------------------------------+
* | Node<ImplT, SecT> |
* | lifecycle | loans | properties | profiler | ssl | security |
* +-----------------------------+--------------------------------+
* | owns std::unique_ptr<ImplT>
* +-----------------------------v--------------------------------+
* | ImplT (PublisherImpl, SubscriberImpl, SetterImpl, ...) |
* +-----------------------------+--------------------------------+
* | dispatches to transport
* +-----------------------------v--------------------------------+
* | Transport back-ends |
* | intra | shm | shm2 | dds | ddsc | zenoh | someip | ... |
* +--------------------------------------------------------------+
*
- Lifecycle State Diagram
* +------------+ constructor +------------+ init() +------------+
* | (uninited) |------------------>| parsed |------------->| active |
* | | parse URL / Conf | (impl_) | init_ext | (using API)|
* +------------+ +------------+ +------------+
* ^ |
* | init() | interrupt()
* | v
* +------+------+ +-------------+
* | deinited |<-----------| blocking |
* | | deinit() | wait aborts|
* +-------------+ +-------------+
* |
* | destructor (calls deinit if active)
* v
* destroyed
*
| Step | Method | Notes |
| Construction | constructor | Parses URL, creates impl via Conf factory. |
| Initialisation | init() | Runs impl init + init_ext, samples loans. |
| Active | publish / listen / ... | Normal operation. |
| Interrupt | interrupt() | Aborts blocking waits immediately. |
| Deinitialisation | deinit() | interrupt() then impl deinit + deinit_ext. |
| Destruction | destructor | Auto-deinits if still active. |
- ImplType Roles
ImplType | Primitive that uses it | Direction |
kPublisher | Publisher<T> | Event write |
kSubscriber | Subscriber<T> | Event read |
kClient | Client<Req,Resp> | RPC caller |
kServer | Server<Req,Resp> | RPC handler |
kSetter | Setter<T> | Field write |
kGetter | Getter<T> | Field read |
- Deferred Initialisation
pub.set_ser_type("my.custom.Type");
pub.set_discovery_enabled(false);
pub.init();
Type-safe topic emitter for the VLink event communication model.
Definition: publisher.h:130
@ kWithoutInit
Defer initialisation; call init() manually.
- Security
- Use the
Security* primitive aliases to enable per-message encryption. The Security::Config aggregate is passed as the second constructor argument; omitting it (or passing an empty aggregate) uses the built-in default symmetric slot:
Convenience alias of Publisher with per-message security enabled.
Definition: publisher.h:294
Aggregate of every parameter accepted by the Security constructor.
Definition: security.h:164
std::string key
Raw symmetric seed; SHA-256 truncated to 16 bytes.
Definition: security.h:176
- 注解
intra:// and dds:// CDR payloads do not support per-message security; constructing a Security* primitive there is a fatal.
- Zero-copy Loans
- On loan-capable transports the loan API avoids extra copies:
if (pub.is_support_loan()) {
write_into(buf);
pub.publish(buf);
}
Fixed-size 128-byte buffer holder with SBO, five ownership modes and integrated codecs.
Definition: bytes.h:120
- 模板参数
-
| ImplT | Concrete transport implementation derived from NodeImpl. |
| SecT | Security mode: kWithoutSecurity (default) or kWithSecurity. |
- 参见
- publisher.h, subscriber.h, client.h, server.h, getter.h, setter.h, extension/security.h, extension/ssl_options.h