Function holoscan::gxf::has_component
Defined in File gxf_utils.hpp
-
bool holoscan::gxf::has_component(gxf_context_t context, gxf_uid_t eid, gxf_tid_t tid = GxfTidNull(), const char *name = nullptr, int32_t *offset = nullptr, gxf_uid_t *cid = nullptr)
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
.See alsoGxfComponentFind
- Parameters
context – The valid GXF context.
eid – The unique object ID (UID) of the entity being searched.
tid – The component type ID (TID) of the desired component (optional).
name – The name of the component to find (optional). Ownership is not transferred.
offset – 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.
cid – The pointer to store the UID of the found component, if applicable.
- Returns
true
if a component matching the criteria is found,false
otherwise.