Skip to content

Commit 26dcf76

Browse files
committed
Refs #21044. Regenerate idl files
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
1 parent 6802780 commit 26dcf76

4 files changed

Lines changed: 31 additions & 134 deletions

File tree

code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ bool HelloWorldPubSubType::getKey(
219219
return true;
220220
}
221221

222-
void HelloWorldPubSubType::register_type_object_representation() const
222+
void HelloWorldPubSubType::register_type_object_representation()
223223
{
224-
register_HelloWorld_type_objects();
224+
register_HelloWorld_type_identifier(type_identifiers_);
225225
}
226226

227227

code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
8989
void* data) override;
9090

9191
//Register TypeObject representation in Fast DDS TypeObjectRegistry
92-
eProsima_user_DllExport void register_type_object_representation() const override;
92+
eProsima_user_DllExport void register_type_object_representation() override;
9393

9494
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
9595
eProsima_user_DllExport inline bool is_bounded() const override

code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.cxx

Lines changed: 27 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,19 @@
3838

3939
using namespace eprosima::fastdds::dds::xtypes;
4040

41-
void register_HelloWorld_type_objects()
42-
{
43-
static std::once_flag once_flag;
44-
std::call_once(once_flag, []()
45-
{
46-
TypeIdentifier type_id;
47-
register_HelloWorld_type_identifier(type_id);
48-
49-
});
50-
}
51-
5241
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
5342
void register_HelloWorld_type_identifier(
54-
TypeIdentifier& type_id)
43+
TypeIdentifierPair& type_ids_HelloWorld)
5544
{
45+
46+
ReturnCode_t return_code_HelloWorld {eprosima::fastdds::dds::RETCODE_OK};
47+
return_code_HelloWorld =
48+
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
49+
"HelloWorld", type_ids_HelloWorld);
50+
if (eprosima::fastdds::dds::RETCODE_OK != return_code_HelloWorld)
5651
{
5752
StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::NOT_APPLIED,
5853
false, false);
59-
ReturnCode_t return_code_HelloWorld;
60-
TypeIdentifierPair type_ids_HelloWorld;
6154
QualifiedTypeName type_name_HelloWorld = "HelloWorld";
6255
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_HelloWorld;
6356
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_HelloWorld;
@@ -66,62 +59,26 @@ void register_HelloWorld_type_identifier(
6659
header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld);
6760
CompleteStructMemberSeq member_seq_HelloWorld;
6861
{
69-
return_code_HelloWorld =
62+
TypeIdentifierPair type_ids_index;
63+
ReturnCode_t return_code_index {eprosima::fastdds::dds::RETCODE_OK};
64+
return_code_index =
7065
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
71-
"_uint32_t", type_ids_HelloWorld);
66+
"_uint32_t", type_ids_index);
7267

73-
if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK)
68+
if (eprosima::fastdds::dds::RETCODE_OK != return_code_index)
7469
{
7570
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
7671
"index Structure member TypeIdentifier unknown to TypeObjectRegistry.");
77-
type_id = TypeIdentifier();
7872
return;
7973
}
8074
StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED,
8175
false, false, false, false);
82-
CommonStructMember common_index;
8376
MemberId member_id_index = 0x00000000;
84-
if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() ||
85-
(TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() &&
86-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) ||
87-
(TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() &&
88-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) ||
89-
(TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() &&
90-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) ||
91-
(TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() &&
92-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) ||
93-
(TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() &&
94-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() ||
95-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) ||
96-
(TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() &&
97-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() ||
98-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d())))
77+
bool common_index_ec {false};
78+
CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_index, common_index_ec))};
79+
if (!common_index_ec)
9980
{
100-
common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier1());
101-
}
102-
else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() ||
103-
(TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() &&
104-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) ||
105-
(TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() &&
106-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) ||
107-
(TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() &&
108-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) ||
109-
(TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() &&
110-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) ||
111-
(TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() &&
112-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() ||
113-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) ||
114-
(TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() &&
115-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() ||
116-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d())))
117-
{
118-
common_index = TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, type_ids_HelloWorld.type_identifier2());
119-
}
120-
else
121-
{
122-
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
123-
"Structure index member TypeIdentifier inconsistent.");
124-
type_id = TypeIdentifier();
81+
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure index member TypeIdentifier inconsistent.");
12582
return;
12683
}
12784
MemberName name_index = "index";
@@ -132,79 +89,34 @@ void register_HelloWorld_type_identifier(
13289
TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index);
13390
}
13491
{
135-
return_code_HelloWorld =
92+
TypeIdentifierPair type_ids_message;
93+
ReturnCode_t return_code_message {eprosima::fastdds::dds::RETCODE_OK};
94+
return_code_message =
13695
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
137-
"anonymous_string_unbounded", type_ids_HelloWorld);
96+
"anonymous_string_unbounded", type_ids_message);
13897

139-
if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK)
98+
if (eprosima::fastdds::dds::RETCODE_OK != return_code_message)
14099
{
141100
{
142101
SBound bound = 0;
143102
StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound);
144103
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
145104
TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn,
146-
"anonymous_string_unbounded"))
105+
"anonymous_string_unbounded", type_ids_message))
147106
{
148107
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
149108
"anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
150109
}
151110
}
152-
return_code_HelloWorld =
153-
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
154-
"anonymous_string_unbounded", type_ids_HelloWorld);
155-
if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK)
156-
{
157-
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
158-
"anonymous_string_unbounded: Given String TypeIdentifier unknown to TypeObjectRegistry.");
159-
type_id = TypeIdentifier();
160-
return;
161-
}
162111
}
163112
StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructKind::NOT_APPLIED,
164113
false, false, false, false);
165-
CommonStructMember common_message;
166114
MemberId member_id_message = 0x00000001;
167-
if (EK_COMPLETE == type_ids_HelloWorld.type_identifier1()._d() || TK_NONE == type_ids_HelloWorld.type_identifier2()._d() ||
168-
(TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier1()._d() &&
169-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_sdefn().header().equiv_kind()) ||
170-
(TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier1()._d() &&
171-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().seq_ldefn().header().equiv_kind()) ||
172-
(TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier1()._d() &&
173-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_sdefn().header().equiv_kind()) ||
174-
(TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier1()._d() &&
175-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().array_ldefn().header().equiv_kind()) ||
176-
(TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier1()._d() &&
177-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().header().equiv_kind() ||
178-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_sdefn().key_identifier()->_d())) ||
179-
(TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier1()._d() &&
180-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().header().equiv_kind() ||
181-
EK_COMPLETE == type_ids_HelloWorld.type_identifier1().map_ldefn().key_identifier()->_d())))
182-
{
183-
common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier1());
184-
}
185-
else if (EK_COMPLETE == type_ids_HelloWorld.type_identifier2()._d() ||
186-
(TI_PLAIN_SEQUENCE_SMALL == type_ids_HelloWorld.type_identifier2()._d() &&
187-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_sdefn().header().equiv_kind()) ||
188-
(TI_PLAIN_SEQUENCE_LARGE == type_ids_HelloWorld.type_identifier2()._d() &&
189-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().seq_ldefn().header().equiv_kind()) ||
190-
(TI_PLAIN_ARRAY_SMALL == type_ids_HelloWorld.type_identifier2()._d() &&
191-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_sdefn().header().equiv_kind()) ||
192-
(TI_PLAIN_ARRAY_LARGE == type_ids_HelloWorld.type_identifier2()._d() &&
193-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().array_ldefn().header().equiv_kind()) ||
194-
(TI_PLAIN_MAP_SMALL == type_ids_HelloWorld.type_identifier2()._d() &&
195-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().header().equiv_kind() ||
196-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_sdefn().key_identifier()->_d())) ||
197-
(TI_PLAIN_MAP_LARGE == type_ids_HelloWorld.type_identifier2()._d() &&
198-
(EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().header().equiv_kind() ||
199-
EK_COMPLETE == type_ids_HelloWorld.type_identifier2().map_ldefn().key_identifier()->_d())))
200-
{
201-
common_message = TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, type_ids_HelloWorld.type_identifier2());
202-
}
203-
else
115+
bool common_message_ec {false};
116+
CommonStructMember common_message {TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_message, common_message_ec))};
117+
if (!common_message_ec)
204118
{
205-
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
206-
"Structure message member TypeIdentifier inconsistent.");
207-
type_id = TypeIdentifier();
119+
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure message member TypeIdentifier inconsistent.");
208120
return;
209121
}
210122
MemberName name_message = "message";
@@ -216,21 +128,11 @@ void register_HelloWorld_type_identifier(
216128
}
217129
CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld);
218130
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
219-
TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string(), type_id))
131+
TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string(), type_ids_HelloWorld))
220132
{
221133
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
222134
"HelloWorld already registered in TypeObjectRegistry for a different type.");
223135
}
224-
return_code_HelloWorld =
225-
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
226-
"HelloWorld", type_ids_HelloWorld);
227-
if (return_code_HelloWorld != eprosima::fastdds::dds::RETCODE_OK)
228-
{
229-
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
230-
"HelloWorld: Given Struct TypeIdentifier unknown to TypeObjectRegistry.");
231-
type_id = TypeIdentifier();
232-
return;
233-
}
234136
}
235137
}
236138

code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
#define eProsima_user_DllExport
3636
#endif // _WIN32
3737

38-
/**
39-
* @brief Register every TypeObject representation defined in the IDL file in Fast DDS TypeObjectRegistry.
40-
*/
41-
eProsima_user_DllExport void register_HelloWorld_type_objects();
42-
4338
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
4439

4540
/**
@@ -53,7 +48,7 @@ eProsima_user_DllExport void register_HelloWorld_type_objects();
5348
* Invalid TypeIdentifier is returned in case of error.
5449
*/
5550
eProsima_user_DllExport void register_HelloWorld_type_identifier(
56-
eprosima::fastdds::dds::xtypes::TypeIdentifier& type_id);
51+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
5752

5853

5954
#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC

0 commit comments

Comments
 (0)