Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[19359] Fix DomainParticipant::register_remote_type return when negotiating type (backport #3786) #3797

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions include/fastdds/dds/domain/DomainParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,19 +850,21 @@ class DomainParticipant : public Entity
const fastrtps::types::TypeIdentifierSeq& in) const;

/**
* Helps the user to solve all dependencies calling internally to the typelookup service
* and registers the resulting dynamic type.
* The registration will be perform asynchronously and the user will be notified through the
* given callback, which receives the type_name as unique argument.
* If the type is already registered, the function will return true, but the callback will not be called.
* If the given type_information is enough to build the type without using the typelookup service,
* it will return true and the callback will be never called.
* Helps the user to solve all dependencies calling internally to the type lookup service and
* registers the resulting dynamic type.
* The registration may be perform asynchronously, case in which the user will be notified
* through the given callback, which receives the type_name as unique argument.
*
* @param type_information
* @param type_name
* @param callback
* @return true if type is already available (callback will not be called). false if type isn't available yet
* (the callback will be called if negotiation is success, and ignored in other case).
* @return RETCODE_OK If the given type_information is enough to build the type without using
* the typelookup service (callback will not be called).
* @return RETCODE_OK if the given type is already available (callback will not be called).
* @return RETCODE_NO_DATA if type is not available yet (the callback will be called if
* negotiation is success, and ignored in other case).
* @return RETCODE_NOT_ENABLED if the DomainParticipant is not enabled.
* @return RETCODE_PRECONDITION_NOT_MET if the DomainParticipant type lookup service is disabled.
*/
RTPS_DllAPI ReturnCode_t register_remote_type(
const fastrtps::types::TypeInformation& type_information,
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/fastdds/domain/DomainParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,7 @@ ReturnCode_t DomainParticipantImpl::register_remote_type(
// Move the filled vector to the map
parent_requests_.emplace(std::make_pair(requestId, std::move(vector)));

return ReturnCode_t::RETCODE_OK;
return ReturnCode_t::RETCODE_NO_DATA;
}
return ReturnCode_t::RETCODE_PRECONDITION_NOT_MET;
}
Expand Down
17 changes: 17 additions & 0 deletions src/cpp/fastdds/domain/DomainParticipantImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,23 @@ class DomainParticipantImpl
fastrtps::rtps::SampleIdentity get_types(
const fastrtps::types::TypeIdentifierSeq& in) const;

/**
* Helps the user to solve all dependencies calling internally to the typelookup service and
* registers the resulting dynamic type.
* The registration may be perform asynchronously, case in which the user will be notified
* through the given callback, which receives the type_name as unique argument.
*
* @param type_information
* @param type_name
* @param callback
* @return RETCODE_OK If the given type_information is enough to build the type without using
* the typelookup service (callback will not be called).
* @return RETCODE_OK if the given type is already available (callback will not be called).
* @return RETCODE_NO_DATA if type is not available yet (the callback will be called if
* negotiation is success, and ignored in other case).
* @return RETCODE_NOT_ENABLED if the DomainParticipant is not enabled.
* @return RETCODE_PRECONDITION_NOT_MET if the DomainParticipant type lookup service is disabled.
*/
ReturnCode_t register_remote_type(
const fastrtps::types::TypeInformation& type_information,
const std::string& type_name,
Expand Down