From b7a813b18f378169040ff3776ee1fc6ee91f2b08 Mon Sep 17 00:00:00 2001 From: baocm Date: Sat, 10 Jan 2026 14:24:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=20ioctrl=E5=92=8Cprint=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BAmodule=20InternalSystem=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ioctrl/MsgHandler.cxx | 4 +- ioctrl/MsgHandler.hpp | 4 +- ioctrl/Publisher.cxx | 16 +- ioctrl/Subscriber.cxx | 18 +- ioctrl/main.cxx | 2 +- ioctrl/msg.hpp | 2 +- lib/System.hpp | 10 +- lib/System.idl | 83 +- lib/SystemCdrAux.hpp | 54 +- lib/SystemCdrAux.ipp | 126 +- lib/SystemPubSubTypes.cxx | 2295 ++++++++++++++++--------------- lib/SystemPubSubTypes.hpp | 949 ++++++------- lib/SystemTypeObjectSupport.cxx | 58 +- lib/SystemTypeObjectSupport.hpp | 16 +- print/Publisher.cxx | 14 +- print/Subscriber.cxx | 10 +- print/main.cxx | 2 +- print/msg.hpp | 2 +- 18 files changed, 1870 insertions(+), 1795 deletions(-) diff --git a/ioctrl/MsgHandler.cxx b/ioctrl/MsgHandler.cxx index 99b3e90..5f255cc 100644 --- a/ioctrl/MsgHandler.cxx +++ b/ioctrl/MsgHandler.cxx @@ -129,7 +129,7 @@ void MsgHandler::HandleDdsMsg(const std::map& msg) } } -int MsgHandler::ParseDeviceMsg(std::vector& data, IoCtrlRsp& rsp) +int MsgHandler::ParseDeviceMsg(std::vector& data, InternalSystem::IoCtrlRsp& rsp) { if (data[0] == this->device_id) { @@ -158,7 +158,7 @@ int MsgHandler::ParseDeviceMsg(std::vector& data, IoCtrlRsp& rsp) return 0; } -int MsgHandler::HandleDeviceMsg(IoCtrlRsp& rsp) +int MsgHandler::HandleDeviceMsg(InternalSystem::IoCtrlRsp& rsp) { std::vector m_RecvData; diff --git a/ioctrl/MsgHandler.hpp b/ioctrl/MsgHandler.hpp index 9448245..10add06 100644 --- a/ioctrl/MsgHandler.hpp +++ b/ioctrl/MsgHandler.hpp @@ -26,7 +26,7 @@ public: ~MsgHandler() = default; void HandleDdsMsg(const std::map& msg); - int HandleDeviceMsg(IoCtrlRsp& rsp); + int HandleDeviceMsg(InternalSystem::IoCtrlRsp& rsp); virtual bool OpenPort(const std::string& port, const std::string& baudrate); virtual int SendDeviceMsg(std::vector& data); @@ -39,7 +39,7 @@ public: void ClosePort(); private: - int ParseDeviceMsg(std::vector& data, IoCtrlRsp& rsp); + int ParseDeviceMsg(std::vector& data, InternalSystem::IoCtrlRsp& rsp); }; #endif \ No newline at end of file diff --git a/ioctrl/Publisher.cxx b/ioctrl/Publisher.cxx index d4df910..f62b332 100644 --- a/ioctrl/Publisher.cxx +++ b/ioctrl/Publisher.cxx @@ -47,7 +47,7 @@ PublisherApp::PublisherApp( , publisher_(nullptr) , topic_(nullptr) , writer_(nullptr) - , type_(new IoCtrlRspPubSubType()) + , type_(new InternalSystem::IoCtrlRspPubSubType()) , matched_(0) , samples_sent_(0) , stop_(false) @@ -63,7 +63,7 @@ PublisherApp::PublisherApp( participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none()); if (participant_ == nullptr) { - throw std::runtime_error("IoCtrlRsp Participant initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlRsp Participant initialization failed"); } // Register the type @@ -75,16 +75,16 @@ PublisherApp::PublisherApp( publisher_ = participant_->create_publisher(pub_qos, nullptr, StatusMask::none()); if (publisher_ == nullptr) { - throw std::runtime_error("IoCtrlRsp Publisher initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlRsp Publisher initialization failed"); } // Create the topic TopicQos topic_qos = TOPIC_QOS_DEFAULT; participant_->get_default_topic_qos(topic_qos); - topic_ = participant_->create_topic("IoCtrlRspTopic", type_.get_type_name(), topic_qos); + topic_ = participant_->create_topic("InternalSystem::IoCtrlRspTopic", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("IoCtrlRsp Topic initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlRsp Topic initialization failed"); } // Create the data writer @@ -96,7 +96,7 @@ PublisherApp::PublisherApp( writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all()); if (writer_ == nullptr) { - throw std::runtime_error("IoCtrlRsp DataWriter initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlRsp DataWriter initialization failed"); } } @@ -142,7 +142,7 @@ void PublisherApp::on_publication_matched( void PublisherApp::run(std::shared_ptr handler) { - IoCtrlRsp rsp; + InternalSystem::IoCtrlRsp rsp; while (!is_stopped()) { @@ -179,7 +179,7 @@ bool PublisherApp::publish() if (!is_stopped()) { /* Initialize your structure here */ - WeighRsp sample_; + InternalSystem::IoCtrlRsp sample_; ret = (RETCODE_OK == writer_->write(&sample_)); } return ret; diff --git a/ioctrl/Subscriber.cxx b/ioctrl/Subscriber.cxx index 31f37a4..aa8dc53 100644 --- a/ioctrl/Subscriber.cxx +++ b/ioctrl/Subscriber.cxx @@ -45,7 +45,7 @@ SubscriberApp::SubscriberApp( , subscriber_(nullptr) , topic_(nullptr) , reader_(nullptr) - , type_(new IoCtrlReqPubSubType()) + , type_(new InternalSystem::IoCtrlReqPubSubType()) , samples_received_(0) , stop_(false) { @@ -58,7 +58,7 @@ SubscriberApp::SubscriberApp( participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none()); if (participant_ == nullptr) { - throw std::runtime_error("IoCtrlReq Participant initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlReq Participant initialization failed"); } // Register the type @@ -70,16 +70,16 @@ SubscriberApp::SubscriberApp( subscriber_ = participant_->create_subscriber(sub_qos, nullptr, StatusMask::none()); if (subscriber_ == nullptr) { - throw std::runtime_error("IoCtrlReq Subscriber initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlReq Subscriber initialization failed"); } // Create the topic TopicQos topic_qos = TOPIC_QOS_DEFAULT; participant_->get_default_topic_qos(topic_qos); - topic_ = participant_->create_topic("IoCtrlReqTopic", type_.get_type_name(), topic_qos); + topic_ = participant_->create_topic("InternalSystem::IoCtrlReqTopic", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("IoCtrlReq Topic initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlReq Topic initialization failed"); } // Create the reader @@ -91,7 +91,7 @@ SubscriberApp::SubscriberApp( reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all()); if (reader_ == nullptr) { - throw std::runtime_error("IoCtrlReq DataReader initialization failed"); + throw std::runtime_error("InternalSystem::IoCtrlReq DataReader initialization failed"); } } @@ -133,9 +133,9 @@ void SubscriberApp::on_data_available( std::string topic_name = reader->get_topicdescription()->get_name(); std::cout << topic_name << std::endl; - if (topic_name == "IoCtrlReqTopic") + if (topic_name == "InternalSystem::IoCtrlReqTopic") { - IoCtrlReq sample_; + InternalSystem::IoCtrlReq sample_; while ((!is_stopped()) && (RETCODE_OK == reader->take_next_sample(&sample_, &info))) { if ((info.instance_state == ALIVE_INSTANCE_STATE) && info.valid_data) @@ -159,7 +159,7 @@ void SubscriberApp::run(std::shared_ptr handler) { if(!MsgData::IoCtrlReq_queue_.empty()) { - IoCtrlReq req = std::move(MsgData::IoCtrlReq_queue_.front()); + InternalSystem::IoCtrlReq req = std::move(MsgData::IoCtrlReq_queue_.front()); MsgData::IoCtrlReq_queue_.pop(); lock.unlock(); handler->HandleDdsMsg(req.msg()); diff --git a/ioctrl/main.cxx b/ioctrl/main.cxx index 0240f11..d272ecb 100644 --- a/ioctrl/main.cxx +++ b/ioctrl/main.cxx @@ -69,7 +69,7 @@ std::string parse_signal( } } -std::queue MsgData::IoCtrlReq_queue_; +std::queue MsgData::IoCtrlReq_queue_; std::mutex MsgData::queue_cv_mtx_; std::filesystem::path getExeDir() diff --git a/ioctrl/msg.hpp b/ioctrl/msg.hpp index 317d1b5..49f6bc0 100644 --- a/ioctrl/msg.hpp +++ b/ioctrl/msg.hpp @@ -7,7 +7,7 @@ class MsgData { public: - static std::queue IoCtrlReq_queue_; + static std::queue IoCtrlReq_queue_; static std::mutex queue_cv_mtx_; }; diff --git a/lib/System.hpp b/lib/System.hpp index 98b11ad..16216bc 100644 --- a/lib/System.hpp +++ b/lib/System.hpp @@ -19,8 +19,8 @@ * This file was generated by the tool fastddsgen. */ -#ifndef FAST_DDS_GENERATED__SYSTEM_HPP -#define FAST_DDS_GENERATED__SYSTEM_HPP +#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_HPP +#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_HPP #include #include @@ -52,6 +52,8 @@ #define SYSTEM_DllAPI #endif // _WIN32 +namespace InternalSystem { + /*! * @brief This class represents the structure LicencePlateReq defined by the user in the IDL file. * @ingroup System @@ -1440,6 +1442,8 @@ private: }; -#endif // _FAST_DDS_GENERATED_SYSTEM_HPP_ +} // namespace InternalSystem + +#endif // _FAST_DDS_GENERATED_INTERNALSYSTEM_SYSTEM_HPP_ diff --git a/lib/System.idl b/lib/System.idl index 4190f09..39600a7 100644 --- a/lib/System.idl +++ b/lib/System.idl @@ -1,50 +1,53 @@ @extensibility(APPENDABLE) -struct LicencePlateReq -{ - unsigned long index; - map msg; -}; -struct LicencePlateRsp +module InternalSystem { - unsigned long index; - string licence; -}; + struct LicencePlateReq + { + unsigned long index; + map msg; + }; -struct PrintReq -{ - unsigned long index; - map msg; -}; + struct LicencePlateRsp + { + unsigned long index; + string licence; + }; -struct PrintRsp -{ - unsigned long index; - string msg; -}; + struct PrintReq + { + unsigned long index; + map msg; + }; -struct WeighReq -{ - unsigned long index; - map msg; -}; + struct PrintRsp + { + unsigned long index; + string msg; + }; -struct WeighRsp -{ - unsigned long index; - float stable_weight; - float instantaneous_weight; -}; + struct WeighReq + { + unsigned long index; + map msg; + }; -// private -struct IoCtrlReq -{ - unsigned long index; - map msg; -}; + struct WeighRsp + { + unsigned long index; + float stable_weight; + float instantaneous_weight; + }; -struct IoCtrlRsp -{ - unsigned long index; - map msg; + struct IoCtrlReq + { + unsigned long index; + map msg; + }; + + struct IoCtrlRsp + { + unsigned long index; + map msg; + }; }; \ No newline at end of file diff --git a/lib/SystemCdrAux.hpp b/lib/SystemCdrAux.hpp index ab00fdb..d35e7ba 100644 --- a/lib/SystemCdrAux.hpp +++ b/lib/SystemCdrAux.hpp @@ -19,34 +19,34 @@ * This file was generated by the tool fastddsgen. */ -#ifndef FAST_DDS_GENERATED__SYSTEMCDRAUX_HPP -#define FAST_DDS_GENERATED__SYSTEMCDRAUX_HPP +#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_HPP +#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_HPP #include "System.hpp" -constexpr uint32_t PrintReq_max_cdr_typesize {16UL}; -constexpr uint32_t PrintReq_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_WeighRsp_max_cdr_typesize {16UL}; +constexpr uint32_t InternalSystem_WeighRsp_max_key_cdr_typesize {0UL}; -constexpr uint32_t LicencePlateRsp_max_cdr_typesize {268UL}; -constexpr uint32_t LicencePlateRsp_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_PrintRsp_max_cdr_typesize {268UL}; +constexpr uint32_t InternalSystem_PrintRsp_max_key_cdr_typesize {0UL}; -constexpr uint32_t LicencePlateReq_max_cdr_typesize {16UL}; -constexpr uint32_t LicencePlateReq_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_WeighReq_max_cdr_typesize {16UL}; +constexpr uint32_t InternalSystem_WeighReq_max_key_cdr_typesize {0UL}; -constexpr uint32_t WeighReq_max_cdr_typesize {16UL}; -constexpr uint32_t WeighReq_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_PrintReq_max_cdr_typesize {16UL}; +constexpr uint32_t InternalSystem_PrintReq_max_key_cdr_typesize {0UL}; -constexpr uint32_t PrintRsp_max_cdr_typesize {268UL}; -constexpr uint32_t PrintRsp_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_LicencePlateReq_max_cdr_typesize {16UL}; +constexpr uint32_t InternalSystem_LicencePlateReq_max_key_cdr_typesize {0UL}; -constexpr uint32_t WeighRsp_max_cdr_typesize {16UL}; -constexpr uint32_t WeighRsp_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_IoCtrlRsp_max_cdr_typesize {16UL}; +constexpr uint32_t InternalSystem_IoCtrlRsp_max_key_cdr_typesize {0UL}; -constexpr uint32_t IoCtrlRsp_max_cdr_typesize {16UL}; -constexpr uint32_t IoCtrlRsp_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_IoCtrlReq_max_cdr_typesize {16UL}; +constexpr uint32_t InternalSystem_IoCtrlReq_max_key_cdr_typesize {0UL}; -constexpr uint32_t IoCtrlReq_max_cdr_typesize {16UL}; -constexpr uint32_t IoCtrlReq_max_key_cdr_typesize {0UL}; +constexpr uint32_t InternalSystem_LicencePlateRsp_max_cdr_typesize {268UL}; +constexpr uint32_t InternalSystem_LicencePlateRsp_max_key_cdr_typesize {0UL}; namespace eprosima { @@ -57,39 +57,39 @@ class CdrSizeCalculator; eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const LicencePlateReq& data); + const InternalSystem::LicencePlateReq& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const LicencePlateRsp& data); + const InternalSystem::LicencePlateRsp& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const PrintReq& data); + const InternalSystem::PrintReq& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const PrintRsp& data); + const InternalSystem::PrintRsp& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const WeighReq& data); + const InternalSystem::WeighReq& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const WeighRsp& data); + const InternalSystem::WeighRsp& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const IoCtrlReq& data); + const InternalSystem::IoCtrlReq& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const IoCtrlRsp& data); + const InternalSystem::IoCtrlRsp& data); } // namespace fastcdr } // namespace eprosima -#endif // FAST_DDS_GENERATED__SYSTEMCDRAUX_HPP +#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_HPP diff --git a/lib/SystemCdrAux.ipp b/lib/SystemCdrAux.ipp index 0cf1503..5b88d77 100644 --- a/lib/SystemCdrAux.ipp +++ b/lib/SystemCdrAux.ipp @@ -19,8 +19,8 @@ * This file was generated by the tool fastddsgen. */ -#ifndef FAST_DDS_GENERATED__SYSTEMCDRAUX_IPP -#define FAST_DDS_GENERATED__SYSTEMCDRAUX_IPP +#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_IPP +#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_IPP #include "SystemCdrAux.hpp" @@ -37,9 +37,11 @@ namespace fastcdr { template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const LicencePlateReq& data, + const InternalSystem::LicencePlateReq& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -65,8 +67,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const LicencePlateReq& data) + const InternalSystem::LicencePlateReq& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -83,8 +87,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - LicencePlateReq& data) + InternalSystem::LicencePlateReq& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -111,8 +117,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const LicencePlateReq& data) + const InternalSystem::LicencePlateReq& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -126,9 +133,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const LicencePlateRsp& data, + const InternalSystem::LicencePlateRsp& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -154,8 +163,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const LicencePlateRsp& data) + const InternalSystem::LicencePlateRsp& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -172,8 +183,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - LicencePlateRsp& data) + InternalSystem::LicencePlateRsp& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -200,8 +213,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const LicencePlateRsp& data) + const InternalSystem::LicencePlateRsp& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -215,9 +229,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const PrintReq& data, + const InternalSystem::PrintReq& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -243,8 +259,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const PrintReq& data) + const InternalSystem::PrintReq& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -261,8 +279,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - PrintReq& data) + InternalSystem::PrintReq& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -289,8 +309,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const PrintReq& data) + const InternalSystem::PrintReq& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -304,9 +325,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const PrintRsp& data, + const InternalSystem::PrintRsp& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -332,8 +355,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const PrintRsp& data) + const InternalSystem::PrintRsp& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -350,8 +375,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - PrintRsp& data) + InternalSystem::PrintRsp& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -378,8 +405,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const PrintRsp& data) + const InternalSystem::PrintRsp& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -393,9 +421,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const WeighReq& data, + const InternalSystem::WeighReq& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -421,8 +451,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const WeighReq& data) + const InternalSystem::WeighReq& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -439,8 +471,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - WeighReq& data) + InternalSystem::WeighReq& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -467,8 +501,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const WeighReq& data) + const InternalSystem::WeighReq& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -482,9 +517,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const WeighRsp& data, + const InternalSystem::WeighRsp& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -513,8 +550,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const WeighRsp& data) + const InternalSystem::WeighRsp& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -532,8 +571,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - WeighRsp& data) + InternalSystem::WeighRsp& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -564,8 +605,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const WeighRsp& data) + const InternalSystem::WeighRsp& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -581,9 +623,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const IoCtrlReq& data, + const InternalSystem::IoCtrlReq& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -609,8 +653,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const IoCtrlReq& data) + const InternalSystem::IoCtrlReq& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -627,8 +673,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - IoCtrlReq& data) + InternalSystem::IoCtrlReq& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -655,8 +703,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const IoCtrlReq& data) + const InternalSystem::IoCtrlReq& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -670,9 +719,11 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const IoCtrlRsp& data, + const InternalSystem::IoCtrlRsp& data, size_t& current_alignment) { + using namespace InternalSystem; + static_cast(data); eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); @@ -698,8 +749,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const IoCtrlRsp& data) + const InternalSystem::IoCtrlRsp& data) { + using namespace InternalSystem; + eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? @@ -716,8 +769,10 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - IoCtrlRsp& data) + InternalSystem::IoCtrlRsp& data) { + using namespace InternalSystem; + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, @@ -744,8 +799,9 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const IoCtrlRsp& data) + const InternalSystem::IoCtrlRsp& data) { + using namespace InternalSystem; static_cast(scdr); static_cast(data); @@ -760,5 +816,5 @@ void serialize_key( } // namespace fastcdr } // namespace eprosima -#endif // FAST_DDS_GENERATED__SYSTEMCDRAUX_IPP +#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_IPP diff --git a/lib/SystemPubSubTypes.cxx b/lib/SystemPubSubTypes.cxx index 40111c6..e2e78e5 100644 --- a/lib/SystemPubSubTypes.cxx +++ b/lib/SystemPubSubTypes.cxx @@ -31,1461 +31,1464 @@ using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; -LicencePlateReqPubSubType::LicencePlateReqPubSubType() -{ - set_name("LicencePlateReq"); - uint32_t type_size = LicencePlateReq_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = LicencePlateReq_max_key_cdr_typesize > 16 ? LicencePlateReq_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} - -LicencePlateReqPubSubType::~LicencePlateReqPubSubType() -{ - if (key_buffer_ != nullptr) - { - free(key_buffer_); - } -} - -bool LicencePlateReqPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const LicencePlateReq* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try +namespace InternalSystem { + LicencePlateReqPubSubType::LicencePlateReqPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::LicencePlateReq"); + uint32_t type_size = InternalSystem_LicencePlateReq_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_LicencePlateReq_max_key_cdr_typesize > 16 ? InternalSystem_LicencePlateReq_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + LicencePlateReqPubSubType::~LicencePlateReqPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool LicencePlateReqPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool LicencePlateReqPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - LicencePlateReq* p_type = static_cast(data); + const LicencePlateReq* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool LicencePlateReqPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + LicencePlateReq* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t LicencePlateReqPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* LicencePlateReqPubSubType::create_data() -{ - return reinterpret_cast(new LicencePlateReq()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void LicencePlateReqPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool LicencePlateReqPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t LicencePlateReqPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - LicencePlateReq data; - if (deserialize(payload, static_cast(&data))) + void* LicencePlateReqPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new LicencePlateReq()); } - return false; -} - -bool LicencePlateReqPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void LicencePlateReqPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const LicencePlateReq* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - LicencePlateReq_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || LicencePlateReq_max_key_cdr_typesize > 16) + bool LicencePlateReqPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + LicencePlateReq data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool LicencePlateReqPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void LicencePlateReqPubSubType::register_type_object_representation() -{ - register_LicencePlateReq_type_identifier(type_identifiers_); -} + const LicencePlateReq* p_type = static_cast(data); -LicencePlateRspPubSubType::LicencePlateRspPubSubType() -{ - set_name("LicencePlateRsp"); - uint32_t type_size = LicencePlateRsp_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = LicencePlateRsp_max_key_cdr_typesize > 16 ? LicencePlateRsp_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_LicencePlateReq_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_LicencePlateReq_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -LicencePlateRspPubSubType::~LicencePlateRspPubSubType() -{ - if (key_buffer_ != nullptr) + void LicencePlateReqPubSubType::register_type_object_representation() { - free(key_buffer_); + register_LicencePlateReq_type_identifier(type_identifiers_); } -} - -bool LicencePlateRspPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const LicencePlateRsp* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + LicencePlateRspPubSubType::LicencePlateRspPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::LicencePlateRsp"); + uint32_t type_size = InternalSystem_LicencePlateRsp_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_LicencePlateRsp_max_key_cdr_typesize > 16 ? InternalSystem_LicencePlateRsp_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + LicencePlateRspPubSubType::~LicencePlateRspPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool LicencePlateRspPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool LicencePlateRspPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - LicencePlateRsp* p_type = static_cast(data); + const LicencePlateRsp* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool LicencePlateRspPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + LicencePlateRsp* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t LicencePlateRspPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* LicencePlateRspPubSubType::create_data() -{ - return reinterpret_cast(new LicencePlateRsp()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void LicencePlateRspPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool LicencePlateRspPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t LicencePlateRspPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - LicencePlateRsp data; - if (deserialize(payload, static_cast(&data))) + void* LicencePlateRspPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new LicencePlateRsp()); } - return false; -} - -bool LicencePlateRspPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void LicencePlateRspPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const LicencePlateRsp* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - LicencePlateRsp_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || LicencePlateRsp_max_key_cdr_typesize > 16) + bool LicencePlateRspPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + LicencePlateRsp data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool LicencePlateRspPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void LicencePlateRspPubSubType::register_type_object_representation() -{ - register_LicencePlateRsp_type_identifier(type_identifiers_); -} + const LicencePlateRsp* p_type = static_cast(data); -PrintReqPubSubType::PrintReqPubSubType() -{ - set_name("PrintReq"); - uint32_t type_size = PrintReq_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = PrintReq_max_key_cdr_typesize > 16 ? PrintReq_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_LicencePlateRsp_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_LicencePlateRsp_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -PrintReqPubSubType::~PrintReqPubSubType() -{ - if (key_buffer_ != nullptr) + void LicencePlateRspPubSubType::register_type_object_representation() { - free(key_buffer_); + register_LicencePlateRsp_type_identifier(type_identifiers_); } -} - -bool PrintReqPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const PrintReq* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + PrintReqPubSubType::PrintReqPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::PrintReq"); + uint32_t type_size = InternalSystem_PrintReq_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_PrintReq_max_key_cdr_typesize > 16 ? InternalSystem_PrintReq_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + PrintReqPubSubType::~PrintReqPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool PrintReqPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool PrintReqPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - PrintReq* p_type = static_cast(data); + const PrintReq* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool PrintReqPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + PrintReq* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t PrintReqPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* PrintReqPubSubType::create_data() -{ - return reinterpret_cast(new PrintReq()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void PrintReqPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool PrintReqPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t PrintReqPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - PrintReq data; - if (deserialize(payload, static_cast(&data))) + void* PrintReqPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new PrintReq()); } - return false; -} - -bool PrintReqPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void PrintReqPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const PrintReq* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - PrintReq_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || PrintReq_max_key_cdr_typesize > 16) + bool PrintReqPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + PrintReq data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool PrintReqPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void PrintReqPubSubType::register_type_object_representation() -{ - register_PrintReq_type_identifier(type_identifiers_); -} + const PrintReq* p_type = static_cast(data); -PrintRspPubSubType::PrintRspPubSubType() -{ - set_name("PrintRsp"); - uint32_t type_size = PrintRsp_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = PrintRsp_max_key_cdr_typesize > 16 ? PrintRsp_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_PrintReq_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_PrintReq_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -PrintRspPubSubType::~PrintRspPubSubType() -{ - if (key_buffer_ != nullptr) + void PrintReqPubSubType::register_type_object_representation() { - free(key_buffer_); + register_PrintReq_type_identifier(type_identifiers_); } -} - -bool PrintRspPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const PrintRsp* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + PrintRspPubSubType::PrintRspPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::PrintRsp"); + uint32_t type_size = InternalSystem_PrintRsp_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_PrintRsp_max_key_cdr_typesize > 16 ? InternalSystem_PrintRsp_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + PrintRspPubSubType::~PrintRspPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool PrintRspPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool PrintRspPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - PrintRsp* p_type = static_cast(data); + const PrintRsp* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool PrintRspPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + PrintRsp* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t PrintRspPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* PrintRspPubSubType::create_data() -{ - return reinterpret_cast(new PrintRsp()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void PrintRspPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool PrintRspPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t PrintRspPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - PrintRsp data; - if (deserialize(payload, static_cast(&data))) + void* PrintRspPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new PrintRsp()); } - return false; -} - -bool PrintRspPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void PrintRspPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const PrintRsp* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - PrintRsp_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || PrintRsp_max_key_cdr_typesize > 16) + bool PrintRspPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + PrintRsp data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool PrintRspPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void PrintRspPubSubType::register_type_object_representation() -{ - register_PrintRsp_type_identifier(type_identifiers_); -} + const PrintRsp* p_type = static_cast(data); -WeighReqPubSubType::WeighReqPubSubType() -{ - set_name("WeighReq"); - uint32_t type_size = WeighReq_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = WeighReq_max_key_cdr_typesize > 16 ? WeighReq_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_PrintRsp_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_PrintRsp_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -WeighReqPubSubType::~WeighReqPubSubType() -{ - if (key_buffer_ != nullptr) + void PrintRspPubSubType::register_type_object_representation() { - free(key_buffer_); + register_PrintRsp_type_identifier(type_identifiers_); } -} - -bool WeighReqPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const WeighReq* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + WeighReqPubSubType::WeighReqPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::WeighReq"); + uint32_t type_size = InternalSystem_WeighReq_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_WeighReq_max_key_cdr_typesize > 16 ? InternalSystem_WeighReq_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + WeighReqPubSubType::~WeighReqPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool WeighReqPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool WeighReqPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - WeighReq* p_type = static_cast(data); + const WeighReq* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool WeighReqPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + WeighReq* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t WeighReqPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* WeighReqPubSubType::create_data() -{ - return reinterpret_cast(new WeighReq()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void WeighReqPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool WeighReqPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t WeighReqPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - WeighReq data; - if (deserialize(payload, static_cast(&data))) + void* WeighReqPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new WeighReq()); } - return false; -} - -bool WeighReqPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void WeighReqPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const WeighReq* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - WeighReq_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || WeighReq_max_key_cdr_typesize > 16) + bool WeighReqPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + WeighReq data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool WeighReqPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void WeighReqPubSubType::register_type_object_representation() -{ - register_WeighReq_type_identifier(type_identifiers_); -} + const WeighReq* p_type = static_cast(data); -WeighRspPubSubType::WeighRspPubSubType() -{ - set_name("WeighRsp"); - uint32_t type_size = WeighRsp_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = WeighRsp_max_key_cdr_typesize > 16 ? WeighRsp_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_WeighReq_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_WeighReq_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -WeighRspPubSubType::~WeighRspPubSubType() -{ - if (key_buffer_ != nullptr) + void WeighReqPubSubType::register_type_object_representation() { - free(key_buffer_); + register_WeighReq_type_identifier(type_identifiers_); } -} - -bool WeighRspPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const WeighRsp* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + WeighRspPubSubType::WeighRspPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::WeighRsp"); + uint32_t type_size = InternalSystem_WeighRsp_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_WeighRsp_max_key_cdr_typesize > 16 ? InternalSystem_WeighRsp_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + WeighRspPubSubType::~WeighRspPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool WeighRspPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool WeighRspPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - WeighRsp* p_type = static_cast(data); + const WeighRsp* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool WeighRspPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + WeighRsp* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t WeighRspPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* WeighRspPubSubType::create_data() -{ - return reinterpret_cast(new WeighRsp()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void WeighRspPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool WeighRspPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t WeighRspPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - WeighRsp data; - if (deserialize(payload, static_cast(&data))) + void* WeighRspPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new WeighRsp()); } - return false; -} - -bool WeighRspPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void WeighRspPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const WeighRsp* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - WeighRsp_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || WeighRsp_max_key_cdr_typesize > 16) + bool WeighRspPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + WeighRsp data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool WeighRspPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void WeighRspPubSubType::register_type_object_representation() -{ - register_WeighRsp_type_identifier(type_identifiers_); -} + const WeighRsp* p_type = static_cast(data); -IoCtrlReqPubSubType::IoCtrlReqPubSubType() -{ - set_name("IoCtrlReq"); - uint32_t type_size = IoCtrlReq_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = IoCtrlReq_max_key_cdr_typesize > 16 ? IoCtrlReq_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_WeighRsp_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_WeighRsp_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -IoCtrlReqPubSubType::~IoCtrlReqPubSubType() -{ - if (key_buffer_ != nullptr) + void WeighRspPubSubType::register_type_object_representation() { - free(key_buffer_); + register_WeighRsp_type_identifier(type_identifiers_); } -} - -bool IoCtrlReqPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const IoCtrlReq* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + IoCtrlReqPubSubType::IoCtrlReqPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::IoCtrlReq"); + uint32_t type_size = InternalSystem_IoCtrlReq_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_IoCtrlReq_max_key_cdr_typesize > 16 ? InternalSystem_IoCtrlReq_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + IoCtrlReqPubSubType::~IoCtrlReqPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool IoCtrlReqPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool IoCtrlReqPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - IoCtrlReq* p_type = static_cast(data); + const IoCtrlReq* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool IoCtrlReqPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + IoCtrlReq* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t IoCtrlReqPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* IoCtrlReqPubSubType::create_data() -{ - return reinterpret_cast(new IoCtrlReq()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void IoCtrlReqPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool IoCtrlReqPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t IoCtrlReqPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - IoCtrlReq data; - if (deserialize(payload, static_cast(&data))) + void* IoCtrlReqPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new IoCtrlReq()); } - return false; -} - -bool IoCtrlReqPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + void IoCtrlReqPubSubType::delete_data( + void* data) { - return false; + delete(reinterpret_cast(data)); } - const IoCtrlReq* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - IoCtrlReq_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || IoCtrlReq_max_key_cdr_typesize > 16) + bool IoCtrlReqPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = md5_.digest[i]; + return false; } + + IoCtrlReq data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; } - else + + bool IoCtrlReqPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) { - for (uint8_t i = 0; i < 16; ++i) + if (!is_compute_key_provided) { - handle.value[i] = key_buffer_[i]; + return false; } - } - return true; -} -void IoCtrlReqPubSubType::register_type_object_representation() -{ - register_IoCtrlReq_type_identifier(type_identifiers_); -} + const IoCtrlReq* p_type = static_cast(data); -IoCtrlRspPubSubType::IoCtrlRspPubSubType() -{ - set_name("IoCtrlRsp"); - uint32_t type_size = IoCtrlRsp_max_cdr_typesize; - type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ - max_serialized_type_size = type_size + 4; /*encapsulation*/ - is_compute_key_provided = false; - uint32_t key_length = IoCtrlRsp_max_key_cdr_typesize > 16 ? IoCtrlRsp_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_IoCtrlReq_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_IoCtrlReq_max_key_cdr_typesize > 16) + { + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } + } + else + { + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } + } + return true; + } -IoCtrlRspPubSubType::~IoCtrlRspPubSubType() -{ - if (key_buffer_ != nullptr) + void IoCtrlReqPubSubType::register_type_object_representation() { - free(key_buffer_); + register_IoCtrlReq_type_identifier(type_identifiers_); } -} - -bool IoCtrlRspPubSubType::serialize( - const void* const data, - SerializedPayload_t& payload, - DataRepresentationId_t data_representation) -{ - const IoCtrlRsp* p_type = static_cast(data); - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); - payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - ser.set_encoding_flag( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : - eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - - try + IoCtrlRspPubSubType::IoCtrlRspPubSubType() { - // Serialize encapsulation - ser.serialize_encapsulation(); - // Serialize the object. - ser << *p_type; - ser.set_dds_cdr_options({0,0}); + set_name("InternalSystem::IoCtrlRsp"); + uint32_t type_size = InternalSystem_IoCtrlRsp_max_cdr_typesize; + type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ + max_serialized_type_size = type_size + 4; /*encapsulation*/ + is_compute_key_provided = false; + uint32_t key_length = InternalSystem_IoCtrlRsp_max_key_cdr_typesize > 16 ? InternalSystem_IoCtrlRsp_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + IoCtrlRspPubSubType::~IoCtrlRspPubSubType() { - return false; + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } } - // Get the serialized length - payload.length = static_cast(ser.get_serialized_data_length()); - return true; -} - -bool IoCtrlRspPubSubType::deserialize( - SerializedPayload_t& payload, - void* data) -{ - try + bool IoCtrlRspPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) { - // Convert DATA to pointer of your type - IoCtrlRsp* p_type = static_cast(data); + const IoCtrlRsp* p_type = static_cast(data); // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); - - // Object that deserializes the data. - eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2); + payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + ser.set_encoding_flag( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR : + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2); - // Deserialize encapsulation. - deser.read_encapsulation(); - payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + try + { + // Serialize encapsulation + ser.serialize_encapsulation(); + // Serialize the object. + ser << *p_type; + ser.set_dds_cdr_options({0,0}); + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } - // Deserialize the object. - deser >> *p_type; + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) + + bool IoCtrlRspPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) { - return false; - } + try + { + // Convert DATA to pointer of your type + IoCtrlRsp* p_type = static_cast(data); - return true; -} + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); -uint32_t IoCtrlRspPubSubType::calculate_serialized_size( - const void* const data, - DataRepresentationId_t data_representation) -{ - try - { - eprosima::fastcdr::CdrSizeCalculator calculator( - data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? - eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); - size_t current_alignment {0}; - return static_cast(calculator.calculate_serialized_size( - *static_cast(data), current_alignment)) + - 4u /*encapsulation*/; - } - catch (eprosima::fastcdr::exception::Exception& /*exception*/) - { - return 0; - } -} + // Object that deserializes the data. + eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN); -void* IoCtrlRspPubSubType::create_data() -{ - return reinterpret_cast(new IoCtrlRsp()); -} + // Deserialize encapsulation. + deser.read_encapsulation(); + payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; + + // Deserialize the object. + deser >> *p_type; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return false; + } -void IoCtrlRspPubSubType::delete_data( - void* data) -{ - delete(reinterpret_cast(data)); -} + return true; + } -bool IoCtrlRspPubSubType::compute_key( - SerializedPayload_t& payload, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + uint32_t IoCtrlRspPubSubType::calculate_serialized_size( + const void* const data, + DataRepresentationId_t data_representation) { - return false; + try + { + eprosima::fastcdr::CdrSizeCalculator calculator( + data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ? + eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2); + size_t current_alignment {0}; + return static_cast(calculator.calculate_serialized_size( + *static_cast(data), current_alignment)) + + 4u /*encapsulation*/; + } + catch (eprosima::fastcdr::exception::Exception& /*exception*/) + { + return 0; + } } - IoCtrlRsp data; - if (deserialize(payload, static_cast(&data))) + void* IoCtrlRspPubSubType::create_data() { - return compute_key(static_cast(&data), handle, force_md5); + return reinterpret_cast(new IoCtrlRsp()); } - return false; -} + void IoCtrlRspPubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } -bool IoCtrlRspPubSubType::compute_key( - const void* const data, - InstanceHandle_t& handle, - bool force_md5) -{ - if (!is_compute_key_provided) + bool IoCtrlRspPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) { + if (!is_compute_key_provided) + { + return false; + } + + IoCtrlRsp data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + return false; } - const IoCtrlRsp* p_type = static_cast(data); + bool IoCtrlRspPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - IoCtrlRsp_max_key_cdr_typesize); + const IoCtrlRsp* p_type = static_cast(data); - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || IoCtrlRsp_max_key_cdr_typesize > 16) - { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + InternalSystem_IoCtrlRsp_max_key_cdr_typesize); + + // Object that serializes the data. + eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); + ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); + eprosima::fastcdr::serialize_key(ser, *p_type); + if (force_md5 || InternalSystem_IoCtrlRsp_max_key_cdr_typesize > 16) { - handle.value[i] = md5_.digest[i]; + md5_.init(); + md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); + md5_.finalize(); + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = md5_.digest[i]; + } } - } - else - { - for (uint8_t i = 0; i < 16; ++i) + else { - handle.value[i] = key_buffer_[i]; + for (uint8_t i = 0; i < 16; ++i) + { + handle.value[i] = key_buffer_[i]; + } } + return true; + } + + void IoCtrlRspPubSubType::register_type_object_representation() + { + register_IoCtrlRsp_type_identifier(type_identifiers_); } - return true; -} -void IoCtrlRspPubSubType::register_type_object_representation() -{ - register_IoCtrlRsp_type_identifier(type_identifiers_); -} +} // namespace InternalSystem // Include auxiliary functions like for serializing/deserializing. diff --git a/lib/SystemPubSubTypes.hpp b/lib/SystemPubSubTypes.hpp index 562cd68..c35a6c8 100644 --- a/lib/SystemPubSubTypes.hpp +++ b/lib/SystemPubSubTypes.hpp @@ -20,8 +20,8 @@ */ -#ifndef FAST_DDS_GENERATED__SYSTEM_PUBSUBTYPES_HPP -#define FAST_DDS_GENERATED__SYSTEM_PUBSUBTYPES_HPP +#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_PUBSUBTYPES_HPP +#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_PUBSUBTYPES_HPP #include #include @@ -37,654 +37,657 @@ Generated System is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // FASTDDS_GEN_API_VER - -/*! - * @brief This class represents the TopicDataType of the type LicencePlateReq defined by the user in the IDL file. - * @ingroup System - */ -class LicencePlateReqPubSubType : public eprosima::fastdds::dds::TopicDataType +namespace InternalSystem { -public: - typedef LicencePlateReq type; + /*! + * @brief This class represents the TopicDataType of the type LicencePlateReq defined by the user in the IDL file. + * @ingroup System + */ + class LicencePlateReqPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: - eProsima_user_DllExport LicencePlateReqPubSubType(); + typedef LicencePlateReq type; - eProsima_user_DllExport ~LicencePlateReqPubSubType() override; + eProsima_user_DllExport LicencePlateReqPubSubType(); - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport ~LicencePlateReqPubSubType() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport void* create_data() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport void* create_data() override; - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + eProsima_user_DllExport void delete_data( + void* data) override; -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + private: + + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; + + }; + + /*! + * @brief This class represents the TopicDataType of the type LicencePlateRsp defined by the user in the IDL file. + * @ingroup System + */ + class LicencePlateRspPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef LicencePlateRsp type; -private: + eProsima_user_DllExport LicencePlateRspPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~LicencePlateRspPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type LicencePlateRsp defined by the user in the IDL file. - * @ingroup System - */ -class LicencePlateRspPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - typedef LicencePlateRsp type; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport LicencePlateRspPubSubType(); + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport ~LicencePlateRspPubSubType() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void* create_data() override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + private: - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + }; -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + /*! + * @brief This class represents the TopicDataType of the type PrintReq defined by the user in the IDL file. + * @ingroup System + */ + class PrintReqPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef PrintReq type; -private: + eProsima_user_DllExport PrintReqPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~PrintReqPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type PrintReq defined by the user in the IDL file. - * @ingroup System - */ -class PrintReqPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - typedef PrintReq type; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport PrintReqPubSubType(); + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport ~PrintReqPubSubType() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void* create_data() override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + private: - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + }; -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + /*! + * @brief This class represents the TopicDataType of the type PrintRsp defined by the user in the IDL file. + * @ingroup System + */ + class PrintRspPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef PrintRsp type; -private: + eProsima_user_DllExport PrintRspPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~PrintRspPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type PrintRsp defined by the user in the IDL file. - * @ingroup System - */ -class PrintRspPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - typedef PrintRsp type; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport PrintRspPubSubType(); + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport ~PrintRspPubSubType() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void* create_data() override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + private: - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + }; -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + /*! + * @brief This class represents the TopicDataType of the type WeighReq defined by the user in the IDL file. + * @ingroup System + */ + class WeighReqPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef WeighReq type; -private: + eProsima_user_DllExport WeighReqPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~WeighReqPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type WeighReq defined by the user in the IDL file. - * @ingroup System - */ -class WeighReqPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - typedef WeighReq type; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport WeighReqPubSubType(); + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport ~WeighReqPubSubType() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void* create_data() override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + private: - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + }; -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + /*! + * @brief This class represents the TopicDataType of the type WeighRsp defined by the user in the IDL file. + * @ingroup System + */ + class WeighRspPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef WeighRsp type; -private: + eProsima_user_DllExport WeighRspPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~WeighRspPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type WeighRsp defined by the user in the IDL file. - * @ingroup System - */ -class WeighRspPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - typedef WeighRsp type; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport WeighRspPubSubType(); + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport ~WeighRspPubSubType() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void* create_data() override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return true; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + private: - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + }; -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + /*! + * @brief This class represents the TopicDataType of the type IoCtrlReq defined by the user in the IDL file. + * @ingroup System + */ + class IoCtrlReqPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef IoCtrlReq type; -private: + eProsima_user_DllExport IoCtrlReqPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~IoCtrlReqPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type IoCtrlReq defined by the user in the IDL file. - * @ingroup System - */ -class IoCtrlReqPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - typedef IoCtrlReq type; + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport IoCtrlReqPubSubType(); + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport ~IoCtrlReqPubSubType() override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void* create_data() override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - eProsima_user_DllExport void delete_data( - void* data) override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + private: - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN + }; -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override + /*! + * @brief This class represents the TopicDataType of the type IoCtrlRsp defined by the user in the IDL file. + * @ingroup System + */ + class IoCtrlRspPubSubType : public eprosima::fastdds::dds::TopicDataType { - static_cast(memory); - return false; - } + public: -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + typedef IoCtrlRsp type; -private: + eProsima_user_DllExport IoCtrlRspPubSubType(); - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eProsima_user_DllExport ~IoCtrlRspPubSubType() override; -}; + eProsima_user_DllExport bool serialize( + const void* const data, + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; -/*! - * @brief This class represents the TopicDataType of the type IoCtrlRsp defined by the user in the IDL file. - * @ingroup System - */ -class IoCtrlRspPubSubType : public eprosima::fastdds::dds::TopicDataType -{ -public: - - typedef IoCtrlRsp type; + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* data) override; - eProsima_user_DllExport IoCtrlRspPubSubType(); + eProsima_user_DllExport uint32_t calculate_serialized_size( + const void* const data, + eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; - eProsima_user_DllExport ~IoCtrlRspPubSubType() override; + eProsima_user_DllExport bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool serialize( - const void* const data, - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport bool compute_key( + const void* const data, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) override; - eProsima_user_DllExport bool deserialize( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - void* data) override; + eProsima_user_DllExport void* create_data() override; - eProsima_user_DllExport uint32_t calculate_serialized_size( - const void* const data, - eprosima::fastdds::dds::DataRepresentationId_t data_representation) override; + eProsima_user_DllExport void delete_data( + void* data) override; - eProsima_user_DllExport bool compute_key( - eprosima::fastdds::rtps::SerializedPayload_t& payload, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; - eProsima_user_DllExport bool compute_key( - const void* const data, - eprosima::fastdds::rtps::InstanceHandle_t& ihandle, - bool force_md5 = false) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return false; + } - eProsima_user_DllExport void* create_data() override; + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport void delete_data( - void* data) override; + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - //Register TypeObject representation in Fast DDS TypeObjectRegistry - eProsima_user_DllExport void register_type_object_representation() override; + eProsima_user_DllExport inline bool is_plain( + eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override + { + static_cast(data_representation); + return false; + } -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - eProsima_user_DllExport inline bool is_bounded() const override - { - return false; - } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN -#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED - -#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - - eProsima_user_DllExport inline bool is_plain( - eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override - { - static_cast(data_representation); - return false; - } - -#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN - -#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE - eProsima_user_DllExport inline bool construct_sample( - void* memory) const override - { - static_cast(memory); - return false; - } + #ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + eProsima_user_DllExport inline bool construct_sample( + void* memory) const override + { + static_cast(memory); + return false; + } -#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE -private: + private: - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; -}; + }; +} // namespace InternalSystem -#endif // FAST_DDS_GENERATED__SYSTEM_PUBSUBTYPES_HPP +#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_PUBSUBTYPES_HPP diff --git a/lib/SystemTypeObjectSupport.cxx b/lib/SystemTypeObjectSupport.cxx index f7669f7..4575eae 100644 --- a/lib/SystemTypeObjectSupport.cxx +++ b/lib/SystemTypeObjectSupport.cxx @@ -38,6 +38,7 @@ using namespace eprosima::fastdds::dds::xtypes; +namespace InternalSystem { // TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method void register_LicencePlateReq_type_identifier( TypeIdentifierPair& type_ids_LicencePlateReq) @@ -46,21 +47,14 @@ void register_LicencePlateReq_type_identifier( ReturnCode_t return_code_LicencePlateReq {eprosima::fastdds::dds::RETCODE_OK}; return_code_LicencePlateReq = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LicencePlateReq", type_ids_LicencePlateReq); + "InternalSystem::LicencePlateReq", type_ids_LicencePlateReq); if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicencePlateReq) { StructTypeFlag struct_flags_LicencePlateReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_LicencePlateReq = "LicencePlateReq"; + QualifiedTypeName type_name_LicencePlateReq = "InternalSystem::LicencePlateReq"; eprosima::fastcdr::optional type_ann_builtin_LicencePlateReq; eprosima::fastcdr::optional ann_custom_LicencePlateReq; - AppliedAnnotationSeq tmp_ann_custom_LicencePlateReq; - eprosima::fastcdr::optional verbatim_LicencePlateReq; - if (!tmp_ann_custom_LicencePlateReq.empty()) - { - ann_custom_LicencePlateReq = tmp_ann_custom_LicencePlateReq; - } - CompleteTypeDetail detail_LicencePlateReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LicencePlateReq, ann_custom_LicencePlateReq, type_name_LicencePlateReq.to_string()); CompleteStructHeader header_LicencePlateReq; header_LicencePlateReq = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LicencePlateReq); @@ -205,7 +199,7 @@ void register_LicencePlateReq_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicencePlateReq, type_name_LicencePlateReq.to_string(), type_ids_LicencePlateReq)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LicencePlateReq already registered in TypeObjectRegistry for a different type."); + "InternalSystem::LicencePlateReq already registered in TypeObjectRegistry for a different type."); } } } @@ -217,12 +211,12 @@ void register_LicencePlateRsp_type_identifier( ReturnCode_t return_code_LicencePlateRsp {eprosima::fastdds::dds::RETCODE_OK}; return_code_LicencePlateRsp = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "LicencePlateRsp", type_ids_LicencePlateRsp); + "InternalSystem::LicencePlateRsp", type_ids_LicencePlateRsp); if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicencePlateRsp) { StructTypeFlag struct_flags_LicencePlateRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_LicencePlateRsp = "LicencePlateRsp"; + QualifiedTypeName type_name_LicencePlateRsp = "InternalSystem::LicencePlateRsp"; eprosima::fastcdr::optional type_ann_builtin_LicencePlateRsp; eprosima::fastcdr::optional ann_custom_LicencePlateRsp; CompleteTypeDetail detail_LicencePlateRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LicencePlateRsp, ann_custom_LicencePlateRsp, type_name_LicencePlateRsp.to_string()); @@ -302,7 +296,7 @@ void register_LicencePlateRsp_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicencePlateRsp, type_name_LicencePlateRsp.to_string(), type_ids_LicencePlateRsp)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "LicencePlateRsp already registered in TypeObjectRegistry for a different type."); + "InternalSystem::LicencePlateRsp already registered in TypeObjectRegistry for a different type."); } } } @@ -314,12 +308,12 @@ void register_PrintReq_type_identifier( ReturnCode_t return_code_PrintReq {eprosima::fastdds::dds::RETCODE_OK}; return_code_PrintReq = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "PrintReq", type_ids_PrintReq); + "InternalSystem::PrintReq", type_ids_PrintReq); if (eprosima::fastdds::dds::RETCODE_OK != return_code_PrintReq) { StructTypeFlag struct_flags_PrintReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_PrintReq = "PrintReq"; + QualifiedTypeName type_name_PrintReq = "InternalSystem::PrintReq"; eprosima::fastcdr::optional type_ann_builtin_PrintReq; eprosima::fastcdr::optional ann_custom_PrintReq; CompleteTypeDetail detail_PrintReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PrintReq, ann_custom_PrintReq, type_name_PrintReq.to_string()); @@ -466,7 +460,7 @@ void register_PrintReq_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_PrintReq, type_name_PrintReq.to_string(), type_ids_PrintReq)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "PrintReq already registered in TypeObjectRegistry for a different type."); + "InternalSystem::PrintReq already registered in TypeObjectRegistry for a different type."); } } } @@ -478,12 +472,12 @@ void register_PrintRsp_type_identifier( ReturnCode_t return_code_PrintRsp {eprosima::fastdds::dds::RETCODE_OK}; return_code_PrintRsp = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "PrintRsp", type_ids_PrintRsp); + "InternalSystem::PrintRsp", type_ids_PrintRsp); if (eprosima::fastdds::dds::RETCODE_OK != return_code_PrintRsp) { StructTypeFlag struct_flags_PrintRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_PrintRsp = "PrintRsp"; + QualifiedTypeName type_name_PrintRsp = "InternalSystem::PrintRsp"; eprosima::fastcdr::optional type_ann_builtin_PrintRsp; eprosima::fastcdr::optional ann_custom_PrintRsp; CompleteTypeDetail detail_PrintRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PrintRsp, ann_custom_PrintRsp, type_name_PrintRsp.to_string()); @@ -563,7 +557,7 @@ void register_PrintRsp_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_PrintRsp, type_name_PrintRsp.to_string(), type_ids_PrintRsp)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "PrintRsp already registered in TypeObjectRegistry for a different type."); + "InternalSystem::PrintRsp already registered in TypeObjectRegistry for a different type."); } } } @@ -575,12 +569,12 @@ void register_WeighReq_type_identifier( ReturnCode_t return_code_WeighReq {eprosima::fastdds::dds::RETCODE_OK}; return_code_WeighReq = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WeighReq", type_ids_WeighReq); + "InternalSystem::WeighReq", type_ids_WeighReq); if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeighReq) { StructTypeFlag struct_flags_WeighReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_WeighReq = "WeighReq"; + QualifiedTypeName type_name_WeighReq = "InternalSystem::WeighReq"; eprosima::fastcdr::optional type_ann_builtin_WeighReq; eprosima::fastcdr::optional ann_custom_WeighReq; CompleteTypeDetail detail_WeighReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeighReq, ann_custom_WeighReq, type_name_WeighReq.to_string()); @@ -727,7 +721,7 @@ void register_WeighReq_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeighReq, type_name_WeighReq.to_string(), type_ids_WeighReq)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WeighReq already registered in TypeObjectRegistry for a different type."); + "InternalSystem::WeighReq already registered in TypeObjectRegistry for a different type."); } } } @@ -739,12 +733,12 @@ void register_WeighRsp_type_identifier( ReturnCode_t return_code_WeighRsp {eprosima::fastdds::dds::RETCODE_OK}; return_code_WeighRsp = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "WeighRsp", type_ids_WeighRsp); + "InternalSystem::WeighRsp", type_ids_WeighRsp); if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeighRsp) { StructTypeFlag struct_flags_WeighRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_WeighRsp = "WeighRsp"; + QualifiedTypeName type_name_WeighRsp = "InternalSystem::WeighRsp"; eprosima::fastcdr::optional type_ann_builtin_WeighRsp; eprosima::fastcdr::optional ann_custom_WeighRsp; CompleteTypeDetail detail_WeighRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeighRsp, ann_custom_WeighRsp, type_name_WeighRsp.to_string()); @@ -846,7 +840,7 @@ void register_WeighRsp_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeighRsp, type_name_WeighRsp.to_string(), type_ids_WeighRsp)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "WeighRsp already registered in TypeObjectRegistry for a different type."); + "InternalSystem::WeighRsp already registered in TypeObjectRegistry for a different type."); } } } @@ -858,12 +852,12 @@ void register_IoCtrlReq_type_identifier( ReturnCode_t return_code_IoCtrlReq {eprosima::fastdds::dds::RETCODE_OK}; return_code_IoCtrlReq = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "IoCtrlReq", type_ids_IoCtrlReq); + "InternalSystem::IoCtrlReq", type_ids_IoCtrlReq); if (eprosima::fastdds::dds::RETCODE_OK != return_code_IoCtrlReq) { StructTypeFlag struct_flags_IoCtrlReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_IoCtrlReq = "IoCtrlReq"; + QualifiedTypeName type_name_IoCtrlReq = "InternalSystem::IoCtrlReq"; eprosima::fastcdr::optional type_ann_builtin_IoCtrlReq; eprosima::fastcdr::optional ann_custom_IoCtrlReq; CompleteTypeDetail detail_IoCtrlReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IoCtrlReq, ann_custom_IoCtrlReq, type_name_IoCtrlReq.to_string()); @@ -1010,7 +1004,7 @@ void register_IoCtrlReq_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_IoCtrlReq, type_name_IoCtrlReq.to_string(), type_ids_IoCtrlReq)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "IoCtrlReq already registered in TypeObjectRegistry for a different type."); + "InternalSystem::IoCtrlReq already registered in TypeObjectRegistry for a different type."); } } } @@ -1022,12 +1016,12 @@ void register_IoCtrlRsp_type_identifier( ReturnCode_t return_code_IoCtrlRsp {eprosima::fastdds::dds::RETCODE_OK}; return_code_IoCtrlRsp = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "IoCtrlRsp", type_ids_IoCtrlRsp); + "InternalSystem::IoCtrlRsp", type_ids_IoCtrlRsp); if (eprosima::fastdds::dds::RETCODE_OK != return_code_IoCtrlRsp) { StructTypeFlag struct_flags_IoCtrlRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_IoCtrlRsp = "IoCtrlRsp"; + QualifiedTypeName type_name_IoCtrlRsp = "InternalSystem::IoCtrlRsp"; eprosima::fastcdr::optional type_ann_builtin_IoCtrlRsp; eprosima::fastcdr::optional ann_custom_IoCtrlRsp; CompleteTypeDetail detail_IoCtrlRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IoCtrlRsp, ann_custom_IoCtrlRsp, type_name_IoCtrlRsp.to_string()); @@ -1174,8 +1168,10 @@ void register_IoCtrlRsp_type_identifier( TypeObjectUtils::build_and_register_struct_type_object(struct_type_IoCtrlRsp, type_name_IoCtrlRsp.to_string(), type_ids_IoCtrlRsp)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "IoCtrlRsp already registered in TypeObjectRegistry for a different type."); + "InternalSystem::IoCtrlRsp already registered in TypeObjectRegistry for a different type."); } } } +} // namespace InternalSystem + diff --git a/lib/SystemTypeObjectSupport.hpp b/lib/SystemTypeObjectSupport.hpp index e69e532..ad179ec 100644 --- a/lib/SystemTypeObjectSupport.hpp +++ b/lib/SystemTypeObjectSupport.hpp @@ -19,8 +19,8 @@ * This file was generated by the tool fastddsgen. */ -#ifndef FAST_DDS_GENERATED__SYSTEM_TYPE_OBJECT_SUPPORT_HPP -#define FAST_DDS_GENERATED__SYSTEM_TYPE_OBJECT_SUPPORT_HPP +#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_TYPE_OBJECT_SUPPORT_HPP +#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_TYPE_OBJECT_SUPPORT_HPP #include @@ -37,6 +37,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC +namespace InternalSystem { /** * @brief Register LicencePlateReq related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -49,6 +50,7 @@ */ eProsima_user_DllExport void register_LicencePlateReq_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register LicencePlateRsp related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -61,6 +63,7 @@ eProsima_user_DllExport void register_LicencePlateReq_type_identifier( */ eProsima_user_DllExport void register_LicencePlateRsp_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register PrintReq related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -73,6 +76,7 @@ eProsima_user_DllExport void register_LicencePlateRsp_type_identifier( */ eProsima_user_DllExport void register_PrintReq_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register PrintRsp related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -85,6 +89,7 @@ eProsima_user_DllExport void register_PrintReq_type_identifier( */ eProsima_user_DllExport void register_PrintRsp_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register WeighReq related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -97,6 +102,7 @@ eProsima_user_DllExport void register_PrintRsp_type_identifier( */ eProsima_user_DllExport void register_WeighReq_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register WeighRsp related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -109,6 +115,7 @@ eProsima_user_DllExport void register_WeighReq_type_identifier( */ eProsima_user_DllExport void register_WeighRsp_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register IoCtrlReq related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -121,6 +128,7 @@ eProsima_user_DllExport void register_WeighRsp_type_identifier( */ eProsima_user_DllExport void register_IoCtrlReq_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + /** * @brief Register IoCtrlRsp related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. @@ -134,7 +142,9 @@ eProsima_user_DllExport void register_IoCtrlReq_type_identifier( eProsima_user_DllExport void register_IoCtrlRsp_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); +} // namespace InternalSystem + #endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -#endif // FAST_DDS_GENERATED__SYSTEM_TYPE_OBJECT_SUPPORT_HPP +#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_TYPE_OBJECT_SUPPORT_HPP diff --git a/print/Publisher.cxx b/print/Publisher.cxx index 5762f36..6d0a130 100644 --- a/print/Publisher.cxx +++ b/print/Publisher.cxx @@ -63,7 +63,7 @@ PublisherApp::PublisherApp( participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none()); if (participant_ == nullptr) { - throw std::runtime_error("PrintRsp Participant initialization failed"); + throw std::runtime_error("InternalSystem::PrintRsp Participant initialization failed"); } // Register the type @@ -75,7 +75,7 @@ PublisherApp::PublisherApp( publisher_ = participant_->create_publisher(pub_qos, nullptr, StatusMask::none()); if (publisher_ == nullptr) { - throw std::runtime_error("PrintRsp Publisher initialization failed"); + throw std::runtime_error("InternalSystem::PrintRsp Publisher initialization failed"); } // Create the topic @@ -84,7 +84,7 @@ PublisherApp::PublisherApp( topic_ = participant_->create_topic("PrintRspTopic", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("PrintRsp Topic initialization failed"); + throw std::runtime_error("InternalSystem::PrintRsp Topic initialization failed"); } // Create the data writer @@ -96,7 +96,7 @@ PublisherApp::PublisherApp( writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all()); if (writer_ == nullptr) { - throw std::runtime_error("PrintRsp DataWriter initialization failed"); + throw std::runtime_error("InternalSystem::PrintRsp DataWriter initialization failed"); } } @@ -149,14 +149,14 @@ void PublisherApp::run(std::shared_ptr handler) { if(!MsgData::PrintReq_queue_.empty()) { - PrintReq req = std::move(MsgData::PrintReq_queue_.front()); + InternalSystem::PrintReq req = std::move(MsgData::PrintReq_queue_.front()); MsgData::PrintReq_queue_.pop(); lock.unlock(); std::cout << "index: " << req.index() << std::endl; handler->HandleDdsMsg(req.msg()); - PrintRsp rsp; + InternalSystem::PrintRsp rsp; rsp.index() = req.index(); rsp.msg() = "success"; writer_->write(&rsp); @@ -190,7 +190,7 @@ bool PublisherApp::publish() if (!is_stopped()) { /* Initialize your structure here */ - WeighRsp sample_; + InternalSystem::LicencePlateRsp sample_; ret = (RETCODE_OK == writer_->write(&sample_)); } return ret; diff --git a/print/Subscriber.cxx b/print/Subscriber.cxx index fb0bbc5..d01f780 100644 --- a/print/Subscriber.cxx +++ b/print/Subscriber.cxx @@ -58,7 +58,7 @@ SubscriberApp::SubscriberApp( participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none()); if (participant_ == nullptr) { - throw std::runtime_error("PrintReq Participant initialization failed"); + throw std::runtime_error("InternalSystem::PrintReq Participant initialization failed"); } // Register the type @@ -70,7 +70,7 @@ SubscriberApp::SubscriberApp( subscriber_ = participant_->create_subscriber(sub_qos, nullptr, StatusMask::none()); if (subscriber_ == nullptr) { - throw std::runtime_error("PrintReq Subscriber initialization failed"); + throw std::runtime_error("InternalSystem::PrintReq Subscriber initialization failed"); } // Create the topic @@ -79,7 +79,7 @@ SubscriberApp::SubscriberApp( topic_ = participant_->create_topic("PrintReqTopic", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("PrintReq Topic initialization failed"); + throw std::runtime_error("InternalSystem::PrintReq Topic initialization failed"); } // Create the reader @@ -91,7 +91,7 @@ SubscriberApp::SubscriberApp( reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all()); if (reader_ == nullptr) { - throw std::runtime_error("PrintReq DataReader initialization failed"); + throw std::runtime_error("InternalSystem::PrintReq DataReader initialization failed"); } } @@ -135,7 +135,7 @@ void SubscriberApp::on_data_available( if (topic_name == "PrintReqTopic") { - PrintReq sample_; + InternalSystem::PrintReq sample_; while ((!is_stopped()) && (RETCODE_OK == reader->take_next_sample(&sample_, &info))) { if ((info.instance_state == ALIVE_INSTANCE_STATE) && info.valid_data) diff --git a/print/main.cxx b/print/main.cxx index 17b7ac1..9409b41 100644 --- a/print/main.cxx +++ b/print/main.cxx @@ -64,7 +64,7 @@ std::string parse_signal( } } -std::queue MsgData::PrintReq_queue_; +std::queue MsgData::PrintReq_queue_; std::mutex MsgData::queue_cv_mtx_; int main(int argc, char** argv) diff --git a/print/msg.hpp b/print/msg.hpp index 5e903ef..6068f3d 100644 --- a/print/msg.hpp +++ b/print/msg.hpp @@ -7,7 +7,7 @@ class MsgData { public: - static std::queue PrintReq_queue_; + static std::queue PrintReq_queue_; static std::mutex queue_cv_mtx_; };