148 using Callback = std::function<void(
const std::vector<Info>& info_list)>;
173 [[nodiscard]]
static std::string
convert_type_to_view(uint32_t type,
const std::vector<Process>& process_list);
248 void process_timeout();
250 void process_offline(std::string_view hostname, uint32_t pid, std::string_view process_name);
256 std::unique_ptr<struct DiscoveryViewerImpl> impl_;
static std::string get_listen_address()
Returns the intra-process address used by the discovery subsystem.
std::string get_ser_type(const std::string &url) const
Returns the serialisation type string for a given URL.
FilterType
Controls which endpoints are included in the discovery view.
定义 discovery_viewer.h:89
@ kFilterNative
Show only local-host endpoints.
定义 discovery_viewer.h:92
@ kFilterAvailable
Show only endpoints with live processes.
定义 discovery_viewer.h:91
@ kFilterNone
Show all endpoints.
定义 discovery_viewer.h:90
uint32_t get_max_elapsed_time() const override
Returns the maximum allowed task execution time in milliseconds.
size_t get_max_task_count() const override
Returns the maximum queue depth.
static ImplType convert_type(std::string_view str)
Converts a transport string to the corresponding ImplType value.
static std::string convert_type_to_view(uint32_t type, const std::vector< Process > &process_list)
Returns a combined type-and-process display string.
SchemaType get_schema_type(const std::string &url) const
Returns the coarse schema family for a given URL.
void on_end() override
Called from the loop thread just after the last task has been processed.
static DiscoveryViewer * global_get()
Returns the process-global DiscoveryViewer singleton.
void on_begin() override
Called from the loop thread just before the first task is processed.
static std::string convert_type_to_view(uint32_t type)
Returns a display string for an ImplType bitmask.
std::function< void(const std::vector< Info > &info_list)> Callback
Callback fired whenever the discovery information is updated.
定义 discovery_viewer.h:148
~DiscoveryViewer() override
Destructor – stops the viewer loop.
std::vector< Info > get_info_list()
Returns a snapshot of the current discovery information.
void register_callback(Callback &&callback)
Registers the callback invoked when the endpoint list changes.
DiscoveryViewer(FilterType type=kFilterNone)
Constructs a DiscoveryViewer with the given filter type.
MessageLoop()
Constructs a MessageLoop with kNormalType queue.
Platform-independent macro definitions for the VLink library.
#define VLINK_EXPORT
定义 macros.h:85
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
定义 macros.h:184
Single-threaded event loop with three queue types, timer management and task scheduling.
SchemaType
Coarse runtime schema family used by discovery, bag metadata, and proxy routing.
定义 types.h:184
@ kUnknown
Decode category is not known.
定义 types.h:185
ImplType
Bitmask identifying the role of a VLink node implementation.
定义 types.h:89
Aggregated discovery entry for one VLink URL.
定义 discovery_viewer.h:124
int sort_index
Stable sort key (assigned by the viewer).
定义 discovery_viewer.h:125
std::string ser_type
Serialisation type (e.g., "demo.proto.PointCloud").
定义 discovery_viewer.h:128
uint32_t type
ImplType bitmask.
定义 discovery_viewer.h:126
std::string url
Full VLink URL string.
定义 discovery_viewer.h:127
SchemaType schema_type
Coarse schema family derived from discovery metadata.
定义 discovery_viewer.h:129
std::vector< Process > process_list
Processes hosting this endpoint.
定义 discovery_viewer.h:130
bool operator<(const Info &target) const noexcept
Sorts entries for stable display (by sort_index, url).
Information about one process that hosts a VLink endpoint.
定义 discovery_viewer.h:99
uint32_t pid
Process ID.
定义 discovery_viewer.h:102
std::string host
Hostname of the process.
定义 discovery_viewer.h:101
uint32_t type
ImplType bitmask of all communication types in this process.
定义 discovery_viewer.h:100
std::string ip
IP address of the process host.
定义 discovery_viewer.h:104
double profiler
CPU utilisation reported by the process (-1 if unavailable).
定义 discovery_viewer.h:105
bool operator<(const Process &target) const noexcept
Sorts processes for stable display (by host, pid).
std::string name
Process name.
定义 discovery_viewer.h:103
Core type definitions shared across all VLink node implementations.