holoscan::gxf::has_component
holoscan::gxf::has_component
Determines if an entity has a specific component.
Searches for components within an entity based on certain criteria: component type, component name, and offset. Each of these criteria is optional. If no criteria are provided, the method returns the first component found. The “offset” primarily aids repeated searches, allowing continuation from the index returned by a prior search.
If no component matching the criteria is found, the function returns false.
Returns: true if a component matching the criteria is found, false otherwise.
Parameters
The valid GXF context.
The unique object ID (UID) of the entity being searched.
The component type ID (TID) of the desired component (optional).
The name of the component to find (optional). Ownership is not transferred.
The pointer to the index to start searching from. It will also store the index of the found component if one is discovered. nullptr is allowed.
The pointer to store the UID of the found component, if applicable.
See also: GxfComponentFind