Function holoscan::gxf::has_component

Holoscan v2.2.0
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 also


  • 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.


true if a component matching the criteria is found, false otherwise.

Previous Function holoscan::gxf::get_videobuffer
Next Function holoscan::inference::__attribute__
© Copyright 2022-2024, NVIDIA. Last updated on Jul 3, 2024.