|
VLink
2.0.0
A high-performance communication middleware
|
Topic-scoped registration store that fans transport callbacks across NodeImpl peers.
更多...
#include <algorithm>#include <atomic>#include <map>#include <memory>#include <mutex>#include <string>#include <unordered_map>#include <unordered_set>#include <utility>#include "../base/functional.h"#include "../base/logger.h"#include "./node_impl.h"类 | |
| class | vlink::AbstractObject< FilterT > |
Topic-scoped fan-out store of NodeImpl peers and their callbacks. 更多... | |
| class | vlink::AbstractFactory< FilterT > |
Lazily allocates and caches AbstractObject instances keyed by FilterT. 更多... | |
命名空间 | |
| vlink | |
Topic-scoped registration store that fans transport callbacks across NodeImpl peers.
This is an internal implementation header used by the public VLink node templates (Publisher, Subscriber, Client, Server, Setter, Getter); it should not be included directly by application code. The header introduces two co-operating class templates that let several NodeImpl instances bound to the same logical topic share one registration record:
AbstractObject – a per-topic record that owns the set of registered NodeImpl pointers together with six callback dictionaries (server connect, subscriber connect, request/response, serialised message, intra-process message and transport status).AbstractFactory – a thread-safe map keyed on FilterT (commonly the topic URL string) that lazily creates an AbstractObject for each key and reuses it via a cached std::weak_ptr until the last owner releases it.| Map field | Callback signature |
|---|---|
server_connect_callback_map_ | void(bool) – server side peer presence change |
sub_connect_callback_map_ | void(bool) – subscriber side presence change |
req_resp_callback_map_ | void(uint64_t, const Bytes&, Bytes*) |
msg_callback_map_ | void(const Bytes&) |
intra_msg_callback_map_ | void(const IntraData&) |
status_callback_map_ | void(const Status::BasePtr&) |
AbstractObject method acquires the internal std::recursive_mutex; callbacks invoked through traverse_*() execute under that lock and may re-enter the same AbstractObject safely.| FilterT | Key type used to identify topics inside the factory map. |