pub unsafe extern "C" fn dds_find_topic(
scope: dds_find_scope_t,
participant: dds_entity_t,
name: *const c_char,
type_info: *const dds_typeinfo_t,
timeout: dds_duration_t,
) -> dds_entity_tExpand description
@brief Finds a locally created or discovered remote topic by topic name and type information @ingroup topic @component topic
Finds a locally created topic or a discovered remote topic based on the topic name and type. In case the topic is not found, this function will wait for the topic to become available until the provided time out.
When using the scope DDS_FIND_SCOPE_LOCAL_DOMAIN, there will be no requests sent over the network for resolving the type in case it is unresolved. This also applies to dependent types: in case a dependency of the provided type is unresolved, no requests will be sent for resolving the type when using LOCAL_DOMAIN scope.
In case the scope is DDS_FIND_SCOPE_GLOBAL, for unresolved types (or dependencies) a type lookup request will be sent.
In case no type information is provided and multiple (discovered) topics exist with the provided name, an arbitrary topic with that name will be returned. In this scenario, it would be better to read DCPSTopic data and use that to get the required topic meta-data.
The returned topic should be released with dds_delete.
@param[in] scope The scope used to find the topic. In case topic discovery is not enabled in the build, SCOPE_GLOBAL cannot be used. @param[in] participant The handle of the participant the found topic will be created in @param[in] name The name of the topic to find. @param[in] type_info The type information of the topic to find. Optional, and should not be provided in case topic discovery is not enabled in the build. @param[in] timeout The timeout for waiting for the topic to become available
@returns A valid topic handle or an error code.
@retval >0 A valid topic handle. @retval 0 No topic of this name exists @retval DDS_RETCODE_BAD_PARAMETER Participant or type information was invalid. @retval DDS_RETCODE_PRECONDITION_NOT_MET The provided type could not be found.