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

[20242] TypeLookup listeners implementation #4240

Merged
merged 35 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0cfda34
Refs #20157: Implemented async_get_type replies.
adriancampo Dec 18, 2023
194d33b
Refs #20157: Changeds to instance_name.
adriancampo Dec 21, 2023
1b6d46a
Refs #20157: Changes to check_type_identifier_received
adriancampo Jan 4, 2024
cf38084
Refs #20157: Added continuation point checks.
adriancampo Jan 7, 2024
fb1ddd9
Refs #20157: Removed old function
adriancampo Jan 10, 2024
ea7cc75
Refs #20160: Implemented async_get_type request listener.
adriancampo Dec 19, 2023
6eafc4b
Refs #20160: Added continuation point management
adriancampo Jan 10, 2024
c391c63
Refs #20160: Renames and comments improvements
adriancampo Jan 11, 2024
5c078a9
Refs #20160: Fixed deadlock, renamed discovery methods. Applied sugge…
adriancampo Jan 18, 2024
f614319
Refs #20160: Small fix in reply error check.
adriancampo Jan 23, 2024
19a92ac
Refs #20160: Created get_complementary_type_identifier method.
adriancampo Jan 23, 2024
a797a5e
Refs #20160: Added valid_matching check for TypeInformation.
adriancampo Jan 23, 2024
0a928e0
Refs #20160: Added send and receive error logs. Added missing continu…
adriancampo Jan 24, 2024
3c1f427
Refs #20160: Added check for requests with no TypeIdentifiers and sma…
adriancampo Jan 25, 2024
9f3a1e3
Refs #20160: Added listener classes to handle change acks
adriancampo Jan 31, 2024
cdd0a4b
Refs #20160: Restored minimal_from_complete_type_identifier method fr…
adriancampo Feb 1, 2024
1e9bb28
Refs #20160: Fixes for TypeInformation serializer
adriancampo Feb 1, 2024
50ef6b0
Refs #20160: Added typelookup_service_threads to XMLParser
adriancampo Feb 4, 2024
9556352
Refs #20160. Remove old function
richiware Feb 6, 2024
343475d
Refs #20160. Fix
richiware Feb 6, 2024
129f7ea
Refs #20160: Fixes for TypeLookupManager destruction with pending cal…
adriancampo Feb 6, 2024
45f94b5
Refs #20160: Changes for instance_names to use the full GUID.
adriancampo Feb 7, 2024
f3f8121
Refs #20160: Applied suggestions. Removed overloaded discovery methods.
adriancampo Feb 18, 2024
e0040ed
Refs #20160: Changes for xtypes doc.
adriancampo Feb 2, 2024
61ace27
Refs #20160: Fix for LOG macro. Remove consistency check from registe…
adriancampo Mar 21, 2024
1bba30b
Refs #20160: Applied suggestions.
adriancampo Mar 26, 2024
f840f98
Refs #20160: Removed obsolete check.
adriancampo Mar 27, 2024
0a9026a
Refs #20160: Fixed DS tests and warnings.
adriancampo Apr 2, 2024
38c3df5
Refs #20160: Fixes after rebase.
adriancampo Apr 3, 2024
b45c43e
Refs #20160: Windows warning.
adriancampo Apr 3, 2024
6d3bdd2
Refs #20160: Applied suggestions.
adriancampo Apr 4, 2024
27a861e
Refs #20160: Fixed tests.
adriancampo Apr 5, 2024
b0e2e65
Refs #20242. Update unsupported_type_info tests.
richiware Apr 9, 2024
feea1ec
Refs #20242. Apply suggestion
richiware Apr 9, 2024
5ae348a
Refs #20242. Fix log thread being killed in windows on unit test
richiware Apr 10, 2024
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
38 changes: 2 additions & 36 deletions include/fastdds/dds/domain/DomainParticipantListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,9 @@ class DomainParticipantListener :
*
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
* @param[out] info Remote DataReader information. User can take ownership of the object.
*/
virtual void on_subscriber_discovery(
DomainParticipant* participant,
fastrtps::rtps::ReaderDiscoveryInfo&& info)
{
static_cast<void>(participant);
static_cast<void>(info);
}

/*!
* This method is called when a new DataReader is discovered, or a previously discovered DataReader changes
* its QOS or is removed.
*
* @warning Not Supported. This callback will never be called in the current version.
*
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
* @param[out] info Remote DataReader information. User can take ownership of the object.
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader.
*/
virtual void on_subscriber_discovery(
virtual void on_data_reader_discovery(
DomainParticipant* participant,
fastrtps::rtps::ReaderDiscoveryInfo&& info,
bool& should_be_ignored)
Expand All @@ -135,26 +118,9 @@ class DomainParticipantListener :
*
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
* @param[out] info Remote DataWriter information. User can take ownership of the object.
*/
virtual void on_publisher_discovery(
DomainParticipant* participant,
fastrtps::rtps::WriterDiscoveryInfo&& info)
{
static_cast<void>(participant);
static_cast<void>(info);
}

/*!
* This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes
* its QOS or is removed.
*
* @warning Not Supported. This callback will never be called in the current version.
*
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
* @param[out] info Remote DataWriter information. User can take ownership of the object.
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter.
*/
virtual void on_publisher_discovery(
virtual void on_data_writer_discovery(
DomainParticipant* participant,
fastrtps::rtps::WriterDiscoveryInfo&& info,
bool& should_be_ignored)
Expand Down
35 changes: 35 additions & 0 deletions include/fastdds/dds/domain/qos/DomainParticipantQos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class DomainParticipantQos
(this->builtin_controllers_sender_thread_ == b.builtin_controllers_sender_thread()) &&
(this->timed_events_thread_ == b.timed_events_thread()) &&
(this->discovery_server_thread_ == b.discovery_server_thread()) &&
(this->typelookup_service_thread_ == b.typelookup_service_thread()) &&
#if HAVE_SECURITY
(this->security_log_thread_ == b.security_log_thread()) &&
#endif // if HAVE_SECURITY
Expand Down Expand Up @@ -433,6 +434,37 @@ class DomainParticipantQos
discovery_server_thread_ = value;
}

/**
* Getter for TypeLookup service ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
rtps::ThreadSettings& typelookup_service_thread()
{
return typelookup_service_thread_;
}

/**
* Getter for TypeLookup service ThreadSettings
*
* @return rtps::ThreadSettings reference
*/
const rtps::ThreadSettings& typelookup_service_thread() const
{
return typelookup_service_thread_;
}

/**
* Setter for the TypeLookup service ThreadSettings
*
* @param value New ThreadSettings to be set
*/
void typelookup_service_thread(
const rtps::ThreadSettings& value)
{
typelookup_service_thread_ = value;
}

#if HAVE_SECURITY
/**
* Getter for security log ThreadSettings
Expand Down Expand Up @@ -505,6 +537,9 @@ class DomainParticipantQos
//! Thread settings for the discovery server thread
rtps::ThreadSettings discovery_server_thread_;

//! Thread settings for the builtin TypeLookup service requests and replies threads
rtps::ThreadSettings typelookup_service_thread_;

#if HAVE_SECURITY
//! Thread settings for the security log thread
rtps::ThreadSettings security_log_thread_;
Expand Down
51 changes: 26 additions & 25 deletions include/fastdds/dds/log/Log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,18 @@ class LogConsumer
// Name of variables inside macros must be unique, or it could produce an error with external variables
#if !HAVE_LOG_NO_ERROR

#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
do { \
using namespace eprosima::fastdds::dds; \
std::stringstream fastdds_log_ss_tmp__; \
fastdds_log_ss_tmp__ << msg; \
Log::QueueLog(fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Error); \
eprosima::fastdds::dds::Log::QueueLog( \
fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \
eprosima::fastdds::dds::Log::Kind::Error); \
} while (0)

#elif (__INTERNALDEBUG || _INTERNALDEBUG)

#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
do { \
auto fastdds_log_lambda_tmp__ = [&]() \
{ \
Expand All @@ -312,21 +313,21 @@ class LogConsumer
***********/
#if !HAVE_LOG_NO_WARNING

#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
do { \
using namespace eprosima::fastdds::dds; \
if (Log::GetVerbosity() >= Log::Kind::Warning) \
{ \
std::stringstream fastdds_log_ss_tmp__; \
fastdds_log_ss_tmp__ << msg; \
Log::QueueLog( \
fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Warning); \
} \
#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
do { \
if (eprosima::fastdds::dds::Log::GetVerbosity() >= eprosima::fastdds::dds::Log::Kind::Warning) \
{ \
std::stringstream fastdds_log_ss_tmp__; \
fastdds_log_ss_tmp__ << msg; \
eprosima::fastdds::dds::Log::QueueLog( \
fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \
eprosima::fastdds::dds::Log::Kind::Warning); \
} \
} while (0)

#elif (__INTERNALDEBUG || _INTERNALDEBUG)

#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
do { \
auto fastdds_log_lambda_tmp__ = [&]() \
{ \
Expand All @@ -351,16 +352,16 @@ class LogConsumer
((defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG)) && (defined(_DEBUG) || defined(__DEBUG) || \
!defined(NDEBUG))))

#define EPROSIMA_LOG_INFO_IMPL_(cat, msg) \
do { \
using namespace eprosima::fastdds::dds; \
if (Log::GetVerbosity() >= Log::Kind::Info) \
{ \
std::stringstream fastdds_log_ss_tmp__; \
fastdds_log_ss_tmp__ << msg; \
Log::QueueLog(fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, \
Log::Kind::Info); \
} \
#define EPROSIMA_LOG_INFO_IMPL_(cat, msg) \
do { \
if (eprosima::fastdds::dds::Log::GetVerbosity() >= eprosima::fastdds::dds::Log::Kind::Info) \
{ \
std::stringstream fastdds_log_ss_tmp__; \
fastdds_log_ss_tmp__ << msg; \
eprosima::fastdds::dds::Log::QueueLog( \
fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \
eprosima::fastdds::dds::Log::Kind::Info); \
} \
} while (0)

#elif (__INTERNALDEBUG || _INTERNALDEBUG)
Expand Down
6 changes: 3 additions & 3 deletions include/fastdds/dds/xtypes/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

/*!
* @file
* @file common.hpp
* This file contains common definitions for the different XTypes modules.
*/

Expand Down Expand Up @@ -43,8 +43,8 @@ enum class TryConstructKind : uint32_t
TRIM
};

/**
* @brief PlacementKind values (@verbatim annotation)
/*!
* @brief PlacementKind values (verbatim annotation)
*/
enum class PlacementKind : uint32_t
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FASTDDS_EXPORTED_API AnnotationDescriptor

/*!
* Modifies the underlying type reference.
* @param[in] @ref DynamicType reference.
* @param[in] type @ref DynamicType reference.
*/
virtual void type(
traits<DynamicType>::ref_type type) = 0;
Expand Down
4 changes: 2 additions & 2 deletions include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class DynamicData : public std::enable_shared_from_this<DynamicData>
/*!
* Retrieves an \b int32 value associated to an identifier.
* @param[inout] value \b int32 to populate
* @param[in] Id identifier of the member to query.
* @param[in] id identifier of the member to query.
* @return @ref ReturnCode_t
* @retval RETCODE_OK when the value was retrieved successfully.
* @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int32.
Expand Down Expand Up @@ -516,7 +516,7 @@ class DynamicData : public std::enable_shared_from_this<DynamicData>

/*!
* Sets an \b bool value associated to an identifier
* @param[in] Id identifier of the member to set.
* @param[in] id identifier of the member to set.
* @param[in] value \b bool to set.
* @return @ref ReturnCode_t
* @retval RETCODE_OK when the value was set successfully.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DynamicDataFactory : public std::enable_shared_from_this<DynamicDataFactor

/**
* Resets the internal reference if it is cached.
* @param[in] type @ref DynamicData reference whose internal cached reference to reset.
* @param[in] data @ref DynamicData reference whose internal cached reference to reset.
* @return standard ReturnCode_t
* @retval RETCODE_BAD_PARAMETER if reference is nil.
* @retval RETCODE_OK is otherwise returned.
Expand Down
3 changes: 2 additions & 1 deletion include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class DynamicType : public std::enable_shared_from_this<DynamicType>
/*!
* Returns the member that corresponds to the specified name.
* @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member.
* @param[in] name Member name of the member being queried.
* @return @ref ReturnCode_t
* @retval RETCODE_OK when the member was found.
* @retval RETCODE_BAD_PARAMETER when the member doesn't exist.
Expand Down Expand Up @@ -154,7 +155,7 @@ class DynamicType : public std::enable_shared_from_this<DynamicType>

/**
* State comparison according with the [standard] sections \b 7.5.2.8.4
* @param[in] other @DynamicType reference to compare to
* @param[in] other @ref DynamicType reference to compare to
* @return \b bool `true` on equality
*/
FASTDDS_EXPORTED_API virtual bool equals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DynamicTypeBuilder : public std::enable_shared_from_this<DynamicTypeBuilde

/*!
* Returns all members sorted by name.
* @param[inout] member @ref DynamicTypeMemberByName reference used to return all members.
* @param[inout] member DynamicTypeMemberByName reference used to return all members.
* @return @ref ReturnCode_t
* @retval RETCODE_OK always.
*/
Expand All @@ -90,7 +90,7 @@ class DynamicTypeBuilder : public std::enable_shared_from_this<DynamicTypeBuilde

/*!
* Returns all members sorted by MemberId.
* @param[inout] member @ref DynamicTypeMemberById reference used to return all members.
* @param[inout] member DynamicTypeMemberById reference used to return all members.
* @return @ref ReturnCode_t
* @retval RETCODE_OK always.
*/
Expand Down Expand Up @@ -165,6 +165,7 @@ class DynamicTypeBuilder : public std::enable_shared_from_this<DynamicTypeBuilde

/*!
* Apply the given annotation to a member of this type.
* @param[in] member_id Member identifier.
* @param[in] descriptor @ref AnnotationDescriptor reference to be applied.
* @return @ref ReturnCode_t
* @retval RETCODE_OK when the annotation was applied successful.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
traits<DynamicType>::ref_type type) = 0;

/*!
* Creates a new @ref DynamicTypeBuilder reference based on the given @ref TypeObject instance.
* @param[in] type_object @ref TypeObject instance to be used.
* Creates a new @ref DynamicTypeBuilder reference based on the given @ref xtypes::TypeObject instance.
* @param[in] type_object @ref xtypes::TypeObject instance to be used.
* @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case.
*/
FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type_w_type_object(
Expand Down Expand Up @@ -117,7 +117,7 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
/*!
* Creates a new @ref DynamicTypeBuilder reference representing an array.
* @param[in] element_type @ref DynamicType reference which becomes the element type
* @param[in] bounds `uint32_t` representing the desired dimensions.
* @param[in] bound `uint32_t` sequence representing the desired dimensions.
* @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case.
*/
FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_array_type(
Expand All @@ -126,8 +126,8 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp

/*!
* Creates a new @ref DynamicTypeBuilder reference representing a map.
* @param[in] key_type @ref DynamicType reference which becomes the map's key type
* @param[in] value_type @ref DynamicType reference which becomes the map's value type
* @param[in] key_element_type @ref DynamicType reference which becomes the map's key type
* @param[in] element_type @ref DynamicType reference which becomes the map's value type
* @param[in] bound `uint32_t` representing the maximum number of elements that may be stored.
* If the value is equal to LENGTH_UNLIMITED, the map type shall be considered to be unbounded.
* @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case.
Expand All @@ -148,7 +148,7 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
/*!
* Creates a new @ref DynamicTypeBuilder reference by parsing the type description at the given URL.
* @remark Not implemented yet.
* @param[in] URL pointing to the XML description.
* @param[in] document_url pointing to the url containing the type description.
* @param[in] type_name Fully qualified name of the type to be loaded from the document.
* @param[in] include_paths A collection of URLs to directories to be searched for additional type description
* documents.
Expand All @@ -162,7 +162,7 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
/*!
* Creates a new @ref DynamicTypeBuilder reference by parsing the type description contained in the given string.
* @remark Not implemented yet.
* @param[in] String containing the type description.
* @param[in] document containing the type description.
* @param[in] type_name Fully qualified name of the type to be loaded from the string.
* @param[in] include_paths A collection of URLs to directories to be searched for additional type description
* documents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class DynamicTypeMember : public std::enable_shared_from_this<DynamicTypeMember>

/**
* State comparison according with the [standard] sections \b 7.5.2.6.3
* @param[in] other @DynamicTypeMember reference to compare to
* @param[in] other @ref DynamicTypeMember reference to compare to
* @return \b bool `true` on equality
*/
FASTDDS_EXPORTED_API virtual bool equals(
Expand Down
Loading
Loading