Skip to content

Commit bd83bb2

Browse files
adriancamporichiware
authored andcommitted
TypeLookup listeners implementation (#4240)
* Refs #20157: Implemented async_get_type replies. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20157: Changeds to instance_name. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20157: Changes to check_type_identifier_received Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20157: Added continuation point checks. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20157: Removed old function Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Implemented async_get_type request listener. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Added continuation point management Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Renames and comments improvements Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Fixed deadlock, renamed discovery methods. Applied suggestions. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Small fix in reply error check. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Created get_complementary_type_identifier method. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Added valid_matching check for TypeInformation. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Added send and receive error logs. Added missing continuation_point reply management Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Added check for requests with no TypeIdentifiers and small fixes. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Added listener classes to handle change acks Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Restored minimal_from_complete_type_identifier method from TypeObjectRegistry Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Fixes for TypeInformation serializer Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Added typelookup_service_threads to XMLParser Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160. Remove old function Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #20160. Fix Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #20160: Fixes for TypeLookupManager destruction with pending callbacks. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Changes for instance_names to use the full GUID. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Applied suggestions. Removed overloaded discovery methods. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Changes for xtypes doc. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Fix for LOG macro. Remove consistency check from register_type_object(from TypeLookupManager). Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Applied suggestions. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Removed obsolete check. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Fixed DS tests and warnings. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Fixes after rebase. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Windows warning. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Applied suggestions. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20160: Fixed tests. Signed-off-by: adriancampo <adriancampo@eprosima.com> * Refs #20242. Update unsupported_type_info tests. Now we works successfully against OpenDDS 3.27 Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #20242. Apply suggestion Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #20242. Fix log thread being killed in windows on unit test Signed-off-by: Ricardo González <ricardo@richiware.dev> --------- Signed-off-by: adriancampo <adriancampo@eprosima.com> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> Signed-off-by: Ricardo González <ricardo@richiware.dev> Co-authored-by: Ricardo González Moreno <ricardo@richiware.dev>
1 parent 3450af6 commit bd83bb2

64 files changed

Lines changed: 1981 additions & 1001 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/fastdds/dds/domain/DomainParticipantListener.hpp

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,9 @@ class DomainParticipantListener :
100100
*
101101
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
102102
* @param[out] info Remote DataReader information. User can take ownership of the object.
103-
*/
104-
virtual void on_subscriber_discovery(
105-
DomainParticipant* participant,
106-
fastrtps::rtps::ReaderDiscoveryInfo&& info)
107-
{
108-
static_cast<void>(participant);
109-
static_cast<void>(info);
110-
}
111-
112-
/*!
113-
* This method is called when a new DataReader is discovered, or a previously discovered DataReader changes
114-
* its QOS or is removed.
115-
*
116-
* @warning Not Supported. This callback will never be called in the current version.
117-
*
118-
* @param[out] participant Pointer to the Participant which discovered the remote DataReader.
119-
* @param[out] info Remote DataReader information. User can take ownership of the object.
120103
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataReader.
121104
*/
122-
virtual void on_subscriber_discovery(
105+
virtual void on_data_reader_discovery(
123106
DomainParticipant* participant,
124107
fastrtps::rtps::ReaderDiscoveryInfo&& info,
125108
bool& should_be_ignored)
@@ -135,26 +118,9 @@ class DomainParticipantListener :
135118
*
136119
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
137120
* @param[out] info Remote DataWriter information. User can take ownership of the object.
138-
*/
139-
virtual void on_publisher_discovery(
140-
DomainParticipant* participant,
141-
fastrtps::rtps::WriterDiscoveryInfo&& info)
142-
{
143-
static_cast<void>(participant);
144-
static_cast<void>(info);
145-
}
146-
147-
/*!
148-
* This method is called when a new DataWriter is discovered, or a previously discovered DataWriter changes
149-
* its QOS or is removed.
150-
*
151-
* @warning Not Supported. This callback will never be called in the current version.
152-
*
153-
* @param[out] participant Pointer to the Participant which discovered the remote DataWriter.
154-
* @param[out] info Remote DataWriter information. User can take ownership of the object.
155121
* @param[out] should_be_ignored Flag to indicate the library to automatically ignore the discovered DataWriter.
156122
*/
157-
virtual void on_publisher_discovery(
123+
virtual void on_data_writer_discovery(
158124
DomainParticipant* participant,
159125
fastrtps::rtps::WriterDiscoveryInfo&& info,
160126
bool& should_be_ignored)

include/fastdds/dds/domain/qos/DomainParticipantQos.hpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class DomainParticipantQos
8686
(this->builtin_controllers_sender_thread_ == b.builtin_controllers_sender_thread()) &&
8787
(this->timed_events_thread_ == b.timed_events_thread()) &&
8888
(this->discovery_server_thread_ == b.discovery_server_thread()) &&
89+
(this->typelookup_service_thread_ == b.typelookup_service_thread()) &&
8990
#if HAVE_SECURITY
9091
(this->security_log_thread_ == b.security_log_thread()) &&
9192
#endif // if HAVE_SECURITY
@@ -433,6 +434,37 @@ class DomainParticipantQos
433434
discovery_server_thread_ = value;
434435
}
435436

437+
/**
438+
* Getter for TypeLookup service ThreadSettings
439+
*
440+
* @return rtps::ThreadSettings reference
441+
*/
442+
rtps::ThreadSettings& typelookup_service_thread()
443+
{
444+
return typelookup_service_thread_;
445+
}
446+
447+
/**
448+
* Getter for TypeLookup service ThreadSettings
449+
*
450+
* @return rtps::ThreadSettings reference
451+
*/
452+
const rtps::ThreadSettings& typelookup_service_thread() const
453+
{
454+
return typelookup_service_thread_;
455+
}
456+
457+
/**
458+
* Setter for the TypeLookup service ThreadSettings
459+
*
460+
* @param value New ThreadSettings to be set
461+
*/
462+
void typelookup_service_thread(
463+
const rtps::ThreadSettings& value)
464+
{
465+
typelookup_service_thread_ = value;
466+
}
467+
436468
#if HAVE_SECURITY
437469
/**
438470
* Getter for security log ThreadSettings
@@ -505,6 +537,9 @@ class DomainParticipantQos
505537
//! Thread settings for the discovery server thread
506538
rtps::ThreadSettings discovery_server_thread_;
507539

540+
//! Thread settings for the builtin TypeLookup service requests and replies threads
541+
rtps::ThreadSettings typelookup_service_thread_;
542+
508543
#if HAVE_SECURITY
509544
//! Thread settings for the security log thread
510545
rtps::ThreadSettings security_log_thread_;

include/fastdds/dds/log/Log.hpp

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -282,17 +282,18 @@ class LogConsumer
282282
// Name of variables inside macros must be unique, or it could produce an error with external variables
283283
#if !HAVE_LOG_NO_ERROR
284284

285-
#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
285+
#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
286286
do { \
287-
using namespace eprosima::fastdds::dds; \
288287
std::stringstream fastdds_log_ss_tmp__; \
289288
fastdds_log_ss_tmp__ << msg; \
290-
Log::QueueLog(fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Error); \
289+
eprosima::fastdds::dds::Log::QueueLog( \
290+
fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \
291+
eprosima::fastdds::dds::Log::Kind::Error); \
291292
} while (0)
292293

293294
#elif (__INTERNALDEBUG || _INTERNALDEBUG)
294295

295-
#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
296+
#define EPROSIMA_LOG_ERROR_IMPL_(cat, msg) \
296297
do { \
297298
auto fastdds_log_lambda_tmp__ = [&]() \
298299
{ \
@@ -312,21 +313,21 @@ class LogConsumer
312313
***********/
313314
#if !HAVE_LOG_NO_WARNING
314315

315-
#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
316-
do { \
317-
using namespace eprosima::fastdds::dds; \
318-
if (Log::GetVerbosity() >= Log::Kind::Warning) \
319-
{ \
320-
std::stringstream fastdds_log_ss_tmp__; \
321-
fastdds_log_ss_tmp__ << msg; \
322-
Log::QueueLog( \
323-
fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, Log::Kind::Warning); \
324-
} \
316+
#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
317+
do { \
318+
if (eprosima::fastdds::dds::Log::GetVerbosity() >= eprosima::fastdds::dds::Log::Kind::Warning) \
319+
{ \
320+
std::stringstream fastdds_log_ss_tmp__; \
321+
fastdds_log_ss_tmp__ << msg; \
322+
eprosima::fastdds::dds::Log::QueueLog( \
323+
fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \
324+
eprosima::fastdds::dds::Log::Kind::Warning); \
325+
} \
325326
} while (0)
326327

327328
#elif (__INTERNALDEBUG || _INTERNALDEBUG)
328329

329-
#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
330+
#define EPROSIMA_LOG_WARNING_IMPL_(cat, msg) \
330331
do { \
331332
auto fastdds_log_lambda_tmp__ = [&]() \
332333
{ \
@@ -351,16 +352,16 @@ class LogConsumer
351352
((defined(__INTERNALDEBUG) || defined(_INTERNALDEBUG)) && (defined(_DEBUG) || defined(__DEBUG) || \
352353
!defined(NDEBUG))))
353354

354-
#define EPROSIMA_LOG_INFO_IMPL_(cat, msg) \
355-
do { \
356-
using namespace eprosima::fastdds::dds; \
357-
if (Log::GetVerbosity() >= Log::Kind::Info) \
358-
{ \
359-
std::stringstream fastdds_log_ss_tmp__; \
360-
fastdds_log_ss_tmp__ << msg; \
361-
Log::QueueLog(fastdds_log_ss_tmp__.str(), Log::Context{__FILE__, __LINE__, __func__, #cat}, \
362-
Log::Kind::Info); \
363-
} \
355+
#define EPROSIMA_LOG_INFO_IMPL_(cat, msg) \
356+
do { \
357+
if (eprosima::fastdds::dds::Log::GetVerbosity() >= eprosima::fastdds::dds::Log::Kind::Info) \
358+
{ \
359+
std::stringstream fastdds_log_ss_tmp__; \
360+
fastdds_log_ss_tmp__ << msg; \
361+
eprosima::fastdds::dds::Log::QueueLog( \
362+
fastdds_log_ss_tmp__.str(), eprosima::fastdds::dds::Log::Context{__FILE__, __LINE__, __func__, #cat}, \
363+
eprosima::fastdds::dds::Log::Kind::Info); \
364+
} \
364365
} while (0)
365366

366367
#elif (__INTERNALDEBUG || _INTERNALDEBUG)

include/fastdds/dds/xtypes/common.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
/*!
16-
* @file
16+
* @file common.hpp
1717
* This file contains common definitions for the different XTypes modules.
1818
*/
1919

@@ -43,8 +43,8 @@ enum class TryConstructKind : uint32_t
4343
TRIM
4444
};
4545

46-
/**
47-
* @brief PlacementKind values (@verbatim annotation)
46+
/*!
47+
* @brief PlacementKind values (verbatim annotation)
4848
*/
4949
enum class PlacementKind : uint32_t
5050
{

include/fastdds/dds/xtypes/dynamic_types/AnnotationDescriptor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FASTDDS_EXPORTED_API AnnotationDescriptor
4545

4646
/*!
4747
* Modifies the underlying type reference.
48-
* @param[in] @ref DynamicType reference.
48+
* @param[in] type @ref DynamicType reference.
4949
*/
5050
virtual void type(
5151
traits<DynamicType>::ref_type type) = 0;

include/fastdds/dds/xtypes/dynamic_types/DynamicData.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class DynamicData : public std::enable_shared_from_this<DynamicData>
168168
/*!
169169
* Retrieves an \b int32 value associated to an identifier.
170170
* @param[inout] value \b int32 to populate
171-
* @param[in] Id identifier of the member to query.
171+
* @param[in] id identifier of the member to query.
172172
* @return @ref ReturnCode_t
173173
* @retval RETCODE_OK when the value was retrieved successfully.
174174
* @retval RETCODE_BAD_PARAMETER when the @ref MemberId is invalid or the member type is not promotable to \b int32.
@@ -516,7 +516,7 @@ class DynamicData : public std::enable_shared_from_this<DynamicData>
516516

517517
/*!
518518
* Sets an \b bool value associated to an identifier
519-
* @param[in] Id identifier of the member to set.
519+
* @param[in] id identifier of the member to set.
520520
* @param[in] value \b bool to set.
521521
* @return @ref ReturnCode_t
522522
* @retval RETCODE_OK when the value was set successfully.

include/fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class DynamicDataFactory : public std::enable_shared_from_this<DynamicDataFactor
5757

5858
/**
5959
* Resets the internal reference if it is cached.
60-
* @param[in] type @ref DynamicData reference whose internal cached reference to reset.
60+
* @param[in] data @ref DynamicData reference whose internal cached reference to reset.
6161
* @return standard ReturnCode_t
6262
* @retval RETCODE_BAD_PARAMETER if reference is nil.
6363
* @retval RETCODE_OK is otherwise returned.

include/fastdds/dds/xtypes/dynamic_types/DynamicType.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class DynamicType : public std::enable_shared_from_this<DynamicType>
6060
/*!
6161
* Returns the member that corresponds to the specified name.
6262
* @param[inout] member @ref DynamicTypeMember reference used to return the reference to the member.
63+
* @param[in] name Member name of the member being queried.
6364
* @return @ref ReturnCode_t
6465
* @retval RETCODE_OK when the member was found.
6566
* @retval RETCODE_BAD_PARAMETER when the member doesn't exist.
@@ -154,7 +155,7 @@ class DynamicType : public std::enable_shared_from_this<DynamicType>
154155

155156
/**
156157
* State comparison according with the [standard] sections \b 7.5.2.8.4
157-
* @param[in] other @DynamicType reference to compare to
158+
* @param[in] other @ref DynamicType reference to compare to
158159
* @return \b bool `true` on equality
159160
*/
160161
FASTDDS_EXPORTED_API virtual bool equals(

include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilder.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class DynamicTypeBuilder : public std::enable_shared_from_this<DynamicTypeBuilde
7070

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

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

166166
/*!
167167
* Apply the given annotation to a member of this type.
168+
* @param[in] member_id Member identifier.
168169
* @param[in] descriptor @ref AnnotationDescriptor reference to be applied.
169170
* @return @ref ReturnCode_t
170171
* @retval RETCODE_OK when the annotation was applied successful.

include/fastdds/dds/xtypes/dynamic_types/DynamicTypeBuilderFactory.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
7878
traits<DynamicType>::ref_type type) = 0;
7979

8080
/*!
81-
* Creates a new @ref DynamicTypeBuilder reference based on the given @ref TypeObject instance.
82-
* @param[in] type_object @ref TypeObject instance to be used.
81+
* Creates a new @ref DynamicTypeBuilder reference based on the given @ref xtypes::TypeObject instance.
82+
* @param[in] type_object @ref xtypes::TypeObject instance to be used.
8383
* @return New @ref DynamicTypeBuilder reference. Nil reference returned in error case.
8484
*/
8585
FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_type_w_type_object(
@@ -117,7 +117,7 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
117117
/*!
118118
* Creates a new @ref DynamicTypeBuilder reference representing an array.
119119
* @param[in] element_type @ref DynamicType reference which becomes the element type
120-
* @param[in] bounds `uint32_t` representing the desired dimensions.
120+
* @param[in] bound `uint32_t` sequence representing the desired dimensions.
121121
* @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case.
122122
*/
123123
FASTDDS_EXPORTED_API virtual traits<DynamicTypeBuilder>::ref_type create_array_type(
@@ -126,8 +126,8 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
126126

127127
/*!
128128
* Creates a new @ref DynamicTypeBuilder reference representing a map.
129-
* @param[in] key_type @ref DynamicType reference which becomes the map's key type
130-
* @param[in] value_type @ref DynamicType reference which becomes the map's value type
129+
* @param[in] key_element_type @ref DynamicType reference which becomes the map's key type
130+
* @param[in] element_type @ref DynamicType reference which becomes the map's value type
131131
* @param[in] bound `uint32_t` representing the maximum number of elements that may be stored.
132132
* If the value is equal to LENGTH_UNLIMITED, the map type shall be considered to be unbounded.
133133
* @return new @ref DynamicTypeBuilder reference. Nil reference returned in error case.
@@ -148,7 +148,7 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
148148
/*!
149149
* Creates a new @ref DynamicTypeBuilder reference by parsing the type description at the given URL.
150150
* @remark Not implemented yet.
151-
* @param[in] URL pointing to the XML description.
151+
* @param[in] document_url pointing to the url containing the type description.
152152
* @param[in] type_name Fully qualified name of the type to be loaded from the document.
153153
* @param[in] include_paths A collection of URLs to directories to be searched for additional type description
154154
* documents.
@@ -162,7 +162,7 @@ class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTyp
162162
/*!
163163
* Creates a new @ref DynamicTypeBuilder reference by parsing the type description contained in the given string.
164164
* @remark Not implemented yet.
165-
* @param[in] String containing the type description.
165+
* @param[in] document containing the type description.
166166
* @param[in] type_name Fully qualified name of the type to be loaded from the string.
167167
* @param[in] include_paths A collection of URLs to directories to be searched for additional type description
168168
* documents.

0 commit comments

Comments
 (0)