holoscan::FragmentServiceProvider
holoscan::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.
Constructors
Destructor
~FragmentServiceProvider
Methods
get_service_erased
Retrieves a service using type erasure.
Returns: A shared_ptr to FragmentService if found, otherwise nullptr.
Parameters
The std::type_info of the service to retrieve.
The identifier of the service instance.
get_service_resource_by_name
Retrieve a resource registered as a fragment service by name.
Returns: A shared_ptr to the service resource, or nullptr if not found.
Parameters
The service id (name) used during service registration.
get_services_by_id
Retrieve all fragment services with a matching id, regardless of registered type.
This method is used as a fallback when exact type lookup fails, enabling retrieval of services registered with a derived type when looking up by a base type.
Returns: A vector of shared_ptrs to matching FragmentServices. Empty if none found.
Parameters
The service id (name) used during service registration.