holoscan::DefaultFragmentService
holoscan::DefaultFragmentService
Default implementation of FragmentService for basic resource sharing.
DefaultFragmentService provides a straightforward implementation of the FragmentService interface. It manages a single Resource instance and provides type-safe access methods.
This class is designed to be used directly for simple resource sharing scenarios or as a base class for more specialized service implementations.
This class is non-copyable to prevent accidental duplication of the managed resource. Move operations are supported to allow transfer of ownership.
Inherits from: holoscan::FragmentService (public)
Constructors
DefaultFragmentService
Default
Copy
Move
Copy (deleted)
Destructor
~DefaultFragmentService
Assignment operators
operator=
Move assign
Copy assign (deleted)
Methods
resource
Const (1)
Const (2)
Set the underlying resource
Get the resource cast to a specific type.
This templated method provides type-safe access to the managed resource. It attempts to cast the resource to the requested type using dynamic_pointer_cast.
Returns: Shared pointer to the resource cast to ResourceT, or nullptr if the cast fails.
Template parameters
The type to cast the resource to. Must be derived from Resource.