Skip to main content

dds_get_parent

Function dds_get_parent 

Source
pub unsafe extern "C" fn dds_get_parent(
    entity: dds_entity_t,
) -> dds_entity_t
Expand description

@brief Get entity parent. @ingroup entity @component entity_relations

This operation returns the parent to which the given entity belongs. For instance, it will return the Participant that was used when creating a Publisher (when that Publisher was provided here).

When a reader or a writer is created with a participant and a normal topic, a subscriber or publisher is created implicitly as the direct parent. This function will return that implicit parent and not the participant supplied to @ref dds_create_reader or @ref dds_create_writer. For a reader of a built-in topic, this function returns the participant’s built-in subscriber.

@param[in] entity Entity from which to get its parent.

@returns A valid entity handle or an error code.

@retval >0 A valid entity handle. @retval DDS_ENTITY_NIL Called with a participant. @retval DDS_RETCODE_ERROR An internal error has occurred. @retval DDS_RETCODE_ILLEGAL_OPERATION The operation is invoked on an inappropriate object. @retval DDS_RETCODE_ALREADY_DELETED The entity has already been deleted. DOC_TODO: Link to generic dds entity relations documentation.