Class HybridDiscoveryStrategy

Inheritance Relationships

Base Type

Class Documentation

class HybridDiscoveryStrategy : public ros2_medkit_gateway::discovery::DiscoveryStrategy

Hybrid discovery using a MergePipeline.

Thin wrapper around MergePipeline that caches the merged result and exposes it through the DiscoveryStrategy interface. The pipeline orchestrates ManifestLayer, RuntimeLayer, and any PluginLayers with per-field-group merge policies.

Public Functions

HybridDiscoveryStrategy(rclcpp::Node *node, MergePipeline pipeline)

Construct hybrid discovery strategy.

Parameters:
  • node – ROS 2 node for logging

  • pipeline – Pre-configured merge pipeline

virtual std::vector<Area> discover_areas() override

Discover all areas.

virtual std::vector<Component> discover_components() override

Discover all components.

virtual std::vector<App> discover_apps() override

Discover all apps (empty for runtime-only strategy)

virtual std::vector<Function> discover_functions() override

Discover all functions (empty for runtime-only strategy)

inline virtual std::string get_name() const override

Get strategy name for logging.

void refresh()

Re-execute the pipeline and cache the result.

MergeReport get_merge_report() const

Get the last merge report (returned by value for thread safety)

LinkingResult get_linking_result() const

Get the last linking result (returned by value for thread safety)

std::vector<std::string> get_orphan_nodes() const

Get orphan nodes from last linking.

void add_layer(std::unique_ptr<DiscoveryLayer> layer)

Add a discovery layer to the pipeline.

Warning

Construction-time only. Must be called before the first refresh() (i.e., before EntityCache timer starts). Calling concurrently with refresh() is a data race.