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

[20595] DynamicType implementation #4190

Merged
merged 100 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
f446e29
Refs 17138. DynamicTypePtr as shared_ptr alias
Feb 8, 2023
877138d
Refs 17138. Applied new dynamic-types Types.hpp
richiware Nov 27, 2023
4e919ff
Refs 17138. New TypeDescriptor
richiware Nov 29, 2023
3579434
Refs 17138. Applying new TypeDescriptor
richiware Nov 29, 2023
3b1baca
Refs 17138. Update after rebase new TypeDescriptor
richiware Nov 30, 2023
75eb833
Refs 17138. New MemberDescriptor API
richiware Dec 4, 2023
59c8550
Refs 17138. New MemberDescriptor impl
richiware Dec 4, 2023
853e776
Refs 17138. Fix after rebase
richiware Dec 11, 2023
6dc121d
Refs 17138. New AnnotationDescriptor impl
richiware Dec 11, 2023
8403e76
Refs 17138. New DynamicTypeMember API
richiware Dec 14, 2023
ee96a5d
Refs 17138. New DynamicTypeMember impl
richiware Dec 14, 2023
73301b5
Refs 17138. Fix after rebase
richiware Dec 14, 2023
58a9761
Refs 17138. New DynamicType API
richiware Dec 14, 2023
db913bb
Refs 17138. New DynamicType impl
richiware Dec 14, 2023
af1a25e
Refs 17138. New DynamicTypeBuilder API
richiware Dec 18, 2023
48a37d4
Refs 17138. New DynamicTypeBuilder impl
richiware Dec 18, 2023
aa4105b
Refs 17138. New DynamicTypeBuilderFactory API
richiware Dec 19, 2023
1bae894
Refs 17138. New DynamicTypeBuilderFactory impl
richiware Dec 19, 2023
3980d08
Refs #17138. New DynamicData API
richiware Dec 21, 2023
2011fdb
Refs #17138. New DynamicData impl
richiware Dec 21, 2023
45b6f38
Refs #17138. Fix after rebase
richiware Dec 21, 2023
2b4177f
Refs #17138. Fixes
richiware Dec 22, 2023
ab62c5b
Refs #17138. Continue impl DynamicData
richiware Dec 29, 2023
f18d368
Refs #17138. First approach XVCRv2
richiware Jan 9, 2024
beb5dd0
Refs #17138. Several:
richiware Jan 11, 2024
1dbc9a7
Refs #17138. Support string types
richiware Jan 11, 2024
b9f03be
Refs #17138. Support string types
richiware Jan 11, 2024
793a21d
Refs #17138. Fixes after rebase
richiware Jan 15, 2024
023bbe6
Refs #17138. Add primitive sequences
richiware Jan 15, 2024
0781c8a
Refs #17138. Support sequences inside sequences
richiware Jan 16, 2024
29d87b2
Refs #17138. Support of arrays
richiware Jan 17, 2024
cbf6d35
Refs #17138. Improve structure support
richiware Jan 18, 2024
88c46c3
Refs #17138. Support unions.
richiware Jan 23, 2024
6ea0dc5
Refs #17138. Support of maps.
richiware Jan 25, 2024
733470b
Refs #17138. Support of bitmasks
richiware Jan 29, 2024
a96950e
Refs #17138. Fix rebase and remove use of old dynamic api
richiware Jan 29, 2024
45eeec1
Refs #17138. Remove old code
richiware Jan 29, 2024
d0ed6fb
Refs #17138. Refactor test to use DDS API
richiware Jan 31, 2024
f9c9a38
Refs #17138. Fixes
richiware Jan 31, 2024
91dbea9
Refs #17138. Bring to live xml tests
richiware Feb 1, 2024
4d91513
Refs #17138. Fix
richiware Feb 7, 2024
33dca37
Refs #17138. Forgotten use of template
richiware Feb 7, 2024
91b374f
Refs #17138. Support of bitsets
richiware Feb 8, 2024
9e272a7
Refs #17138.
richiware Feb 11, 2024
a355bd7
Refs #17138. Testing calculate_max_serialized_size.
richiware Feb 13, 2024
b9dc526
Refs #17138. Implement DynamicData::clone
richiware Feb 14, 2024
a04e951
Refs #17138. Implement get_complex_data
richiware Feb 15, 2024
8430790
Refs #17138. Fix aliases of enumerators
richiware Feb 15, 2024
eb4a7dc
Refs #17138. Move dynamictests to feature folder
richiware Feb 15, 2024
5cd7a04
Refs #17138. Implementation set_complex_value
richiware Feb 15, 2024
c299de6
Refs #17138. Fix warning on windows
richiware Feb 15, 2024
2d7e511
Refs #17138. Improve alias management
richiware Feb 16, 2024
9887b35
Refs #17138. Remove unused file
richiware Feb 16, 2024
e2a13b5
Refs #17138. Fix warnings on Windows
richiware Feb 16, 2024
77cf260
Refs #17138. Change Bitmask behaviour
richiware Feb 16, 2024
7852bb7
Refs #17138. Fix warnings on Windows
richiware Feb 19, 2024
a1dead4
Refs #17138. Improve bitmask usage
richiware Feb 19, 2024
f1f70f9
Refs #17138. Removed examples
richiware Feb 19, 2024
e83400e
Refs #17138. Fix warnings
richiware Feb 19, 2024
dd5d112
Refs #17138. Fix bitfield as boolean
richiware Feb 19, 2024
7e1cd25
Refs #17138. Fix warnings on windows
richiware Feb 19, 2024
f323249
Refs #17138. Fix bitset
richiware Feb 19, 2024
abe4c56
Refs #17138. Remove unused header
richiware Feb 19, 2024
dab3062
Refs #17138. Using new CdrSizeCalculator API for arrays
richiware Feb 20, 2024
3d5e887
Refs #17138. Refactor xtypes interface library
richiware Feb 20, 2024
ee34a9d
Refs #17138. Fix warnings on windows
richiware Feb 21, 2024
1923d7d
Refs #17138. Improves reviewing
richiware Feb 22, 2024
8e090d0
Refs #17138. Fix deserialization of unions
richiware Feb 23, 2024
b950678
Refs #17138. Applying review
richiware Feb 26, 2024
918ffbc
Refs #17138. Applying changes after review
richiware Feb 26, 2024
b58da2f
Refs #17138. Several fixes
richiware Feb 27, 2024
13db9ad
Refs #17138. Several fixes
richiware Feb 27, 2024
e06e3ec
Refs #17138.
richiware Feb 28, 2024
bdf23ff
Refs #17138.
richiware Feb 29, 2024
e951acb
Refs #17138. Remove obsolete test code
richiware Feb 29, 2024
e416331
Refs #17138. Fixing arrays and sequences
richiware Feb 29, 2024
74d2245
Refs #17138. Remove todos
richiware Feb 29, 2024
2400112
Refs #17138. Fix
richiware Feb 29, 2024
1797a78
Refs #17138. Fix accessing an empty sequence
richiware Mar 1, 2024
4aa3480
Refs #17138. Fix warning on windows
richiware Mar 1, 2024
aeeb5c8
Refs #17138. Fix warnings on windows
richiware Mar 1, 2024
64abaec
Refs #17138. Fix warnings on windows
richiware Mar 4, 2024
7ee35ae
Refs #17138. Fix warnings
richiware Mar 4, 2024
8173e9c
Refs #17138. Fixes in maps
richiware Mar 12, 2024
fb58ee1
Refs #17138. Apply suggestions 1
richiware Mar 13, 2024
4156690
Refs #17138. Apply suggestions 2
richiware Mar 13, 2024
10dde74
Refs #17138. Fix inheritance
richiware Mar 14, 2024
b064d4d
Refs #17138. Apply suggestions 3
richiware Mar 15, 2024
2613dbe
Refs #17138. Apply suggestions 4
richiware Mar 18, 2024
9c69c3a
Refs #17138. Forgotten suggestion
richiware Mar 19, 2024
bf187e0
Refs #17138. Applying suggestions 5
richiware Mar 21, 2024
17f34e8
Refs #17138. Move test to other branch
richiware Mar 21, 2024
c8b1745
Refs #17138. Applying suggestions 6
richiware Mar 22, 2024
d5af16a
Refs #17138. Apply suggestions 7
richiware Mar 22, 2024
8dc454d
Refs #17138. Apply suggestion 8
richiware Mar 22, 2024
c8f6dde
Refs #17138. Apply suggestions 9
richiware Mar 23, 2024
675f796
Refs #17138. Fix uncrustify
richiware Mar 23, 2024
4af3c43
Refs #20595: apply review suggestions
JLBuenoLopez Mar 25, 2024
3a1c2bc
Refs #20595: linters
JLBuenoLopez Mar 25, 2024
f7b29df
Refs #20595: apply review suggestion and fix Mac warnings
JLBuenoLopez Mar 25, 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
1 change: 0 additions & 1 deletion examples/cpp/dds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ add_subdirectory(SampleConfig_Controller)
add_subdirectory(SampleConfig_Events)
add_subdirectory(SampleConfig_Multimedia)
add_subdirectory(StaticHelloWorldExample)
add_subdirectory(TypeLookupService)
add_subdirectory(WriterLoansExample)
add_subdirectory(ZeroCopyExample)

Expand Down
90 changes: 35 additions & 55 deletions examples/cpp/dds/DynamicHelloWorldExample/HelloWorldPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/qos/DataWriterQos.hpp>
#include <fastdds/dds/publisher/qos/PublisherQos.hpp>
#include <fastrtps/types/DynamicDataFactory.h>
#include <fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>

using namespace eprosima::fastdds::dds;

Expand All @@ -47,33 +49,21 @@ bool HelloWorldPublisher::init()
return false;
}

eprosima::fastrtps::types::DynamicTypeBuilder* type;
DynamicType::_ref_type dyn_type;
if (RETCODE_OK !=
DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld", type))
DomainParticipantFactory::get_instance()->get_dynamic_type_builder_from_xml_by_name("HelloWorld",
dyn_type))
{
std::cout <<
"Error getting dynamic type \"HelloWorld\"." << std::endl;
return false;
}

eprosima::fastrtps::types::DynamicType_ptr dyn_type = type->build();
TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(dyn_type));
m_Hello = eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(dyn_type);

m_Hello->set_string_value("Hello DDS Dynamic World", 0);
m_Hello->set_uint32_value(0, 1);
eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2);
array->set_uint32_value(10, array->get_array_index({0, 0}));
array->set_uint32_value(20, array->get_array_index({1, 0}));
array->set_uint32_value(30, array->get_array_index({2, 0}));
array->set_uint32_value(40, array->get_array_index({3, 0}));
array->set_uint32_value(50, array->get_array_index({4, 0}));
array->set_uint32_value(60, array->get_array_index({0, 1}));
array->set_uint32_value(70, array->get_array_index({1, 1}));
array->set_uint32_value(80, array->get_array_index({2, 1}));
array->set_uint32_value(90, array->get_array_index({3, 1}));
array->set_uint32_value(100, array->get_array_index({4, 1}));
m_Hello->return_loaned_value(array);
TypeSupport m_type(new DynamicPubSubType(dyn_type));
m_Hello = DynamicDataFactory::get_instance()->create_data(dyn_type);
m_Hello->set_string_value(m_Hello->get_member_id_by_name("message"), "Hello DDS Dynamic World");
m_Hello->set_uint32_value(m_Hello->get_member_id_by_name("index"), 0);
m_Hello->set_uint32_values(m_Hello->get_member_id_by_name("array"), {10, 20, 30, 40, 50, 60, 70, 80, 90, 100});

DomainParticipantQos pqos;
pqos.name("Participant_pub");
Expand All @@ -98,7 +88,7 @@ bool HelloWorldPublisher::init()
return false;
}

topic_ = mp_participant->create_topic("DDSDynHelloWorldTopic", "HelloWorld", TOPIC_QOS_DEFAULT);
topic_ = mp_participant->create_topic("DDSDynHelloWorldTopic", m_type->getName(), TOPIC_QOS_DEFAULT);

if (topic_ == nullptr)
{
Expand Down Expand Up @@ -167,23 +157,23 @@ void HelloWorldPublisher::runThread(
if (publish(false))
{
std::string message;
m_Hello->get_string_value(message, 0);
uint32_t index;
m_Hello->get_uint32_value(index, 1);
m_Hello->get_string_value(message, m_Hello->get_member_id_by_name("message"));
uint32_t index {0};
m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index"));
UInt32Seq array;
m_Hello->get_uint32_values(array, m_Hello->get_member_id_by_name("array"));
std::string aux_array = "[";
eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2);

for (uint32_t i = 0; i < 5; ++i)
{
aux_array += "[";
for (uint32_t j = 0; j < 2; ++j)
{
uint32_t elem;
array->get_uint32_value(elem, array->get_array_index({i, j}));
aux_array += std::to_string(elem) + (j == 1 ? "]" : ", ");
aux_array += std::to_string(array.at((i * 5) + j)) + (j == 1 ? "]" : ", ");
}
aux_array += (i == 4 ? "]" : "], ");
}
m_Hello->return_loaned_value(array);
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved

std::cout << "Message: " << message << " with index: " << index
<< " array: " << aux_array << " SENT" << std::endl;
}
Expand All @@ -201,23 +191,23 @@ void HelloWorldPublisher::runThread(
else
{
std::string message;
m_Hello->get_string_value(message, 0);
uint32_t index;
m_Hello->get_uint32_value(index, 1);
m_Hello->get_string_value(message, m_Hello->get_member_id_by_name("message"));
uint32_t index {0};
m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index"));
UInt32Seq array;
m_Hello->get_uint32_values(array, m_Hello->get_member_id_by_name("array"));
std::string aux_array = "[";
eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2);

for (uint32_t i = 0; i < 5; ++i)
{
aux_array += "[";
for (uint32_t j = 0; j < 2; ++j)
{
uint32_t elem;
array->get_uint32_value(elem, array->get_array_index({i, j}));
aux_array += std::to_string(elem) + (j == 1 ? "]" : ", ");
aux_array += std::to_string(array.at((i * 5) + j)) + (j == 1 ? "]" : ", ");
}
aux_array += (i == 4 ? "]" : "], ");
}
m_Hello->return_loaned_value(array);

std::cout << "Message: " << message << " with index: " << index
<< " array: " << aux_array << " SENT" << std::endl;
}
Expand Down Expand Up @@ -251,23 +241,13 @@ bool HelloWorldPublisher::publish(
if (m_listener.firstConnected || !waitForListener || m_listener.n_matched > 0)
{
uint32_t index;
m_Hello->get_uint32_value(index, 1);
m_Hello->set_uint32_value(index + 1, 1);

eprosima::fastrtps::types::DynamicData* array = m_Hello->loan_value(2);
array->set_uint32_value(10 + index, array->get_array_index({0, 0}));
array->set_uint32_value(20 + index, array->get_array_index({1, 0}));
array->set_uint32_value(30 + index, array->get_array_index({2, 0}));
array->set_uint32_value(40 + index, array->get_array_index({3, 0}));
array->set_uint32_value(50 + index, array->get_array_index({4, 0}));
array->set_uint32_value(60 + index, array->get_array_index({0, 1}));
array->set_uint32_value(70 + index, array->get_array_index({1, 1}));
array->set_uint32_value(80 + index, array->get_array_index({2, 1}));
array->set_uint32_value(90 + index, array->get_array_index({3, 1}));
array->set_uint32_value(100 + index, array->get_array_index({4, 1}));
m_Hello->return_loaned_value(array);

writer_->write(m_Hello.get());
m_Hello->get_uint32_value(index, m_Hello->get_member_id_by_name("index"));
m_Hello->set_uint32_value(m_Hello->get_member_id_by_name("index"), index + 1);
m_Hello->set_uint32_values(m_Hello->get_member_id_by_name(
"array"),
{10 + index, 20 + index, 30 + index, 40 + index, 50 + index, 60 + index, 70 + index, 80 + index, 90 + index,
100 + index});
writer_->write(&m_Hello);
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef HELLOWORLDPUBLISHER_H_
#define HELLOWORLDPUBLISHER_H_

#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>

#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/domain/DomainParticipant.hpp>

Expand All @@ -45,7 +47,7 @@ class HelloWorldPublisher

private:

eprosima::fastrtps::types::DynamicData_ptr m_Hello;
eprosima::fastdds::dds::DynamicData::_ref_type m_Hello;

eprosima::fastdds::dds::DomainParticipant* mp_participant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastrtps/types/DynamicDataFactory.h>
#include <fastrtps/types/DynamicDataHelper.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicDataFactory.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>

using namespace eprosima::fastdds::dds;

Expand Down Expand Up @@ -114,16 +114,15 @@ void HelloWorldSubscriber::SubListener::on_data_available(

if (dit != subscriber_->datas_.end())
{
eprosima::fastrtps::types::DynamicData_ptr data = dit->second;
DynamicData::_ref_type data {dit->second};
SampleInfo info;
if (reader->take_next_sample(data.get(), &info) == RETCODE_OK)
if (reader->take_next_sample(&data, &info) == RETCODE_OK)
{
if (info.instance_state == ALIVE_INSTANCE_STATE)
{
eprosima::fastrtps::types::DynamicType_ptr type = subscriber_->readers_[reader];
const DynamicType::_ref_type type {subscriber_->readers_[reader]};
this->n_samples++;
std::cout << "Received data of type " << type->get_name() << std::endl;
eprosima::fastrtps::types::DynamicDataHelper::print(data);
}
}
}
Expand All @@ -133,7 +132,7 @@ void HelloWorldSubscriber::initialize_entities()
{
auto type = m_listener.received_type_;
JLBuenoLopez marked this conversation as resolved.
Show resolved Hide resolved
std::cout << "Initializing DDS entities for type: " << type->get_name() << std::endl;
TypeSupport m_type(new eprosima::fastrtps::types::DynamicPubSubType(type));
TypeSupport m_type(new DynamicPubSubType(type));
m_type.register_type(mp_participant);

if (mp_subscriber == nullptr)
Expand Down Expand Up @@ -167,8 +166,7 @@ void HelloWorldSubscriber::initialize_entities()

topics_[reader] = topic;
readers_[reader] = type;
eprosima::fastrtps::types::DynamicData_ptr data(
eprosima::fastrtps::types::DynamicDataFactory::get_instance()->create_data(type));
DynamicData::_ref_type data {DynamicDataFactory::get_instance()->create_data(type)};
datas_[reader] = data;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicData.hpp>
#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>

class HelloWorldSubscriber
{
Expand Down Expand Up @@ -59,9 +61,9 @@ class HelloWorldSubscriber

std::map<eprosima::fastdds::dds::DataReader*, eprosima::fastdds::dds::Topic*> topics_;

std::map<eprosima::fastdds::dds::DataReader*, eprosima::fastrtps::types::DynamicType_ptr> readers_;
std::map<eprosima::fastdds::dds::DataReader*, eprosima::fastdds::dds::DynamicType::_ref_type> readers_;

std::map<eprosima::fastdds::dds::DataReader*, eprosima::fastrtps::types::DynamicData_ptr> datas_;
std::map<eprosima::fastdds::dds::DataReader*, eprosima::fastdds::dds::DynamicData::_ref_type> datas_;

eprosima::fastdds::dds::DataReaderQos qos_;

Expand Down Expand Up @@ -99,7 +101,7 @@ class HelloWorldSubscriber

std::condition_variable types_cv_;

eprosima::fastrtps::types::DynamicType_ptr received_type_;
eprosima::fastdds::dds::DynamicType::_ref_type received_type_;

std::atomic<bool> reception_flag_{false};

Expand Down
15 changes: 6 additions & 9 deletions examples/cpp/dds/FlowControlExample/FlowControlExample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class FlowControlExample
eProsima_user_DllExport FlowControlExample(
const FlowControlExample& x)
{
m_message = x.m_message;
m_message = x.m_message;

m_wasFast = x.m_wasFast;
m_wasFast = x.m_wasFast;

}

Expand All @@ -104,9 +104,9 @@ class FlowControlExample
const FlowControlExample& x)
{

m_message = x.m_message;
m_message = x.m_message;

m_wasFast = x.m_wasFast;
m_wasFast = x.m_wasFast;

return *this;
}
Expand All @@ -132,7 +132,7 @@ class FlowControlExample
const FlowControlExample& x) const
{
return (m_message == x.m_message &&
m_wasFast == x.m_wasFast);
m_wasFast == x.m_wasFast);
}

/*!
Expand Down Expand Up @@ -183,7 +183,6 @@ class FlowControlExample
return m_message;
}


/*!
* @brief This function sets a value in member wasFast
* @param _wasFast New value for member wasFast
Expand Down Expand Up @@ -212,11 +211,9 @@ class FlowControlExample
return m_wasFast;
}



private:

std::array<char, 600000> m_message{0};
std::array<char, 600000> m_message;
char m_wasFast{0};

};
Expand Down
14 changes: 7 additions & 7 deletions examples/cpp/dds/Keys/samplePubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ samplePubSubType::samplePubSubType()
setName("sample");
uint32_t type_size =
#if FASTCDR_VERSION_MAJOR == 1
static_cast<uint32_t>(sample::getMaxCdrSerializedSize());
static_cast<uint32_t>(sample::getMaxCdrSerializedSize());
#else
sample_max_cdr_typesize;
#endif
sample_max_cdr_typesize;
#endif // if FASTCDR_VERSION_MAJOR == 1
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
m_typeSize = type_size + 4; /*encapsulation*/
m_isGetKeyDefined = true;
Expand Down Expand Up @@ -150,8 +150,8 @@ std::function<uint32_t()> samplePubSubType::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<sample*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<sample*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -189,7 +189,8 @@ bool samplePubSubType::getKey(
sample_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 @@ -224,6 +225,5 @@ void samplePubSubType::register_type_object_representation() const
register_sample_type_objects();
}


// Include auxiliary functions like for serializing/deserializing.
#include "sampleCdrAux.ipp"
Loading
Loading