Holoscan SDK v3.11.0

Class FragmentServiceProvider

class FragmentServiceProvider

Interface for classes that can provide access to registered fragment services.

This interface is used by ComponentBase to decouple component service access from the concrete Fragment implementation, enabling better testability and modularity while still allowing service retrieval.

Subclassed by holoscan::Fragment

Public Functions

virtual ~FragmentServiceProvider() = default
virtual std::shared_ptr<FragmentService> get_service_erased(const std::type_info &service_type, std::string_view id) const = 0

Retrieves a service using type erasure.

Parameters
  • service_type – The std::type_info of the service to retrieve.

  • id – The identifier of the service instance.

Returns

A shared_ptr to FragmentService if found, otherwise nullptr.

virtual std::shared_ptr<Resource> get_service_resource_by_name(std::string_view id) const = 0

Retrieve a resource registered as a fragment service by name.

Parameters

id – The service id (name) used during service registration.

Returns

A shared_ptr to the service resource, or nullptr if not found.

Previous Class FragmentService
Next Class GPUDevice
© Copyright 2022-2026, NVIDIA. Last updated on Mar 9, 2026