Skip to content

Commit

Permalink
Regenerate Fast DDS types due to Gen release v3.2.1 (#4229)
Browse files Browse the repository at this point in the history
* Refs #20176: Regenerate types using script

Signed-off-by: JesusPoderoso <[email protected]>

* Refs #20176: Fix Win141 initialization

Signed-off-by: JesusPoderoso <[email protected]>

---------

Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso authored Jan 11, 2024
1 parent 8cf27c8 commit 39f47ba
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 157 deletions.
36 changes: 18 additions & 18 deletions src/cpp/statistics/types/monitorservice_typesCdrAux.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -660,47 +660,47 @@ eProsima_user_DllExport size_t calculate_serialized_size(
switch (data._d())
{
case eprosima::fastdds::statistics::PROXY:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
data.entity_proxy(), current_alignment);
break;

case eprosima::fastdds::statistics::CONNECTION_LIST:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
data.connection_list(), current_alignment);
break;

case eprosima::fastdds::statistics::INCOMPATIBLE_QOS:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
data.incompatible_qos_status(), current_alignment);
break;

case eprosima::fastdds::statistics::INCONSISTENT_TOPIC:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
data.inconsistent_topic_status(), current_alignment);
break;

case eprosima::fastdds::statistics::LIVELINESS_LOST:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
data.liveliness_lost_status(), current_alignment);
break;

case eprosima::fastdds::statistics::LIVELINESS_CHANGED:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
data.liveliness_changed_status(), current_alignment);
break;

case eprosima::fastdds::statistics::DEADLINE_MISSED:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
data.deadline_missed_status(), current_alignment);
break;

case eprosima::fastdds::statistics::SAMPLE_LOST:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
data.sample_lost_status(), current_alignment);
break;

case eprosima::fastdds::statistics::STATUSES_SIZE:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9),
data.statuses_size(), current_alignment);
break;

Expand Down Expand Up @@ -732,39 +732,39 @@ eProsima_user_DllExport void serialize(
switch (data._d())
{
case eprosima::fastdds::statistics::PROXY:
scdr << eprosima::fastcdr::MemberId(0) << data.entity_proxy();
scdr << eprosima::fastcdr::MemberId(1) << data.entity_proxy();
break;

case eprosima::fastdds::statistics::CONNECTION_LIST:
scdr << eprosima::fastcdr::MemberId(1) << data.connection_list();
scdr << eprosima::fastcdr::MemberId(2) << data.connection_list();
break;

case eprosima::fastdds::statistics::INCOMPATIBLE_QOS:
scdr << eprosima::fastcdr::MemberId(2) << data.incompatible_qos_status();
scdr << eprosima::fastcdr::MemberId(3) << data.incompatible_qos_status();
break;

case eprosima::fastdds::statistics::INCONSISTENT_TOPIC:
scdr << eprosima::fastcdr::MemberId(3) << data.inconsistent_topic_status();
scdr << eprosima::fastcdr::MemberId(4) << data.inconsistent_topic_status();
break;

case eprosima::fastdds::statistics::LIVELINESS_LOST:
scdr << eprosima::fastcdr::MemberId(4) << data.liveliness_lost_status();
scdr << eprosima::fastcdr::MemberId(5) << data.liveliness_lost_status();
break;

case eprosima::fastdds::statistics::LIVELINESS_CHANGED:
scdr << eprosima::fastcdr::MemberId(5) << data.liveliness_changed_status();
scdr << eprosima::fastcdr::MemberId(6) << data.liveliness_changed_status();
break;

case eprosima::fastdds::statistics::DEADLINE_MISSED:
scdr << eprosima::fastcdr::MemberId(6) << data.deadline_missed_status();
scdr << eprosima::fastcdr::MemberId(7) << data.deadline_missed_status();
break;

case eprosima::fastdds::statistics::SAMPLE_LOST:
scdr << eprosima::fastcdr::MemberId(7) << data.sample_lost_status();
scdr << eprosima::fastcdr::MemberId(8) << data.sample_lost_status();
break;

case eprosima::fastdds::statistics::STATUSES_SIZE:
scdr << eprosima::fastcdr::MemberId(8) << data.statuses_size();
scdr << eprosima::fastcdr::MemberId(9) << data.statuses_size();
break;

default:
Expand Down
32 changes: 16 additions & 16 deletions src/cpp/statistics/types/typesCdrAux.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -1496,24 +1496,24 @@ eProsima_user_DllExport size_t calculate_serialized_size(
switch (data._d())
{
case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
data.writer_reader_data(), current_alignment);
break;

case eprosima::fastdds::statistics::NETWORK_LATENCY:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
data.locator2locator_data(), current_alignment);
break;

case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT:
case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
data.entity_data(), current_alignment);
break;

case eprosima::fastdds::statistics::RTPS_SENT:
case eprosima::fastdds::statistics::RTPS_LOST:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
data.entity2locator_traffic(), current_alignment);
break;

Expand All @@ -1525,22 +1525,22 @@ eProsima_user_DllExport size_t calculate_serialized_size(
case eprosima::fastdds::statistics::DATA_COUNT:
case eprosima::fastdds::statistics::PDP_PACKETS:
case eprosima::fastdds::statistics::EDP_PACKETS:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
data.entity_count(), current_alignment);
break;

case eprosima::fastdds::statistics::DISCOVERED_ENTITY:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
data.discovery_time(), current_alignment);
break;

case eprosima::fastdds::statistics::SAMPLE_DATAS:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
data.sample_identity_count(), current_alignment);
break;

case eprosima::fastdds::statistics::PHYSICAL_DATA:
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
data.physical_data(), current_alignment);
break;

Expand Down Expand Up @@ -1572,21 +1572,21 @@ eProsima_user_DllExport void serialize(
switch (data._d())
{
case eprosima::fastdds::statistics::HISTORY2HISTORY_LATENCY:
scdr << eprosima::fastcdr::MemberId(0) << data.writer_reader_data();
scdr << eprosima::fastcdr::MemberId(1) << data.writer_reader_data();
break;

case eprosima::fastdds::statistics::NETWORK_LATENCY:
scdr << eprosima::fastcdr::MemberId(1) << data.locator2locator_data();
scdr << eprosima::fastcdr::MemberId(2) << data.locator2locator_data();
break;

case eprosima::fastdds::statistics::PUBLICATION_THROUGHPUT:
case eprosima::fastdds::statistics::SUBSCRIPTION_THROUGHPUT:
scdr << eprosima::fastcdr::MemberId(2) << data.entity_data();
scdr << eprosima::fastcdr::MemberId(3) << data.entity_data();
break;

case eprosima::fastdds::statistics::RTPS_SENT:
case eprosima::fastdds::statistics::RTPS_LOST:
scdr << eprosima::fastcdr::MemberId(3) << data.entity2locator_traffic();
scdr << eprosima::fastcdr::MemberId(4) << data.entity2locator_traffic();
break;

case eprosima::fastdds::statistics::RESENT_DATAS:
Expand All @@ -1597,19 +1597,19 @@ eProsima_user_DllExport void serialize(
case eprosima::fastdds::statistics::DATA_COUNT:
case eprosima::fastdds::statistics::PDP_PACKETS:
case eprosima::fastdds::statistics::EDP_PACKETS:
scdr << eprosima::fastcdr::MemberId(4) << data.entity_count();
scdr << eprosima::fastcdr::MemberId(5) << data.entity_count();
break;

case eprosima::fastdds::statistics::DISCOVERED_ENTITY:
scdr << eprosima::fastcdr::MemberId(5) << data.discovery_time();
scdr << eprosima::fastcdr::MemberId(6) << data.discovery_time();
break;

case eprosima::fastdds::statistics::SAMPLE_DATAS:
scdr << eprosima::fastcdr::MemberId(6) << data.sample_identity_count();
scdr << eprosima::fastcdr::MemberId(7) << data.sample_identity_count();
break;

case eprosima::fastdds::statistics::PHYSICAL_DATA:
scdr << eprosima::fastcdr::MemberId(7) << data.physical_data();
scdr << eprosima::fastcdr::MemberId(8) << data.physical_data();
break;

default:
Expand Down
14 changes: 7 additions & 7 deletions test/blackbox/types/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ HelloWorldPubSubType::HelloWorldPubSubType()
setName("HelloWorld");
uint32_t type_size =
#if FASTCDR_VERSION_MAJOR == 1
static_cast<uint32_t>(HelloWorld::getMaxCdrSerializedSize());
static_cast<uint32_t>(HelloWorld::getMaxCdrSerializedSize());
#else
HelloWorld_max_cdr_typesize;
#endif // if FASTCDR_VERSION_MAJOR == 1
HelloWorld_max_cdr_typesize;
#endif
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
m_typeSize = type_size + 4; /*encapsulation*/
m_isGetKeyDefined = false;
Expand Down Expand Up @@ -150,8 +150,8 @@ std::function<uint32_t()> HelloWorldPubSubType::getSerializedSizeProvider(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<HelloWorld*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<HelloWorld*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -189,8 +189,7 @@ bool HelloWorldPubSubType::getKey(
HelloWorld_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv1);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv1);
#if FASTCDR_VERSION_MAJOR == 1
p_type->serializeKey(ser);
#else
Expand Down Expand Up @@ -219,3 +218,4 @@ bool HelloWorldPubSubType::getKey(
}
return true;
}

35 changes: 16 additions & 19 deletions test/blackbox/types/HelloWorldTypeObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
} // namespace
#endif // ifdef _WIN32
namespace { char dummy; }
#endif

#include "HelloWorld.h"
#include "HelloWorldTypeObject.h"
Expand All @@ -45,7 +43,7 @@ void registerHelloWorldTypes()
static std::once_flag once_flag;
std::call_once(once_flag, []()
{
TypeObjectFactory* factory = TypeObjectFactory::get_instance();
TypeObjectFactory *factory = TypeObjectFactory::get_instance();
factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(true),
GetHelloWorldObject(true));
factory->add_type_object("HelloWorld", GetHelloWorldIdentifier(false),
Expand All @@ -54,10 +52,11 @@ void registerHelloWorldTypes()
});
}

const TypeIdentifier* GetHelloWorldIdentifier(
bool complete)


const TypeIdentifier* GetHelloWorldIdentifier(bool complete)
{
const TypeIdentifier* c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete);
const TypeIdentifier * c_identifier = TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete);
if (c_identifier != nullptr && (!complete || c_identifier->_d() == EK_COMPLETE))
{
return c_identifier;
Expand All @@ -67,8 +66,7 @@ const TypeIdentifier* GetHelloWorldIdentifier(
return TypeObjectFactory::get_instance()->get_type_identifier("HelloWorld", complete);
}

const TypeObject* GetHelloWorldObject(
bool complete)
const TypeObject* GetHelloWorldObject(bool complete)
{
const TypeObject* c_type_object = TypeObjectFactory::get_instance()->get_type_object("HelloWorld", complete);
if (c_type_object != nullptr)
Expand All @@ -91,7 +89,7 @@ const TypeObject* GetMinimalHelloWorldObject()
return c_type_object;
}

TypeObject* type_object = new TypeObject();
TypeObject *type_object = new TypeObject();
type_object->_d(EK_MINIMAL);
type_object->minimal()._d(TK_STRUCTURE);

Expand All @@ -115,7 +113,7 @@ const TypeObject* GetMinimalHelloWorldObject()


MD5 index_hash("index");
for (int i = 0; i < 4; ++i)
for(int i = 0; i < 4; ++i)
{
mst_index.detail().name_hash()[i] = index_hash.digest[i];
}
Expand All @@ -133,7 +131,7 @@ const TypeObject* GetMinimalHelloWorldObject()
mst_message.common().member_type_id(*TypeObjectFactory::get_instance()->get_string_identifier(128, false));

MD5 message_hash("message");
for (int i = 0; i < 4; ++i)
for(int i = 0; i < 4; ++i)
{
mst_message.detail().name_hash()[i] = message_hash.digest[i];
}
Expand All @@ -150,7 +148,7 @@ const TypeObject* GetMinimalHelloWorldObject()
eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1);
size_t current_alignment {0};
SerializedPayload_t payload(static_cast<uint32_t>(
calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4));
calculator.calculate_serialized_size(type_object->minimal().struct_type(), current_alignment) + 4));
eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size);
// Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document)
eprosima::fastcdr::Cdr ser(
Expand All @@ -167,7 +165,7 @@ const TypeObject* GetMinimalHelloWorldObject()
MD5 objectHash;
objectHash.update((char*)payload.data, payload.length);
objectHash.finalize();
for (int i = 0; i < 14; ++i)
for(int i = 0; i < 14; ++i)
{
identifier.equivalence_hash()[i] = objectHash.digest[i];
}
Expand All @@ -185,7 +183,7 @@ const TypeObject* GetCompleteHelloWorldObject()
return c_type_object;
}

TypeObject* type_object = new TypeObject();
TypeObject *type_object = new TypeObject();
type_object->_d(EK_COMPLETE);
type_object->complete()._d(TK_STRUCTURE);

Expand Down Expand Up @@ -231,7 +229,6 @@ const TypeObject* GetCompleteHelloWorldObject()
// Header
type_object->complete().struct_type().header().detail().type_name("HelloWorld");
// TODO inheritance

{
AppliedAnnotation ann;
//ann.annotation_typeid(GetfinalIdentifier(true));
Expand All @@ -246,7 +243,7 @@ const TypeObject* GetCompleteHelloWorldObject()
eprosima::fastcdr::CdrSizeCalculator calculator(eprosima::fastcdr::CdrVersion::XCDRv1);
size_t current_alignment {0};
SerializedPayload_t payload(static_cast<uint32_t>(
calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4));
calculator.calculate_serialized_size(type_object->complete().struct_type(), current_alignment) + 4));
eprosima::fastcdr::FastBuffer fastbuffer((char*) payload.data, payload.max_size);
// Fixed endian (Page 221, EquivalenceHash definition of Extensible and Dynamic Topic Types for DDS document)
eprosima::fastcdr::Cdr ser(
Expand All @@ -263,7 +260,7 @@ const TypeObject* GetCompleteHelloWorldObject()
MD5 objectHash;
objectHash.update((char*)payload.data, payload.length);
objectHash.finalize();
for (int i = 0; i < 14; ++i)
for(int i = 0; i < 14; ++i)
{
identifier.equivalence_hash()[i] = objectHash.digest[i];
}
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/types/HelloWorldv1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct FindType {
};
}

#define HelloWorld_max_cdr_typesize 141ULL;
#define HelloWorld_max_cdr_typesize 137ULL;



Expand Down
Loading

0 comments on commit 39f47ba

Please sign in to comment.