diff --git a/CMakeLists.txt b/CMakeLists.txt index f4aff08..97bd46c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,15 +31,15 @@ add_library(System_lib lib/SystemTypeObjectSupport.cxx lib/SystemPubSubTypes.cxx target_link_libraries(System_lib fastcdr fastdds) # Demo Application. -add_executable(Demo - demo/main.cxx - demo/Publisher.cxx - demo/Subscriber.cxx - ) -target_include_directories(Demo PRIVATE demo) -target_link_libraries(Demo fastcdr fastdds - System_lib - ) +# add_executable(Demo +# demo/main.cxx +# demo/Publisher.cxx +# demo/Subscriber.cxx +# ) +# target_include_directories(Demo PRIVATE demo) +# target_link_libraries(Demo fastcdr fastdds +# System_lib +# ) # IoCtrl Application. add_executable(IoCtrl diff --git a/httpserver/Publisher.cxx b/httpserver/Publisher.cxx index 4622866..b341f8f 100644 --- a/httpserver/Publisher.cxx +++ b/httpserver/Publisher.cxx @@ -46,7 +46,7 @@ PublisherApp::PublisherApp( , publisher_(nullptr) , topic_(nullptr) , writer_(nullptr) - , type_(new LicencePlateRspPubSubType()) + , type_(new WeighingSystem::LicenseSnapUpdatePubSubType()) , matched_(0) , samples_sent_(0) , stop_(false) @@ -74,28 +74,34 @@ PublisherApp::PublisherApp( publisher_ = participant_->create_publisher(pub_qos, nullptr, StatusMask::none()); if (publisher_ == nullptr) { - throw std::runtime_error("LicencePlateRsp Publisher initialization failed"); + throw std::runtime_error("HttpServer Publisher initialization failed"); } // Create the topic TopicQos topic_qos = TOPIC_QOS_DEFAULT; participant_->get_default_topic_qos(topic_qos); - topic_ = participant_->create_topic("LicencePlateRspTopic", type_.get_type_name(), topic_qos); + topic_ = participant_->create_topic("LicenseSnapUpdate", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("LicencePlateRsp Topic initialization failed"); + throw std::runtime_error("WeighingSystem::LicenseSnapUpdate Topic initialization failed"); } // Create the data writer DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; publisher_->get_default_datawriter_qos(writer_qos); writer_qos.reliability().kind = ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS; + writer_qos.reliability().max_blocking_time = Duration_t(1, 0); writer_qos.durability().kind = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS; writer_qos.history().kind = HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS; + writer_qos.history().depth = 1; + writer_qos.resource_limits().max_samples = 200; + writer_qos.resource_limits().max_instances = 1; + writer_qos.resource_limits().max_samples_per_instance = 100; + writer_qos.data_sharing().off(); writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all()); if (writer_ == nullptr) { - throw std::runtime_error("LicencePlateRsp DataWriter initialization failed"); + throw std::runtime_error("WeighingSystem::LicenseSnapUpdate DataWriter initialization failed"); } } @@ -141,6 +147,7 @@ void PublisherApp::on_publication_matched( void PublisherApp::run(std::shared_ptr handler) { + std::string old_License = ""; while (!is_stopped()) { handler->run(); @@ -150,9 +157,15 @@ void PublisherApp::run(std::shared_ptr handler) json j = json::parse(handler->PostMsg); std::cout << "车牌: " << j["AlarmInfoPlate"]["result"]["PlateResult"]["license"] << std::endl; - LicencePlateRsp rsp; - rsp.licence() = j["AlarmInfoPlate"]["result"]["PlateResult"]["license"]; - writer_->write(&rsp); + WeighingSystem::LicenseSnapUpdate info; + info.License() = j["AlarmInfoPlate"]["result"]["PlateResult"]["license"]; + info.NewTag() = 1; + if (info.License() == old_License) + { + info.NewTag() = 2; + } + old_License = info.License(); + writer_->write(&info); handler->PostMsg.clear(); } @@ -180,7 +193,7 @@ bool PublisherApp::publish() if (!is_stopped()) { /* Initialize your structure here */ - WeighRsp sample_; + WeighingSystem::LicenseSnapUpdate sample_; ret = (RETCODE_OK == writer_->write(&sample_)); } return ret; diff --git a/httpserver/Subscriber.cxx b/httpserver/Subscriber.cxx index ed1efd6..f0cc5a3 100644 --- a/httpserver/Subscriber.cxx +++ b/httpserver/Subscriber.cxx @@ -43,7 +43,7 @@ SubscriberApp::SubscriberApp( , subscriber_(nullptr) , topic_(nullptr) , reader_(nullptr) - , type_(new LicencePlateReqPubSubType()) + , type_(new WeighingSystem::LicenseSnapUpdatePubSubType()) , samples_received_(0) , stop_(false) { @@ -68,16 +68,16 @@ SubscriberApp::SubscriberApp( subscriber_ = participant_->create_subscriber(sub_qos, nullptr, StatusMask::none()); if (subscriber_ == nullptr) { - throw std::runtime_error("LicencePlateReq Subscriber initialization failed"); + throw std::runtime_error("HttpServer Subscriber initialization failed"); } // Create the topic TopicQos topic_qos = TOPIC_QOS_DEFAULT; participant_->get_default_topic_qos(topic_qos); - topic_ = participant_->create_topic("LicencePlateReqTopic", type_.get_type_name(), topic_qos); + topic_ = participant_->create_topic("LicenseSnapUpdate", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("LicencePlateReq Topic initialization failed"); + throw std::runtime_error("WeighingSystem::LicenseSnapUpdate Topic initialization failed"); } // Create the reader @@ -89,7 +89,7 @@ SubscriberApp::SubscriberApp( reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all()); if (reader_ == nullptr) { - throw std::runtime_error("LicencePlateReq DataReader initialization failed"); + throw std::runtime_error("WeighingSystem::LicenseSnapUpdate DataReader initialization failed"); } } @@ -127,7 +127,7 @@ void SubscriberApp::on_subscription_matched( void SubscriberApp::on_data_available( DataReader* reader) { - LicencePlateReq sample_; + WeighingSystem::LicenseSnapUpdate sample_; SampleInfo info; while ((!is_stopped()) && (RETCODE_OK == reader->take_next_sample(&sample_, &info))) { diff --git a/httpserver/main.cxx b/httpserver/main.cxx index 04b9717..65eb144 100644 --- a/httpserver/main.cxx +++ b/httpserver/main.cxx @@ -33,7 +33,7 @@ #include "httpserver.hpp" -#define VERSION "v1.0" +#define VERSION "v1.0.0" using eprosima::fastdds::dds::Log; @@ -67,7 +67,7 @@ std::string parse_signal( int main(int argc, char** argv) { auto ret = EXIT_SUCCESS; - std::shared_ptr sub; + // std::shared_ptr sub; std::shared_ptr pub; std::shared_ptr dev; @@ -112,7 +112,7 @@ int main(int argc, char** argv) } } - sub = std::make_shared(domain_id); + // sub = std::make_shared(domain_id); pub = std::make_shared(domain_id); dev = std::make_shared(); diff --git a/httpserver/msg.hpp b/httpserver/msg.hpp deleted file mode 100644 index 5e903ef..0000000 --- a/httpserver/msg.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _MSG_HPP_ -#define _MSG_HPP_ - -#include -#include -#include "System.hpp" - -class MsgData { -public: - static std::queue PrintReq_queue_; - static std::mutex queue_cv_mtx_; -}; - -#endif \ No newline at end of file diff --git a/lib/System.hpp b/lib/System.hpp index 16216bc..6cea57f 100644 --- a/lib/System.hpp +++ b/lib/System.hpp @@ -52,716 +52,3297 @@ #define SYSTEM_DllAPI #endif // _WIN32 -namespace InternalSystem { +namespace WeighingSystem { + +/*! + * @brief This class represents the structure ScaleInfo defined by the user in the IDL file. + * @ingroup System + */ +class ScaleInfo +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ScaleInfo() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ScaleInfo() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ScaleInfo that will be copied. + */ + eProsima_user_DllExport ScaleInfo( + const ScaleInfo& x) + { + m_HasVehicle = x.m_HasVehicle; + + m_WeightOK = x.m_WeightOK; + + m_State = x.m_State; + + m_Value = x.m_Value; + + m_StableValue = x.m_StableValue; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ScaleInfo that will be copied. + */ + eProsima_user_DllExport ScaleInfo( + ScaleInfo&& x) noexcept + { + m_HasVehicle = x.m_HasVehicle; + m_WeightOK = x.m_WeightOK; + m_State = x.m_State; + m_Value = x.m_Value; + m_StableValue = x.m_StableValue; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ScaleInfo that will be copied. + */ + eProsima_user_DllExport ScaleInfo& operator =( + const ScaleInfo& x) + { + + m_HasVehicle = x.m_HasVehicle; + + m_WeightOK = x.m_WeightOK; + + m_State = x.m_State; + + m_Value = x.m_Value; + + m_StableValue = x.m_StableValue; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ScaleInfo that will be copied. + */ + eProsima_user_DllExport ScaleInfo& operator =( + ScaleInfo&& x) noexcept + { + + m_HasVehicle = x.m_HasVehicle; + m_WeightOK = x.m_WeightOK; + m_State = x.m_State; + m_Value = x.m_Value; + m_StableValue = x.m_StableValue; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ScaleInfo object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ScaleInfo& x) const + { + return (m_HasVehicle == x.m_HasVehicle && + m_WeightOK == x.m_WeightOK && + m_State == x.m_State && + m_Value == x.m_Value && + m_StableValue == x.m_StableValue); + } + + /*! + * @brief Comparison operator. + * @param x ScaleInfo object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ScaleInfo& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member HasVehicle + * @param _HasVehicle New value for member HasVehicle + */ + eProsima_user_DllExport void HasVehicle( + bool _HasVehicle) + { + m_HasVehicle = _HasVehicle; + } + + /*! + * @brief This function returns the value of member HasVehicle + * @return Value of member HasVehicle + */ + eProsima_user_DllExport bool HasVehicle() const + { + return m_HasVehicle; + } + + /*! + * @brief This function returns a reference to member HasVehicle + * @return Reference to member HasVehicle + */ + eProsima_user_DllExport bool& HasVehicle() + { + return m_HasVehicle; + } + + + /*! + * @brief This function sets a value in member WeightOK + * @param _WeightOK New value for member WeightOK + */ + eProsima_user_DllExport void WeightOK( + bool _WeightOK) + { + m_WeightOK = _WeightOK; + } + + /*! + * @brief This function returns the value of member WeightOK + * @return Value of member WeightOK + */ + eProsima_user_DllExport bool WeightOK() const + { + return m_WeightOK; + } + + /*! + * @brief This function returns a reference to member WeightOK + * @return Reference to member WeightOK + */ + eProsima_user_DllExport bool& WeightOK() + { + return m_WeightOK; + } + + + /*! + * @brief This function sets a value in member State + * @param _State New value for member State + */ + eProsima_user_DllExport void State( + bool _State) + { + m_State = _State; + } + + /*! + * @brief This function returns the value of member State + * @return Value of member State + */ + eProsima_user_DllExport bool State() const + { + return m_State; + } + + /*! + * @brief This function returns a reference to member State + * @return Reference to member State + */ + eProsima_user_DllExport bool& State() + { + return m_State; + } + + + /*! + * @brief This function sets a value in member Value + * @param _Value New value for member Value + */ + eProsima_user_DllExport void Value( + float _Value) + { + m_Value = _Value; + } + + /*! + * @brief This function returns the value of member Value + * @return Value of member Value + */ + eProsima_user_DllExport float Value() const + { + return m_Value; + } + + /*! + * @brief This function returns a reference to member Value + * @return Reference to member Value + */ + eProsima_user_DllExport float& Value() + { + return m_Value; + } + + + /*! + * @brief This function sets a value in member StableValue + * @param _StableValue New value for member StableValue + */ + eProsima_user_DllExport void StableValue( + float _StableValue) + { + m_StableValue = _StableValue; + } + + /*! + * @brief This function returns the value of member StableValue + * @return Value of member StableValue + */ + eProsima_user_DllExport float StableValue() const + { + return m_StableValue; + } + + /*! + * @brief This function returns a reference to member StableValue + * @return Reference to member StableValue + */ + eProsima_user_DllExport float& StableValue() + { + return m_StableValue; + } + + + +private: + + bool m_HasVehicle{false}; + bool m_WeightOK{false}; + bool m_State{false}; + float m_Value{0.0}; + float m_StableValue{0.0}; + +}; +/*! + * @brief This class represents the structure ScaleCommand defined by the user in the IDL file. + * @ingroup System + */ +class ScaleCommand +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport ScaleCommand() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~ScaleCommand() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object ScaleCommand that will be copied. + */ + eProsima_user_DllExport ScaleCommand( + const ScaleCommand& x) + { + m_Enable = x.m_Enable; + + m_ResetZero = x.m_ResetZero; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object ScaleCommand that will be copied. + */ + eProsima_user_DllExport ScaleCommand( + ScaleCommand&& x) noexcept + { + m_Enable = x.m_Enable; + m_ResetZero = x.m_ResetZero; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object ScaleCommand that will be copied. + */ + eProsima_user_DllExport ScaleCommand& operator =( + const ScaleCommand& x) + { + + m_Enable = x.m_Enable; + + m_ResetZero = x.m_ResetZero; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object ScaleCommand that will be copied. + */ + eProsima_user_DllExport ScaleCommand& operator =( + ScaleCommand&& x) noexcept + { + + m_Enable = x.m_Enable; + m_ResetZero = x.m_ResetZero; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x ScaleCommand object to compare. + */ + eProsima_user_DllExport bool operator ==( + const ScaleCommand& x) const + { + return (m_Enable == x.m_Enable && + m_ResetZero == x.m_ResetZero); + } + + /*! + * @brief Comparison operator. + * @param x ScaleCommand object to compare. + */ + eProsima_user_DllExport bool operator !=( + const ScaleCommand& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member Enable + * @param _Enable New value for member Enable + */ + eProsima_user_DllExport void Enable( + bool _Enable) + { + m_Enable = _Enable; + } + + /*! + * @brief This function returns the value of member Enable + * @return Value of member Enable + */ + eProsima_user_DllExport bool Enable() const + { + return m_Enable; + } + + /*! + * @brief This function returns a reference to member Enable + * @return Reference to member Enable + */ + eProsima_user_DllExport bool& Enable() + { + return m_Enable; + } + + + /*! + * @brief This function sets a value in member ResetZero + * @param _ResetZero New value for member ResetZero + */ + eProsima_user_DllExport void ResetZero( + int32_t _ResetZero) + { + m_ResetZero = _ResetZero; + } + + /*! + * @brief This function returns the value of member ResetZero + * @return Value of member ResetZero + */ + eProsima_user_DllExport int32_t ResetZero() const + { + return m_ResetZero; + } + + /*! + * @brief This function returns a reference to member ResetZero + * @return Reference to member ResetZero + */ + eProsima_user_DllExport int32_t& ResetZero() + { + return m_ResetZero; + } + + + +private: + + bool m_Enable{false}; + int32_t m_ResetZero{0}; + +}; +/*! + * @brief This class represents the structure WeightInfoOk defined by the user in the IDL file. + * @ingroup System + */ +class WeightInfoOk +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WeightInfoOk() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WeightInfoOk() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object WeightInfoOk that will be copied. + */ + eProsima_user_DllExport WeightInfoOk( + const WeightInfoOk& x) + { + m_DeviceID = x.m_DeviceID; + + m_DeviceName = x.m_DeviceName; + + m_DeviceType = x.m_DeviceType; + + m_EnterpriseName = x.m_EnterpriseName; + + m_BillNumber = x.m_BillNumber; + + m_CarNumber = x.m_CarNumber; + + m_Supplier = x.m_Supplier; + + m_GoodsType = x.m_GoodsType; + + m_GrossWeight = x.m_GrossWeight; + + m_GrossTime = x.m_GrossTime; + + m_GrossOperater = x.m_GrossOperater; + + m_Tare = x.m_Tare; + + m_TareTime = x.m_TareTime; + + m_TareOperater = x.m_TareOperater; + + m_Suttle = x.m_Suttle; + + m_duduction1 = x.m_duduction1; + + m_duduction2 = x.m_duduction2; + + m_duduction3 = x.m_duduction3; + + m_INCoalYard = x.m_INCoalYard; + + m_OutCoalYard = x.m_OutCoalYard; + + m_BatchNumber = x.m_BatchNumber; + + m_Warning = x.m_Warning; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object WeightInfoOk that will be copied. + */ + eProsima_user_DllExport WeightInfoOk( + WeightInfoOk&& x) noexcept + { + m_DeviceID = x.m_DeviceID; + m_DeviceName = std::move(x.m_DeviceName); + m_DeviceType = std::move(x.m_DeviceType); + m_EnterpriseName = std::move(x.m_EnterpriseName); + m_BillNumber = std::move(x.m_BillNumber); + m_CarNumber = std::move(x.m_CarNumber); + m_Supplier = std::move(x.m_Supplier); + m_GoodsType = std::move(x.m_GoodsType); + m_GrossWeight = x.m_GrossWeight; + m_GrossTime = std::move(x.m_GrossTime); + m_GrossOperater = std::move(x.m_GrossOperater); + m_Tare = x.m_Tare; + m_TareTime = std::move(x.m_TareTime); + m_TareOperater = std::move(x.m_TareOperater); + m_Suttle = x.m_Suttle; + m_duduction1 = x.m_duduction1; + m_duduction2 = x.m_duduction2; + m_duduction3 = x.m_duduction3; + m_INCoalYard = std::move(x.m_INCoalYard); + m_OutCoalYard = std::move(x.m_OutCoalYard); + m_BatchNumber = std::move(x.m_BatchNumber); + m_Warning = std::move(x.m_Warning); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object WeightInfoOk that will be copied. + */ + eProsima_user_DllExport WeightInfoOk& operator =( + const WeightInfoOk& x) + { + + m_DeviceID = x.m_DeviceID; + + m_DeviceName = x.m_DeviceName; + + m_DeviceType = x.m_DeviceType; + + m_EnterpriseName = x.m_EnterpriseName; + + m_BillNumber = x.m_BillNumber; + + m_CarNumber = x.m_CarNumber; + + m_Supplier = x.m_Supplier; + + m_GoodsType = x.m_GoodsType; + + m_GrossWeight = x.m_GrossWeight; + + m_GrossTime = x.m_GrossTime; + + m_GrossOperater = x.m_GrossOperater; + + m_Tare = x.m_Tare; + + m_TareTime = x.m_TareTime; + + m_TareOperater = x.m_TareOperater; + + m_Suttle = x.m_Suttle; + + m_duduction1 = x.m_duduction1; + + m_duduction2 = x.m_duduction2; + + m_duduction3 = x.m_duduction3; + + m_INCoalYard = x.m_INCoalYard; + + m_OutCoalYard = x.m_OutCoalYard; + + m_BatchNumber = x.m_BatchNumber; + + m_Warning = x.m_Warning; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object WeightInfoOk that will be copied. + */ + eProsima_user_DllExport WeightInfoOk& operator =( + WeightInfoOk&& x) noexcept + { + + m_DeviceID = x.m_DeviceID; + m_DeviceName = std::move(x.m_DeviceName); + m_DeviceType = std::move(x.m_DeviceType); + m_EnterpriseName = std::move(x.m_EnterpriseName); + m_BillNumber = std::move(x.m_BillNumber); + m_CarNumber = std::move(x.m_CarNumber); + m_Supplier = std::move(x.m_Supplier); + m_GoodsType = std::move(x.m_GoodsType); + m_GrossWeight = x.m_GrossWeight; + m_GrossTime = std::move(x.m_GrossTime); + m_GrossOperater = std::move(x.m_GrossOperater); + m_Tare = x.m_Tare; + m_TareTime = std::move(x.m_TareTime); + m_TareOperater = std::move(x.m_TareOperater); + m_Suttle = x.m_Suttle; + m_duduction1 = x.m_duduction1; + m_duduction2 = x.m_duduction2; + m_duduction3 = x.m_duduction3; + m_INCoalYard = std::move(x.m_INCoalYard); + m_OutCoalYard = std::move(x.m_OutCoalYard); + m_BatchNumber = std::move(x.m_BatchNumber); + m_Warning = std::move(x.m_Warning); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x WeightInfoOk object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WeightInfoOk& x) const + { + return (m_DeviceID == x.m_DeviceID && + m_DeviceName == x.m_DeviceName && + m_DeviceType == x.m_DeviceType && + m_EnterpriseName == x.m_EnterpriseName && + m_BillNumber == x.m_BillNumber && + m_CarNumber == x.m_CarNumber && + m_Supplier == x.m_Supplier && + m_GoodsType == x.m_GoodsType && + m_GrossWeight == x.m_GrossWeight && + m_GrossTime == x.m_GrossTime && + m_GrossOperater == x.m_GrossOperater && + m_Tare == x.m_Tare && + m_TareTime == x.m_TareTime && + m_TareOperater == x.m_TareOperater && + m_Suttle == x.m_Suttle && + m_duduction1 == x.m_duduction1 && + m_duduction2 == x.m_duduction2 && + m_duduction3 == x.m_duduction3 && + m_INCoalYard == x.m_INCoalYard && + m_OutCoalYard == x.m_OutCoalYard && + m_BatchNumber == x.m_BatchNumber && + m_Warning == x.m_Warning); + } + + /*! + * @brief Comparison operator. + * @param x WeightInfoOk object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WeightInfoOk& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member DeviceID + * @param _DeviceID New value for member DeviceID + */ + eProsima_user_DllExport void DeviceID( + int32_t _DeviceID) + { + m_DeviceID = _DeviceID; + } + + /*! + * @brief This function returns the value of member DeviceID + * @return Value of member DeviceID + */ + eProsima_user_DllExport int32_t DeviceID() const + { + return m_DeviceID; + } + + /*! + * @brief This function returns a reference to member DeviceID + * @return Reference to member DeviceID + */ + eProsima_user_DllExport int32_t& DeviceID() + { + return m_DeviceID; + } + + + /*! + * @brief This function copies the value in member DeviceName + * @param _DeviceName New value to be copied in member DeviceName + */ + eProsima_user_DllExport void DeviceName( + const std::string& _DeviceName) + { + m_DeviceName = _DeviceName; + } + + /*! + * @brief This function moves the value in member DeviceName + * @param _DeviceName New value to be moved in member DeviceName + */ + eProsima_user_DllExport void DeviceName( + std::string&& _DeviceName) + { + m_DeviceName = std::move(_DeviceName); + } + + /*! + * @brief This function returns a constant reference to member DeviceName + * @return Constant reference to member DeviceName + */ + eProsima_user_DllExport const std::string& DeviceName() const + { + return m_DeviceName; + } + + /*! + * @brief This function returns a reference to member DeviceName + * @return Reference to member DeviceName + */ + eProsima_user_DllExport std::string& DeviceName() + { + return m_DeviceName; + } + + + /*! + * @brief This function copies the value in member DeviceType + * @param _DeviceType New value to be copied in member DeviceType + */ + eProsima_user_DllExport void DeviceType( + const std::string& _DeviceType) + { + m_DeviceType = _DeviceType; + } + + /*! + * @brief This function moves the value in member DeviceType + * @param _DeviceType New value to be moved in member DeviceType + */ + eProsima_user_DllExport void DeviceType( + std::string&& _DeviceType) + { + m_DeviceType = std::move(_DeviceType); + } + + /*! + * @brief This function returns a constant reference to member DeviceType + * @return Constant reference to member DeviceType + */ + eProsima_user_DllExport const std::string& DeviceType() const + { + return m_DeviceType; + } + + /*! + * @brief This function returns a reference to member DeviceType + * @return Reference to member DeviceType + */ + eProsima_user_DllExport std::string& DeviceType() + { + return m_DeviceType; + } + + + /*! + * @brief This function copies the value in member EnterpriseName + * @param _EnterpriseName New value to be copied in member EnterpriseName + */ + eProsima_user_DllExport void EnterpriseName( + const std::string& _EnterpriseName) + { + m_EnterpriseName = _EnterpriseName; + } + + /*! + * @brief This function moves the value in member EnterpriseName + * @param _EnterpriseName New value to be moved in member EnterpriseName + */ + eProsima_user_DllExport void EnterpriseName( + std::string&& _EnterpriseName) + { + m_EnterpriseName = std::move(_EnterpriseName); + } + + /*! + * @brief This function returns a constant reference to member EnterpriseName + * @return Constant reference to member EnterpriseName + */ + eProsima_user_DllExport const std::string& EnterpriseName() const + { + return m_EnterpriseName; + } + + /*! + * @brief This function returns a reference to member EnterpriseName + * @return Reference to member EnterpriseName + */ + eProsima_user_DllExport std::string& EnterpriseName() + { + return m_EnterpriseName; + } + + + /*! + * @brief This function copies the value in member BillNumber + * @param _BillNumber New value to be copied in member BillNumber + */ + eProsima_user_DllExport void BillNumber( + const std::string& _BillNumber) + { + m_BillNumber = _BillNumber; + } + + /*! + * @brief This function moves the value in member BillNumber + * @param _BillNumber New value to be moved in member BillNumber + */ + eProsima_user_DllExport void BillNumber( + std::string&& _BillNumber) + { + m_BillNumber = std::move(_BillNumber); + } + + /*! + * @brief This function returns a constant reference to member BillNumber + * @return Constant reference to member BillNumber + */ + eProsima_user_DllExport const std::string& BillNumber() const + { + return m_BillNumber; + } + + /*! + * @brief This function returns a reference to member BillNumber + * @return Reference to member BillNumber + */ + eProsima_user_DllExport std::string& BillNumber() + { + return m_BillNumber; + } + + + /*! + * @brief This function copies the value in member CarNumber + * @param _CarNumber New value to be copied in member CarNumber + */ + eProsima_user_DllExport void CarNumber( + const std::string& _CarNumber) + { + m_CarNumber = _CarNumber; + } + + /*! + * @brief This function moves the value in member CarNumber + * @param _CarNumber New value to be moved in member CarNumber + */ + eProsima_user_DllExport void CarNumber( + std::string&& _CarNumber) + { + m_CarNumber = std::move(_CarNumber); + } + + /*! + * @brief This function returns a constant reference to member CarNumber + * @return Constant reference to member CarNumber + */ + eProsima_user_DllExport const std::string& CarNumber() const + { + return m_CarNumber; + } + + /*! + * @brief This function returns a reference to member CarNumber + * @return Reference to member CarNumber + */ + eProsima_user_DllExport std::string& CarNumber() + { + return m_CarNumber; + } + + + /*! + * @brief This function copies the value in member Supplier + * @param _Supplier New value to be copied in member Supplier + */ + eProsima_user_DllExport void Supplier( + const std::string& _Supplier) + { + m_Supplier = _Supplier; + } + + /*! + * @brief This function moves the value in member Supplier + * @param _Supplier New value to be moved in member Supplier + */ + eProsima_user_DllExport void Supplier( + std::string&& _Supplier) + { + m_Supplier = std::move(_Supplier); + } + + /*! + * @brief This function returns a constant reference to member Supplier + * @return Constant reference to member Supplier + */ + eProsima_user_DllExport const std::string& Supplier() const + { + return m_Supplier; + } + + /*! + * @brief This function returns a reference to member Supplier + * @return Reference to member Supplier + */ + eProsima_user_DllExport std::string& Supplier() + { + return m_Supplier; + } + + + /*! + * @brief This function copies the value in member GoodsType + * @param _GoodsType New value to be copied in member GoodsType + */ + eProsima_user_DllExport void GoodsType( + const std::string& _GoodsType) + { + m_GoodsType = _GoodsType; + } + + /*! + * @brief This function moves the value in member GoodsType + * @param _GoodsType New value to be moved in member GoodsType + */ + eProsima_user_DllExport void GoodsType( + std::string&& _GoodsType) + { + m_GoodsType = std::move(_GoodsType); + } + + /*! + * @brief This function returns a constant reference to member GoodsType + * @return Constant reference to member GoodsType + */ + eProsima_user_DllExport const std::string& GoodsType() const + { + return m_GoodsType; + } + + /*! + * @brief This function returns a reference to member GoodsType + * @return Reference to member GoodsType + */ + eProsima_user_DllExport std::string& GoodsType() + { + return m_GoodsType; + } + + + /*! + * @brief This function sets a value in member GrossWeight + * @param _GrossWeight New value for member GrossWeight + */ + eProsima_user_DllExport void GrossWeight( + float _GrossWeight) + { + m_GrossWeight = _GrossWeight; + } + + /*! + * @brief This function returns the value of member GrossWeight + * @return Value of member GrossWeight + */ + eProsima_user_DllExport float GrossWeight() const + { + return m_GrossWeight; + } + + /*! + * @brief This function returns a reference to member GrossWeight + * @return Reference to member GrossWeight + */ + eProsima_user_DllExport float& GrossWeight() + { + return m_GrossWeight; + } + + + /*! + * @brief This function copies the value in member GrossTime + * @param _GrossTime New value to be copied in member GrossTime + */ + eProsima_user_DllExport void GrossTime( + const std::string& _GrossTime) + { + m_GrossTime = _GrossTime; + } + + /*! + * @brief This function moves the value in member GrossTime + * @param _GrossTime New value to be moved in member GrossTime + */ + eProsima_user_DllExport void GrossTime( + std::string&& _GrossTime) + { + m_GrossTime = std::move(_GrossTime); + } + + /*! + * @brief This function returns a constant reference to member GrossTime + * @return Constant reference to member GrossTime + */ + eProsima_user_DllExport const std::string& GrossTime() const + { + return m_GrossTime; + } + + /*! + * @brief This function returns a reference to member GrossTime + * @return Reference to member GrossTime + */ + eProsima_user_DllExport std::string& GrossTime() + { + return m_GrossTime; + } + + + /*! + * @brief This function copies the value in member GrossOperater + * @param _GrossOperater New value to be copied in member GrossOperater + */ + eProsima_user_DllExport void GrossOperater( + const std::string& _GrossOperater) + { + m_GrossOperater = _GrossOperater; + } + + /*! + * @brief This function moves the value in member GrossOperater + * @param _GrossOperater New value to be moved in member GrossOperater + */ + eProsima_user_DllExport void GrossOperater( + std::string&& _GrossOperater) + { + m_GrossOperater = std::move(_GrossOperater); + } + + /*! + * @brief This function returns a constant reference to member GrossOperater + * @return Constant reference to member GrossOperater + */ + eProsima_user_DllExport const std::string& GrossOperater() const + { + return m_GrossOperater; + } + + /*! + * @brief This function returns a reference to member GrossOperater + * @return Reference to member GrossOperater + */ + eProsima_user_DllExport std::string& GrossOperater() + { + return m_GrossOperater; + } + + + /*! + * @brief This function sets a value in member Tare + * @param _Tare New value for member Tare + */ + eProsima_user_DllExport void Tare( + float _Tare) + { + m_Tare = _Tare; + } + + /*! + * @brief This function returns the value of member Tare + * @return Value of member Tare + */ + eProsima_user_DllExport float Tare() const + { + return m_Tare; + } + + /*! + * @brief This function returns a reference to member Tare + * @return Reference to member Tare + */ + eProsima_user_DllExport float& Tare() + { + return m_Tare; + } + + + /*! + * @brief This function copies the value in member TareTime + * @param _TareTime New value to be copied in member TareTime + */ + eProsima_user_DllExport void TareTime( + const std::string& _TareTime) + { + m_TareTime = _TareTime; + } + + /*! + * @brief This function moves the value in member TareTime + * @param _TareTime New value to be moved in member TareTime + */ + eProsima_user_DllExport void TareTime( + std::string&& _TareTime) + { + m_TareTime = std::move(_TareTime); + } + + /*! + * @brief This function returns a constant reference to member TareTime + * @return Constant reference to member TareTime + */ + eProsima_user_DllExport const std::string& TareTime() const + { + return m_TareTime; + } + + /*! + * @brief This function returns a reference to member TareTime + * @return Reference to member TareTime + */ + eProsima_user_DllExport std::string& TareTime() + { + return m_TareTime; + } + + + /*! + * @brief This function copies the value in member TareOperater + * @param _TareOperater New value to be copied in member TareOperater + */ + eProsima_user_DllExport void TareOperater( + const std::string& _TareOperater) + { + m_TareOperater = _TareOperater; + } + + /*! + * @brief This function moves the value in member TareOperater + * @param _TareOperater New value to be moved in member TareOperater + */ + eProsima_user_DllExport void TareOperater( + std::string&& _TareOperater) + { + m_TareOperater = std::move(_TareOperater); + } + + /*! + * @brief This function returns a constant reference to member TareOperater + * @return Constant reference to member TareOperater + */ + eProsima_user_DllExport const std::string& TareOperater() const + { + return m_TareOperater; + } + + /*! + * @brief This function returns a reference to member TareOperater + * @return Reference to member TareOperater + */ + eProsima_user_DllExport std::string& TareOperater() + { + return m_TareOperater; + } + + + /*! + * @brief This function sets a value in member Suttle + * @param _Suttle New value for member Suttle + */ + eProsima_user_DllExport void Suttle( + float _Suttle) + { + m_Suttle = _Suttle; + } + + /*! + * @brief This function returns the value of member Suttle + * @return Value of member Suttle + */ + eProsima_user_DllExport float Suttle() const + { + return m_Suttle; + } + + /*! + * @brief This function returns a reference to member Suttle + * @return Reference to member Suttle + */ + eProsima_user_DllExport float& Suttle() + { + return m_Suttle; + } + + + /*! + * @brief This function sets a value in member duduction1 + * @param _duduction1 New value for member duduction1 + */ + eProsima_user_DllExport void duduction1( + float _duduction1) + { + m_duduction1 = _duduction1; + } + + /*! + * @brief This function returns the value of member duduction1 + * @return Value of member duduction1 + */ + eProsima_user_DllExport float duduction1() const + { + return m_duduction1; + } + + /*! + * @brief This function returns a reference to member duduction1 + * @return Reference to member duduction1 + */ + eProsima_user_DllExport float& duduction1() + { + return m_duduction1; + } + + + /*! + * @brief This function sets a value in member duduction2 + * @param _duduction2 New value for member duduction2 + */ + eProsima_user_DllExport void duduction2( + float _duduction2) + { + m_duduction2 = _duduction2; + } + + /*! + * @brief This function returns the value of member duduction2 + * @return Value of member duduction2 + */ + eProsima_user_DllExport float duduction2() const + { + return m_duduction2; + } + + /*! + * @brief This function returns a reference to member duduction2 + * @return Reference to member duduction2 + */ + eProsima_user_DllExport float& duduction2() + { + return m_duduction2; + } + + + /*! + * @brief This function sets a value in member duduction3 + * @param _duduction3 New value for member duduction3 + */ + eProsima_user_DllExport void duduction3( + float _duduction3) + { + m_duduction3 = _duduction3; + } + + /*! + * @brief This function returns the value of member duduction3 + * @return Value of member duduction3 + */ + eProsima_user_DllExport float duduction3() const + { + return m_duduction3; + } + + /*! + * @brief This function returns a reference to member duduction3 + * @return Reference to member duduction3 + */ + eProsima_user_DllExport float& duduction3() + { + return m_duduction3; + } + + + /*! + * @brief This function copies the value in member INCoalYard + * @param _INCoalYard New value to be copied in member INCoalYard + */ + eProsima_user_DllExport void INCoalYard( + const std::string& _INCoalYard) + { + m_INCoalYard = _INCoalYard; + } + + /*! + * @brief This function moves the value in member INCoalYard + * @param _INCoalYard New value to be moved in member INCoalYard + */ + eProsima_user_DllExport void INCoalYard( + std::string&& _INCoalYard) + { + m_INCoalYard = std::move(_INCoalYard); + } + + /*! + * @brief This function returns a constant reference to member INCoalYard + * @return Constant reference to member INCoalYard + */ + eProsima_user_DllExport const std::string& INCoalYard() const + { + return m_INCoalYard; + } + + /*! + * @brief This function returns a reference to member INCoalYard + * @return Reference to member INCoalYard + */ + eProsima_user_DllExport std::string& INCoalYard() + { + return m_INCoalYard; + } + + + /*! + * @brief This function copies the value in member OutCoalYard + * @param _OutCoalYard New value to be copied in member OutCoalYard + */ + eProsima_user_DllExport void OutCoalYard( + const std::string& _OutCoalYard) + { + m_OutCoalYard = _OutCoalYard; + } + + /*! + * @brief This function moves the value in member OutCoalYard + * @param _OutCoalYard New value to be moved in member OutCoalYard + */ + eProsima_user_DllExport void OutCoalYard( + std::string&& _OutCoalYard) + { + m_OutCoalYard = std::move(_OutCoalYard); + } + + /*! + * @brief This function returns a constant reference to member OutCoalYard + * @return Constant reference to member OutCoalYard + */ + eProsima_user_DllExport const std::string& OutCoalYard() const + { + return m_OutCoalYard; + } + + /*! + * @brief This function returns a reference to member OutCoalYard + * @return Reference to member OutCoalYard + */ + eProsima_user_DllExport std::string& OutCoalYard() + { + return m_OutCoalYard; + } + + + /*! + * @brief This function copies the value in member BatchNumber + * @param _BatchNumber New value to be copied in member BatchNumber + */ + eProsima_user_DllExport void BatchNumber( + const std::string& _BatchNumber) + { + m_BatchNumber = _BatchNumber; + } + + /*! + * @brief This function moves the value in member BatchNumber + * @param _BatchNumber New value to be moved in member BatchNumber + */ + eProsima_user_DllExport void BatchNumber( + std::string&& _BatchNumber) + { + m_BatchNumber = std::move(_BatchNumber); + } + + /*! + * @brief This function returns a constant reference to member BatchNumber + * @return Constant reference to member BatchNumber + */ + eProsima_user_DllExport const std::string& BatchNumber() const + { + return m_BatchNumber; + } + + /*! + * @brief This function returns a reference to member BatchNumber + * @return Reference to member BatchNumber + */ + eProsima_user_DllExport std::string& BatchNumber() + { + return m_BatchNumber; + } + + + /*! + * @brief This function copies the value in member Warning + * @param _Warning New value to be copied in member Warning + */ + eProsima_user_DllExport void Warning( + const std::string& _Warning) + { + m_Warning = _Warning; + } + + /*! + * @brief This function moves the value in member Warning + * @param _Warning New value to be moved in member Warning + */ + eProsima_user_DllExport void Warning( + std::string&& _Warning) + { + m_Warning = std::move(_Warning); + } + + /*! + * @brief This function returns a constant reference to member Warning + * @return Constant reference to member Warning + */ + eProsima_user_DllExport const std::string& Warning() const + { + return m_Warning; + } + + /*! + * @brief This function returns a reference to member Warning + * @return Reference to member Warning + */ + eProsima_user_DllExport std::string& Warning() + { + return m_Warning; + } + + + +private: + + int32_t m_DeviceID{0}; + std::string m_DeviceName; + std::string m_DeviceType; + std::string m_EnterpriseName; + std::string m_BillNumber; + std::string m_CarNumber; + std::string m_Supplier; + std::string m_GoodsType; + float m_GrossWeight{0.0}; + std::string m_GrossTime; + std::string m_GrossOperater; + float m_Tare{0.0}; + std::string m_TareTime; + std::string m_TareOperater; + float m_Suttle{0.0}; + float m_duduction1{0.0}; + float m_duduction2{0.0}; + float m_duduction3{0.0}; + std::string m_INCoalYard; + std::string m_OutCoalYard; + std::string m_BatchNumber; + std::string m_Warning; + +}; +/*! + * @brief This class represents the structure WeightInfoError defined by the user in the IDL file. + * @ingroup System + */ +class WeightInfoError +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport WeightInfoError() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~WeightInfoError() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object WeightInfoError that will be copied. + */ + eProsima_user_DllExport WeightInfoError( + const WeightInfoError& x) + { + m_CarNumber = x.m_CarNumber; + + m_Warning = x.m_Warning; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object WeightInfoError that will be copied. + */ + eProsima_user_DllExport WeightInfoError( + WeightInfoError&& x) noexcept + { + m_CarNumber = std::move(x.m_CarNumber); + m_Warning = std::move(x.m_Warning); + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object WeightInfoError that will be copied. + */ + eProsima_user_DllExport WeightInfoError& operator =( + const WeightInfoError& x) + { + + m_CarNumber = x.m_CarNumber; + + m_Warning = x.m_Warning; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object WeightInfoError that will be copied. + */ + eProsima_user_DllExport WeightInfoError& operator =( + WeightInfoError&& x) noexcept + { + + m_CarNumber = std::move(x.m_CarNumber); + m_Warning = std::move(x.m_Warning); + return *this; + } + + /*! + * @brief Comparison operator. + * @param x WeightInfoError object to compare. + */ + eProsima_user_DllExport bool operator ==( + const WeightInfoError& x) const + { + return (m_CarNumber == x.m_CarNumber && + m_Warning == x.m_Warning); + } + + /*! + * @brief Comparison operator. + * @param x WeightInfoError object to compare. + */ + eProsima_user_DllExport bool operator !=( + const WeightInfoError& x) const + { + return !(*this == x); + } + + /*! + * @brief This function copies the value in member CarNumber + * @param _CarNumber New value to be copied in member CarNumber + */ + eProsima_user_DllExport void CarNumber( + const std::string& _CarNumber) + { + m_CarNumber = _CarNumber; + } + + /*! + * @brief This function moves the value in member CarNumber + * @param _CarNumber New value to be moved in member CarNumber + */ + eProsima_user_DllExport void CarNumber( + std::string&& _CarNumber) + { + m_CarNumber = std::move(_CarNumber); + } + + /*! + * @brief This function returns a constant reference to member CarNumber + * @return Constant reference to member CarNumber + */ + eProsima_user_DllExport const std::string& CarNumber() const + { + return m_CarNumber; + } + + /*! + * @brief This function returns a reference to member CarNumber + * @return Reference to member CarNumber + */ + eProsima_user_DllExport std::string& CarNumber() + { + return m_CarNumber; + } + + + /*! + * @brief This function copies the value in member Warning + * @param _Warning New value to be copied in member Warning + */ + eProsima_user_DllExport void Warning( + const std::string& _Warning) + { + m_Warning = _Warning; + } + + /*! + * @brief This function moves the value in member Warning + * @param _Warning New value to be moved in member Warning + */ + eProsima_user_DllExport void Warning( + std::string&& _Warning) + { + m_Warning = std::move(_Warning); + } + + /*! + * @brief This function returns a constant reference to member Warning + * @return Constant reference to member Warning + */ + eProsima_user_DllExport const std::string& Warning() const + { + return m_Warning; + } + + /*! + * @brief This function returns a reference to member Warning + * @return Reference to member Warning + */ + eProsima_user_DllExport std::string& Warning() + { + return m_Warning; + } + + + +private: + + std::string m_CarNumber; + std::string m_Warning; + +}; +/*! + * @brief This class represents the structure BarCommandUpdate defined by the user in the IDL file. + * @ingroup System + */ +class BarCommandUpdate +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BarCommandUpdate() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BarCommandUpdate() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object BarCommandUpdate that will be copied. + */ + eProsima_user_DllExport BarCommandUpdate( + const BarCommandUpdate& x) + { + m_FrontBarSignalUp = x.m_FrontBarSignalUp; + + m_FrontBarSignalDown = x.m_FrontBarSignalDown; + + m_FrontBarEnable = x.m_FrontBarEnable; + + m_BackBarSignalUp = x.m_BackBarSignalUp; + + m_BackBarSignalDown = x.m_BackBarSignalDown; + + m_BackBarEnable = x.m_BackBarEnable; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object BarCommandUpdate that will be copied. + */ + eProsima_user_DllExport BarCommandUpdate( + BarCommandUpdate&& x) noexcept + { + m_FrontBarSignalUp = x.m_FrontBarSignalUp; + m_FrontBarSignalDown = x.m_FrontBarSignalDown; + m_FrontBarEnable = x.m_FrontBarEnable; + m_BackBarSignalUp = x.m_BackBarSignalUp; + m_BackBarSignalDown = x.m_BackBarSignalDown; + m_BackBarEnable = x.m_BackBarEnable; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object BarCommandUpdate that will be copied. + */ + eProsima_user_DllExport BarCommandUpdate& operator =( + const BarCommandUpdate& x) + { + + m_FrontBarSignalUp = x.m_FrontBarSignalUp; + + m_FrontBarSignalDown = x.m_FrontBarSignalDown; + + m_FrontBarEnable = x.m_FrontBarEnable; + + m_BackBarSignalUp = x.m_BackBarSignalUp; + + m_BackBarSignalDown = x.m_BackBarSignalDown; + + m_BackBarEnable = x.m_BackBarEnable; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object BarCommandUpdate that will be copied. + */ + eProsima_user_DllExport BarCommandUpdate& operator =( + BarCommandUpdate&& x) noexcept + { + + m_FrontBarSignalUp = x.m_FrontBarSignalUp; + m_FrontBarSignalDown = x.m_FrontBarSignalDown; + m_FrontBarEnable = x.m_FrontBarEnable; + m_BackBarSignalUp = x.m_BackBarSignalUp; + m_BackBarSignalDown = x.m_BackBarSignalDown; + m_BackBarEnable = x.m_BackBarEnable; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x BarCommandUpdate object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BarCommandUpdate& x) const + { + return (m_FrontBarSignalUp == x.m_FrontBarSignalUp && + m_FrontBarSignalDown == x.m_FrontBarSignalDown && + m_FrontBarEnable == x.m_FrontBarEnable && + m_BackBarSignalUp == x.m_BackBarSignalUp && + m_BackBarSignalDown == x.m_BackBarSignalDown && + m_BackBarEnable == x.m_BackBarEnable); + } + + /*! + * @brief Comparison operator. + * @param x BarCommandUpdate object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BarCommandUpdate& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member FrontBarSignalUp + * @param _FrontBarSignalUp New value for member FrontBarSignalUp + */ + eProsima_user_DllExport void FrontBarSignalUp( + int32_t _FrontBarSignalUp) + { + m_FrontBarSignalUp = _FrontBarSignalUp; + } + + /*! + * @brief This function returns the value of member FrontBarSignalUp + * @return Value of member FrontBarSignalUp + */ + eProsima_user_DllExport int32_t FrontBarSignalUp() const + { + return m_FrontBarSignalUp; + } + + /*! + * @brief This function returns a reference to member FrontBarSignalUp + * @return Reference to member FrontBarSignalUp + */ + eProsima_user_DllExport int32_t& FrontBarSignalUp() + { + return m_FrontBarSignalUp; + } + + + /*! + * @brief This function sets a value in member FrontBarSignalDown + * @param _FrontBarSignalDown New value for member FrontBarSignalDown + */ + eProsima_user_DllExport void FrontBarSignalDown( + int32_t _FrontBarSignalDown) + { + m_FrontBarSignalDown = _FrontBarSignalDown; + } + + /*! + * @brief This function returns the value of member FrontBarSignalDown + * @return Value of member FrontBarSignalDown + */ + eProsima_user_DllExport int32_t FrontBarSignalDown() const + { + return m_FrontBarSignalDown; + } + + /*! + * @brief This function returns a reference to member FrontBarSignalDown + * @return Reference to member FrontBarSignalDown + */ + eProsima_user_DllExport int32_t& FrontBarSignalDown() + { + return m_FrontBarSignalDown; + } + + + /*! + * @brief This function sets a value in member FrontBarEnable + * @param _FrontBarEnable New value for member FrontBarEnable + */ + eProsima_user_DllExport void FrontBarEnable( + bool _FrontBarEnable) + { + m_FrontBarEnable = _FrontBarEnable; + } + + /*! + * @brief This function returns the value of member FrontBarEnable + * @return Value of member FrontBarEnable + */ + eProsima_user_DllExport bool FrontBarEnable() const + { + return m_FrontBarEnable; + } + + /*! + * @brief This function returns a reference to member FrontBarEnable + * @return Reference to member FrontBarEnable + */ + eProsima_user_DllExport bool& FrontBarEnable() + { + return m_FrontBarEnable; + } + + + /*! + * @brief This function sets a value in member BackBarSignalUp + * @param _BackBarSignalUp New value for member BackBarSignalUp + */ + eProsima_user_DllExport void BackBarSignalUp( + int32_t _BackBarSignalUp) + { + m_BackBarSignalUp = _BackBarSignalUp; + } + + /*! + * @brief This function returns the value of member BackBarSignalUp + * @return Value of member BackBarSignalUp + */ + eProsima_user_DllExport int32_t BackBarSignalUp() const + { + return m_BackBarSignalUp; + } + + /*! + * @brief This function returns a reference to member BackBarSignalUp + * @return Reference to member BackBarSignalUp + */ + eProsima_user_DllExport int32_t& BackBarSignalUp() + { + return m_BackBarSignalUp; + } + + + /*! + * @brief This function sets a value in member BackBarSignalDown + * @param _BackBarSignalDown New value for member BackBarSignalDown + */ + eProsima_user_DllExport void BackBarSignalDown( + int32_t _BackBarSignalDown) + { + m_BackBarSignalDown = _BackBarSignalDown; + } + + /*! + * @brief This function returns the value of member BackBarSignalDown + * @return Value of member BackBarSignalDown + */ + eProsima_user_DllExport int32_t BackBarSignalDown() const + { + return m_BackBarSignalDown; + } + + /*! + * @brief This function returns a reference to member BackBarSignalDown + * @return Reference to member BackBarSignalDown + */ + eProsima_user_DllExport int32_t& BackBarSignalDown() + { + return m_BackBarSignalDown; + } + + + /*! + * @brief This function sets a value in member BackBarEnable + * @param _BackBarEnable New value for member BackBarEnable + */ + eProsima_user_DllExport void BackBarEnable( + bool _BackBarEnable) + { + m_BackBarEnable = _BackBarEnable; + } + + /*! + * @brief This function returns the value of member BackBarEnable + * @return Value of member BackBarEnable + */ + eProsima_user_DllExport bool BackBarEnable() const + { + return m_BackBarEnable; + } + + /*! + * @brief This function returns a reference to member BackBarEnable + * @return Reference to member BackBarEnable + */ + eProsima_user_DllExport bool& BackBarEnable() + { + return m_BackBarEnable; + } + + + +private: + + int32_t m_FrontBarSignalUp{0}; + int32_t m_FrontBarSignalDown{0}; + bool m_FrontBarEnable{false}; + int32_t m_BackBarSignalUp{0}; + int32_t m_BackBarSignalDown{0}; + bool m_BackBarEnable{false}; + +}; +/*! + * @brief This class represents the structure LightsCommandUpdate defined by the user in the IDL file. + * @ingroup System + */ +class LightsCommandUpdate +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LightsCommandUpdate() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LightsCommandUpdate() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object LightsCommandUpdate that will be copied. + */ + eProsima_user_DllExport LightsCommandUpdate( + const LightsCommandUpdate& x) + { + m_FrontLEDSignal = x.m_FrontLEDSignal; + + m_FrontLEDEnable = x.m_FrontLEDEnable; + + m_BackLEDSignal = x.m_BackLEDSignal; + + m_BackLEDEnable = x.m_BackLEDEnable; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object LightsCommandUpdate that will be copied. + */ + eProsima_user_DllExport LightsCommandUpdate( + LightsCommandUpdate&& x) noexcept + { + m_FrontLEDSignal = x.m_FrontLEDSignal; + m_FrontLEDEnable = x.m_FrontLEDEnable; + m_BackLEDSignal = x.m_BackLEDSignal; + m_BackLEDEnable = x.m_BackLEDEnable; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object LightsCommandUpdate that will be copied. + */ + eProsima_user_DllExport LightsCommandUpdate& operator =( + const LightsCommandUpdate& x) + { + + m_FrontLEDSignal = x.m_FrontLEDSignal; + + m_FrontLEDEnable = x.m_FrontLEDEnable; + + m_BackLEDSignal = x.m_BackLEDSignal; + + m_BackLEDEnable = x.m_BackLEDEnable; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object LightsCommandUpdate that will be copied. + */ + eProsima_user_DllExport LightsCommandUpdate& operator =( + LightsCommandUpdate&& x) noexcept + { + + m_FrontLEDSignal = x.m_FrontLEDSignal; + m_FrontLEDEnable = x.m_FrontLEDEnable; + m_BackLEDSignal = x.m_BackLEDSignal; + m_BackLEDEnable = x.m_BackLEDEnable; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x LightsCommandUpdate object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LightsCommandUpdate& x) const + { + return (m_FrontLEDSignal == x.m_FrontLEDSignal && + m_FrontLEDEnable == x.m_FrontLEDEnable && + m_BackLEDSignal == x.m_BackLEDSignal && + m_BackLEDEnable == x.m_BackLEDEnable); + } + + /*! + * @brief Comparison operator. + * @param x LightsCommandUpdate object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LightsCommandUpdate& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member FrontLEDSignal + * @param _FrontLEDSignal New value for member FrontLEDSignal + */ + eProsima_user_DllExport void FrontLEDSignal( + int32_t _FrontLEDSignal) + { + m_FrontLEDSignal = _FrontLEDSignal; + } + + /*! + * @brief This function returns the value of member FrontLEDSignal + * @return Value of member FrontLEDSignal + */ + eProsima_user_DllExport int32_t FrontLEDSignal() const + { + return m_FrontLEDSignal; + } + + /*! + * @brief This function returns a reference to member FrontLEDSignal + * @return Reference to member FrontLEDSignal + */ + eProsima_user_DllExport int32_t& FrontLEDSignal() + { + return m_FrontLEDSignal; + } + + + /*! + * @brief This function sets a value in member FrontLEDEnable + * @param _FrontLEDEnable New value for member FrontLEDEnable + */ + eProsima_user_DllExport void FrontLEDEnable( + bool _FrontLEDEnable) + { + m_FrontLEDEnable = _FrontLEDEnable; + } + + /*! + * @brief This function returns the value of member FrontLEDEnable + * @return Value of member FrontLEDEnable + */ + eProsima_user_DllExport bool FrontLEDEnable() const + { + return m_FrontLEDEnable; + } + + /*! + * @brief This function returns a reference to member FrontLEDEnable + * @return Reference to member FrontLEDEnable + */ + eProsima_user_DllExport bool& FrontLEDEnable() + { + return m_FrontLEDEnable; + } + + + /*! + * @brief This function sets a value in member BackLEDSignal + * @param _BackLEDSignal New value for member BackLEDSignal + */ + eProsima_user_DllExport void BackLEDSignal( + int32_t _BackLEDSignal) + { + m_BackLEDSignal = _BackLEDSignal; + } + + /*! + * @brief This function returns the value of member BackLEDSignal + * @return Value of member BackLEDSignal + */ + eProsima_user_DllExport int32_t BackLEDSignal() const + { + return m_BackLEDSignal; + } + + /*! + * @brief This function returns a reference to member BackLEDSignal + * @return Reference to member BackLEDSignal + */ + eProsima_user_DllExport int32_t& BackLEDSignal() + { + return m_BackLEDSignal; + } + + + /*! + * @brief This function sets a value in member BackLEDEnable + * @param _BackLEDEnable New value for member BackLEDEnable + */ + eProsima_user_DllExport void BackLEDEnable( + int32_t _BackLEDEnable) + { + m_BackLEDEnable = _BackLEDEnable; + } + + /*! + * @brief This function returns the value of member BackLEDEnable + * @return Value of member BackLEDEnable + */ + eProsima_user_DllExport int32_t BackLEDEnable() const + { + return m_BackLEDEnable; + } + + /*! + * @brief This function returns a reference to member BackLEDEnable + * @return Reference to member BackLEDEnable + */ + eProsima_user_DllExport int32_t& BackLEDEnable() + { + return m_BackLEDEnable; + } + + + +private: + int32_t m_FrontLEDSignal{0}; + bool m_FrontLEDEnable{false}; + int32_t m_BackLEDSignal{0}; + int32_t m_BackLEDEnable{0}; + +}; /*! - * @brief This class represents the structure LicencePlateReq defined by the user in the IDL file. + * @brief This class represents the structure InfraredCommandUpdate defined by the user in the IDL file. * @ingroup System */ -class LicencePlateReq +class InfraredCommandUpdate { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport LicencePlateReq() + eProsima_user_DllExport InfraredCommandUpdate() { } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~LicencePlateReq() + eProsima_user_DllExport ~InfraredCommandUpdate() { } /*! * @brief Copy constructor. - * @param x Reference to the object LicencePlateReq that will be copied. + * @param x Reference to the object InfraredCommandUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateReq( - const LicencePlateReq& x) + eProsima_user_DllExport InfraredCommandUpdate( + const InfraredCommandUpdate& x) { - m_index = x.m_index; + m_FrontResistanceUnLock = x.m_FrontResistanceUnLock; - m_msg = x.m_msg; + m_FrontResistanceEnable = x.m_FrontResistanceEnable; + + m_BackResistanceUnLock = x.m_BackResistanceUnLock; + + m_BackResistanceEnable = x.m_BackResistanceEnable; } /*! * @brief Move constructor. - * @param x Reference to the object LicencePlateReq that will be copied. + * @param x Reference to the object InfraredCommandUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateReq( - LicencePlateReq&& x) noexcept + eProsima_user_DllExport InfraredCommandUpdate( + InfraredCommandUpdate&& x) noexcept { - m_index = x.m_index; - m_msg = std::move(x.m_msg); + m_FrontResistanceUnLock = x.m_FrontResistanceUnLock; + m_FrontResistanceEnable = x.m_FrontResistanceEnable; + m_BackResistanceUnLock = x.m_BackResistanceUnLock; + m_BackResistanceEnable = x.m_BackResistanceEnable; } /*! * @brief Copy assignment. - * @param x Reference to the object LicencePlateReq that will be copied. + * @param x Reference to the object InfraredCommandUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateReq& operator =( - const LicencePlateReq& x) + eProsima_user_DllExport InfraredCommandUpdate& operator =( + const InfraredCommandUpdate& x) { - m_index = x.m_index; + m_FrontResistanceUnLock = x.m_FrontResistanceUnLock; - m_msg = x.m_msg; + m_FrontResistanceEnable = x.m_FrontResistanceEnable; + + m_BackResistanceUnLock = x.m_BackResistanceUnLock; + + m_BackResistanceEnable = x.m_BackResistanceEnable; return *this; } /*! * @brief Move assignment. - * @param x Reference to the object LicencePlateReq that will be copied. + * @param x Reference to the object InfraredCommandUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateReq& operator =( - LicencePlateReq&& x) noexcept + eProsima_user_DllExport InfraredCommandUpdate& operator =( + InfraredCommandUpdate&& x) noexcept { - m_index = x.m_index; - m_msg = std::move(x.m_msg); + m_FrontResistanceUnLock = x.m_FrontResistanceUnLock; + m_FrontResistanceEnable = x.m_FrontResistanceEnable; + m_BackResistanceUnLock = x.m_BackResistanceUnLock; + m_BackResistanceEnable = x.m_BackResistanceEnable; return *this; } /*! * @brief Comparison operator. - * @param x LicencePlateReq object to compare. + * @param x InfraredCommandUpdate object to compare. */ eProsima_user_DllExport bool operator ==( - const LicencePlateReq& x) const + const InfraredCommandUpdate& x) const { - return (m_index == x.m_index && - m_msg == x.m_msg); + return (m_FrontResistanceUnLock == x.m_FrontResistanceUnLock && + m_FrontResistanceEnable == x.m_FrontResistanceEnable && + m_BackResistanceUnLock == x.m_BackResistanceUnLock && + m_BackResistanceEnable == x.m_BackResistanceEnable); } /*! * @brief Comparison operator. - * @param x LicencePlateReq object to compare. + * @param x InfraredCommandUpdate object to compare. */ eProsima_user_DllExport bool operator !=( - const LicencePlateReq& x) const + const InfraredCommandUpdate& x) const { return !(*this == x); } /*! - * @brief This function sets a value in member index - * @param _index New value for member index + * @brief This function sets a value in member FrontResistanceUnLock + * @param _FrontResistanceUnLock New value for member FrontResistanceUnLock */ - eProsima_user_DllExport void index( - uint32_t _index) + eProsima_user_DllExport void FrontResistanceUnLock( + int32_t _FrontResistanceUnLock) { - m_index = _index; + m_FrontResistanceUnLock = _FrontResistanceUnLock; } /*! - * @brief This function returns the value of member index - * @return Value of member index + * @brief This function returns the value of member FrontResistanceUnLock + * @return Value of member FrontResistanceUnLock */ - eProsima_user_DllExport uint32_t index() const + eProsima_user_DllExport int32_t FrontResistanceUnLock() const { - return m_index; + return m_FrontResistanceUnLock; + } + + /*! + * @brief This function returns a reference to member FrontResistanceUnLock + * @return Reference to member FrontResistanceUnLock + */ + eProsima_user_DllExport int32_t& FrontResistanceUnLock() + { + return m_FrontResistanceUnLock; + } + + + /*! + * @brief This function sets a value in member FrontResistanceEnable + * @param _FrontResistanceEnable New value for member FrontResistanceEnable + */ + eProsima_user_DllExport void FrontResistanceEnable( + bool _FrontResistanceEnable) + { + m_FrontResistanceEnable = _FrontResistanceEnable; + } + + /*! + * @brief This function returns the value of member FrontResistanceEnable + * @return Value of member FrontResistanceEnable + */ + eProsima_user_DllExport bool FrontResistanceEnable() const + { + return m_FrontResistanceEnable; + } + + /*! + * @brief This function returns a reference to member FrontResistanceEnable + * @return Reference to member FrontResistanceEnable + */ + eProsima_user_DllExport bool& FrontResistanceEnable() + { + return m_FrontResistanceEnable; + } + + + /*! + * @brief This function sets a value in member BackResistanceUnLock + * @param _BackResistanceUnLock New value for member BackResistanceUnLock + */ + eProsima_user_DllExport void BackResistanceUnLock( + int32_t _BackResistanceUnLock) + { + m_BackResistanceUnLock = _BackResistanceUnLock; + } + + /*! + * @brief This function returns the value of member BackResistanceUnLock + * @return Value of member BackResistanceUnLock + */ + eProsima_user_DllExport int32_t BackResistanceUnLock() const + { + return m_BackResistanceUnLock; + } + + /*! + * @brief This function returns a reference to member BackResistanceUnLock + * @return Reference to member BackResistanceUnLock + */ + eProsima_user_DllExport int32_t& BackResistanceUnLock() + { + return m_BackResistanceUnLock; + } + + + /*! + * @brief This function sets a value in member BackResistanceEnable + * @param _BackResistanceEnable New value for member BackResistanceEnable + */ + eProsima_user_DllExport void BackResistanceEnable( + bool _BackResistanceEnable) + { + m_BackResistanceEnable = _BackResistanceEnable; + } + + /*! + * @brief This function returns the value of member BackResistanceEnable + * @return Value of member BackResistanceEnable + */ + eProsima_user_DllExport bool BackResistanceEnable() const + { + return m_BackResistanceEnable; + } + + /*! + * @brief This function returns a reference to member BackResistanceEnable + * @return Reference to member BackResistanceEnable + */ + eProsima_user_DllExport bool& BackResistanceEnable() + { + return m_BackResistanceEnable; + } + + + +private: + + int32_t m_FrontResistanceUnLock{0}; + bool m_FrontResistanceEnable{false}; + int32_t m_BackResistanceUnLock{0}; + bool m_BackResistanceEnable{false}; + +}; +/*! + * @brief This class represents the structure BarUpdate defined by the user in the IDL file. + * @ingroup System + */ +class BarUpdate +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport BarUpdate() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~BarUpdate() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object BarUpdate that will be copied. + */ + eProsima_user_DllExport BarUpdate( + const BarUpdate& x) + { + m_FrontBarState = x.m_FrontBarState; + + m_BackBarState = x.m_BackBarState; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object BarUpdate that will be copied. + */ + eProsima_user_DllExport BarUpdate( + BarUpdate&& x) noexcept + { + m_FrontBarState = x.m_FrontBarState; + m_BackBarState = x.m_BackBarState; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object BarUpdate that will be copied. + */ + eProsima_user_DllExport BarUpdate& operator =( + const BarUpdate& x) + { + + m_FrontBarState = x.m_FrontBarState; + + m_BackBarState = x.m_BackBarState; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object BarUpdate that will be copied. + */ + eProsima_user_DllExport BarUpdate& operator =( + BarUpdate&& x) noexcept + { + + m_FrontBarState = x.m_FrontBarState; + m_BackBarState = x.m_BackBarState; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x BarUpdate object to compare. + */ + eProsima_user_DllExport bool operator ==( + const BarUpdate& x) const + { + return (m_FrontBarState == x.m_FrontBarState && + m_BackBarState == x.m_BackBarState); + } + + /*! + * @brief Comparison operator. + * @param x BarUpdate object to compare. + */ + eProsima_user_DllExport bool operator !=( + const BarUpdate& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member FrontBarState + * @param _FrontBarState New value for member FrontBarState + */ + eProsima_user_DllExport void FrontBarState( + int32_t _FrontBarState) + { + m_FrontBarState = _FrontBarState; + } + + /*! + * @brief This function returns the value of member FrontBarState + * @return Value of member FrontBarState + */ + eProsima_user_DllExport int32_t FrontBarState() const + { + return m_FrontBarState; + } + + /*! + * @brief This function returns a reference to member FrontBarState + * @return Reference to member FrontBarState + */ + eProsima_user_DllExport int32_t& FrontBarState() + { + return m_FrontBarState; + } + + + /*! + * @brief This function sets a value in member BackBarState + * @param _BackBarState New value for member BackBarState + */ + eProsima_user_DllExport void BackBarState( + int32_t _BackBarState) + { + m_BackBarState = _BackBarState; + } + + /*! + * @brief This function returns the value of member BackBarState + * @return Value of member BackBarState + */ + eProsima_user_DllExport int32_t BackBarState() const + { + return m_BackBarState; + } + + /*! + * @brief This function returns a reference to member BackBarState + * @return Reference to member BackBarState + */ + eProsima_user_DllExport int32_t& BackBarState() + { + return m_BackBarState; + } + + + +private: + + int32_t m_FrontBarState{0}; + int32_t m_BackBarState{0}; + +}; +/*! + * @brief This class represents the structure LightsUpdate defined by the user in the IDL file. + * @ingroup System + */ +class LightsUpdate +{ +public: + + /*! + * @brief Default constructor. + */ + eProsima_user_DllExport LightsUpdate() + { + } + + /*! + * @brief Default destructor. + */ + eProsima_user_DllExport ~LightsUpdate() + { + } + + /*! + * @brief Copy constructor. + * @param x Reference to the object LightsUpdate that will be copied. + */ + eProsima_user_DllExport LightsUpdate( + const LightsUpdate& x) + { + m_FrontLEDState = x.m_FrontLEDState; + + m_BackLEDState = x.m_BackLEDState; + + } + + /*! + * @brief Move constructor. + * @param x Reference to the object LightsUpdate that will be copied. + */ + eProsima_user_DllExport LightsUpdate( + LightsUpdate&& x) noexcept + { + m_FrontLEDState = x.m_FrontLEDState; + m_BackLEDState = x.m_BackLEDState; + } + + /*! + * @brief Copy assignment. + * @param x Reference to the object LightsUpdate that will be copied. + */ + eProsima_user_DllExport LightsUpdate& operator =( + const LightsUpdate& x) + { + + m_FrontLEDState = x.m_FrontLEDState; + + m_BackLEDState = x.m_BackLEDState; + + return *this; + } + + /*! + * @brief Move assignment. + * @param x Reference to the object LightsUpdate that will be copied. + */ + eProsima_user_DllExport LightsUpdate& operator =( + LightsUpdate&& x) noexcept + { + + m_FrontLEDState = x.m_FrontLEDState; + m_BackLEDState = x.m_BackLEDState; + return *this; + } + + /*! + * @brief Comparison operator. + * @param x LightsUpdate object to compare. + */ + eProsima_user_DllExport bool operator ==( + const LightsUpdate& x) const + { + return (m_FrontLEDState == x.m_FrontLEDState && + m_BackLEDState == x.m_BackLEDState); + } + + /*! + * @brief Comparison operator. + * @param x LightsUpdate object to compare. + */ + eProsima_user_DllExport bool operator !=( + const LightsUpdate& x) const + { + return !(*this == x); + } + + /*! + * @brief This function sets a value in member FrontLEDState + * @param _FrontLEDState New value for member FrontLEDState + */ + eProsima_user_DllExport void FrontLEDState( + int32_t _FrontLEDState) + { + m_FrontLEDState = _FrontLEDState; } /*! - * @brief This function returns a reference to member index - * @return Reference to member index + * @brief This function returns the value of member FrontLEDState + * @return Value of member FrontLEDState */ - eProsima_user_DllExport uint32_t& index() + eProsima_user_DllExport int32_t FrontLEDState() const { - return m_index; + return m_FrontLEDState; } - /*! - * @brief This function copies the value in member msg - * @param _msg New value to be copied in member msg + * @brief This function returns a reference to member FrontLEDState + * @return Reference to member FrontLEDState */ - eProsima_user_DllExport void msg( - const std::map& _msg) + eProsima_user_DllExport int32_t& FrontLEDState() { - m_msg = _msg; + return m_FrontLEDState; } + /*! - * @brief This function moves the value in member msg - * @param _msg New value to be moved in member msg + * @brief This function sets a value in member BackLEDState + * @param _BackLEDState New value for member BackLEDState */ - eProsima_user_DllExport void msg( - std::map&& _msg) + eProsima_user_DllExport void BackLEDState( + int32_t _BackLEDState) { - m_msg = std::move(_msg); + m_BackLEDState = _BackLEDState; } /*! - * @brief This function returns a constant reference to member msg - * @return Constant reference to member msg + * @brief This function returns the value of member BackLEDState + * @return Value of member BackLEDState */ - eProsima_user_DllExport const std::map& msg() const + eProsima_user_DllExport int32_t BackLEDState() const { - return m_msg; + return m_BackLEDState; } /*! - * @brief This function returns a reference to member msg - * @return Reference to member msg + * @brief This function returns a reference to member BackLEDState + * @return Reference to member BackLEDState */ - eProsima_user_DllExport std::map& msg() + eProsima_user_DllExport int32_t& BackLEDState() { - return m_msg; + return m_BackLEDState; } private: - uint32_t m_index{0}; - std::map m_msg; + int32_t m_FrontLEDState{0}; + int32_t m_BackLEDState{0}; }; /*! - * @brief This class represents the structure LicencePlateRsp defined by the user in the IDL file. + * @brief This class represents the structure InfraredUpdate defined by the user in the IDL file. * @ingroup System */ -class LicencePlateRsp +class InfraredUpdate { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport LicencePlateRsp() + eProsima_user_DllExport InfraredUpdate() { } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~LicencePlateRsp() + eProsima_user_DllExport ~InfraredUpdate() { } /*! * @brief Copy constructor. - * @param x Reference to the object LicencePlateRsp that will be copied. + * @param x Reference to the object InfraredUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateRsp( - const LicencePlateRsp& x) + eProsima_user_DllExport InfraredUpdate( + const InfraredUpdate& x) { - m_index = x.m_index; + m_FrontResistanceSignal = x.m_FrontResistanceSignal; - m_licence = x.m_licence; + m_BackResistanceSignal = x.m_BackResistanceSignal; } /*! * @brief Move constructor. - * @param x Reference to the object LicencePlateRsp that will be copied. + * @param x Reference to the object InfraredUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateRsp( - LicencePlateRsp&& x) noexcept + eProsima_user_DllExport InfraredUpdate( + InfraredUpdate&& x) noexcept { - m_index = x.m_index; - m_licence = std::move(x.m_licence); + m_FrontResistanceSignal = x.m_FrontResistanceSignal; + m_BackResistanceSignal = x.m_BackResistanceSignal; } /*! * @brief Copy assignment. - * @param x Reference to the object LicencePlateRsp that will be copied. + * @param x Reference to the object InfraredUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateRsp& operator =( - const LicencePlateRsp& x) + eProsima_user_DllExport InfraredUpdate& operator =( + const InfraredUpdate& x) { - m_index = x.m_index; + m_FrontResistanceSignal = x.m_FrontResistanceSignal; - m_licence = x.m_licence; + m_BackResistanceSignal = x.m_BackResistanceSignal; return *this; } /*! * @brief Move assignment. - * @param x Reference to the object LicencePlateRsp that will be copied. + * @param x Reference to the object InfraredUpdate that will be copied. */ - eProsima_user_DllExport LicencePlateRsp& operator =( - LicencePlateRsp&& x) noexcept + eProsima_user_DllExport InfraredUpdate& operator =( + InfraredUpdate&& x) noexcept { - m_index = x.m_index; - m_licence = std::move(x.m_licence); + m_FrontResistanceSignal = x.m_FrontResistanceSignal; + m_BackResistanceSignal = x.m_BackResistanceSignal; return *this; } /*! * @brief Comparison operator. - * @param x LicencePlateRsp object to compare. + * @param x InfraredUpdate object to compare. */ eProsima_user_DllExport bool operator ==( - const LicencePlateRsp& x) const + const InfraredUpdate& x) const { - return (m_index == x.m_index && - m_licence == x.m_licence); + return (m_FrontResistanceSignal == x.m_FrontResistanceSignal && + m_BackResistanceSignal == x.m_BackResistanceSignal); } /*! * @brief Comparison operator. - * @param x LicencePlateRsp object to compare. + * @param x InfraredUpdate object to compare. */ eProsima_user_DllExport bool operator !=( - const LicencePlateRsp& x) const + const InfraredUpdate& x) const { return !(*this == x); } /*! - * @brief This function sets a value in member index - * @param _index New value for member index + * @brief This function sets a value in member FrontResistanceSignal + * @param _FrontResistanceSignal New value for member FrontResistanceSignal */ - eProsima_user_DllExport void index( - uint32_t _index) + eProsima_user_DllExport void FrontResistanceSignal( + int32_t _FrontResistanceSignal) { - m_index = _index; + m_FrontResistanceSignal = _FrontResistanceSignal; } /*! - * @brief This function returns the value of member index - * @return Value of member index + * @brief This function returns the value of member FrontResistanceSignal + * @return Value of member FrontResistanceSignal */ - eProsima_user_DllExport uint32_t index() const + eProsima_user_DllExport int32_t FrontResistanceSignal() const { - return m_index; + return m_FrontResistanceSignal; } /*! - * @brief This function returns a reference to member index - * @return Reference to member index + * @brief This function returns a reference to member FrontResistanceSignal + * @return Reference to member FrontResistanceSignal */ - eProsima_user_DllExport uint32_t& index() + eProsima_user_DllExport int32_t& FrontResistanceSignal() { - return m_index; + return m_FrontResistanceSignal; } /*! - * @brief This function copies the value in member licence - * @param _licence New value to be copied in member licence - */ - eProsima_user_DllExport void licence( - const std::string& _licence) - { - m_licence = _licence; - } - - /*! - * @brief This function moves the value in member licence - * @param _licence New value to be moved in member licence + * @brief This function sets a value in member BackResistanceSignal + * @param _BackResistanceSignal New value for member BackResistanceSignal */ - eProsima_user_DllExport void licence( - std::string&& _licence) + eProsima_user_DllExport void BackResistanceSignal( + int32_t _BackResistanceSignal) { - m_licence = std::move(_licence); + m_BackResistanceSignal = _BackResistanceSignal; } /*! - * @brief This function returns a constant reference to member licence - * @return Constant reference to member licence + * @brief This function returns the value of member BackResistanceSignal + * @return Value of member BackResistanceSignal */ - eProsima_user_DllExport const std::string& licence() const + eProsima_user_DllExport int32_t BackResistanceSignal() const { - return m_licence; + return m_BackResistanceSignal; } /*! - * @brief This function returns a reference to member licence - * @return Reference to member licence + * @brief This function returns a reference to member BackResistanceSignal + * @return Reference to member BackResistanceSignal */ - eProsima_user_DllExport std::string& licence() + eProsima_user_DllExport int32_t& BackResistanceSignal() { - return m_licence; + return m_BackResistanceSignal; } private: - uint32_t m_index{0}; - std::string m_licence; + int32_t m_FrontResistanceSignal{0}; + int32_t m_BackResistanceSignal{0}; }; /*! - * @brief This class represents the structure PrintReq defined by the user in the IDL file. + * @brief This class represents the structure LicenseSnapUpdate defined by the user in the IDL file. * @ingroup System */ -class PrintReq +class LicenseSnapUpdate { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport PrintReq() + eProsima_user_DllExport LicenseSnapUpdate() { } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~PrintReq() + eProsima_user_DllExport ~LicenseSnapUpdate() { } /*! * @brief Copy constructor. - * @param x Reference to the object PrintReq that will be copied. + * @param x Reference to the object LicenseSnapUpdate that will be copied. */ - eProsima_user_DllExport PrintReq( - const PrintReq& x) + eProsima_user_DllExport LicenseSnapUpdate( + const LicenseSnapUpdate& x) { - m_index = x.m_index; + m_NewTag = x.m_NewTag; - m_msg = x.m_msg; + m_License = x.m_License; } /*! * @brief Move constructor. - * @param x Reference to the object PrintReq that will be copied. + * @param x Reference to the object LicenseSnapUpdate that will be copied. */ - eProsima_user_DllExport PrintReq( - PrintReq&& x) noexcept + eProsima_user_DllExport LicenseSnapUpdate( + LicenseSnapUpdate&& x) noexcept { - m_index = x.m_index; - m_msg = std::move(x.m_msg); + m_NewTag = x.m_NewTag; + m_License = std::move(x.m_License); } /*! * @brief Copy assignment. - * @param x Reference to the object PrintReq that will be copied. + * @param x Reference to the object LicenseSnapUpdate that will be copied. */ - eProsima_user_DllExport PrintReq& operator =( - const PrintReq& x) + eProsima_user_DllExport LicenseSnapUpdate& operator =( + const LicenseSnapUpdate& x) { - m_index = x.m_index; + m_NewTag = x.m_NewTag; - m_msg = x.m_msg; + m_License = x.m_License; return *this; } /*! * @brief Move assignment. - * @param x Reference to the object PrintReq that will be copied. + * @param x Reference to the object LicenseSnapUpdate that will be copied. */ - eProsima_user_DllExport PrintReq& operator =( - PrintReq&& x) noexcept + eProsima_user_DllExport LicenseSnapUpdate& operator =( + LicenseSnapUpdate&& x) noexcept { - m_index = x.m_index; - m_msg = std::move(x.m_msg); + m_NewTag = x.m_NewTag; + m_License = std::move(x.m_License); return *this; } /*! * @brief Comparison operator. - * @param x PrintReq object to compare. + * @param x LicenseSnapUpdate object to compare. */ eProsima_user_DllExport bool operator ==( - const PrintReq& x) const + const LicenseSnapUpdate& x) const { - return (m_index == x.m_index && - m_msg == x.m_msg); + return (m_NewTag == x.m_NewTag && + m_License == x.m_License); } /*! * @brief Comparison operator. - * @param x PrintReq object to compare. + * @param x LicenseSnapUpdate object to compare. */ eProsima_user_DllExport bool operator !=( - const PrintReq& x) const + const LicenseSnapUpdate& x) const { return !(*this == x); } /*! - * @brief This function sets a value in member index - * @param _index New value for member index + * @brief This function sets a value in member NewTag + * @param _NewTag New value for member NewTag */ - eProsima_user_DllExport void index( - uint32_t _index) + eProsima_user_DllExport void NewTag( + int32_t _NewTag) { - m_index = _index; + m_NewTag = _NewTag; } /*! - * @brief This function returns the value of member index - * @return Value of member index + * @brief This function returns the value of member NewTag + * @return Value of member NewTag */ - eProsima_user_DllExport uint32_t index() const + eProsima_user_DllExport int32_t NewTag() const { - return m_index; + return m_NewTag; } /*! - * @brief This function returns a reference to member index - * @return Reference to member index + * @brief This function returns a reference to member NewTag + * @return Reference to member NewTag */ - eProsima_user_DllExport uint32_t& index() + eProsima_user_DllExport int32_t& NewTag() { - return m_index; + return m_NewTag; } /*! - * @brief This function copies the value in member msg - * @param _msg New value to be copied in member msg + * @brief This function copies the value in member License + * @param _License New value to be copied in member License */ - eProsima_user_DllExport void msg( - const std::map& _msg) + eProsima_user_DllExport void License( + const std::string& _License) { - m_msg = _msg; + m_License = _License; } /*! - * @brief This function moves the value in member msg - * @param _msg New value to be moved in member msg + * @brief This function moves the value in member License + * @param _License New value to be moved in member License */ - eProsima_user_DllExport void msg( - std::map&& _msg) + eProsima_user_DllExport void License( + std::string&& _License) { - m_msg = std::move(_msg); + m_License = std::move(_License); } /*! - * @brief This function returns a constant reference to member msg - * @return Constant reference to member msg + * @brief This function returns a constant reference to member License + * @return Constant reference to member License */ - eProsima_user_DllExport const std::map& msg() const + eProsima_user_DllExport const std::string& License() const { - return m_msg; + return m_License; } /*! - * @brief This function returns a reference to member msg - * @return Reference to member msg + * @brief This function returns a reference to member License + * @return Reference to member License */ - eProsima_user_DllExport std::map& msg() + eProsima_user_DllExport std::string& License() { - return m_msg; + return m_License; } private: - uint32_t m_index{0}; - std::map m_msg; + int32_t m_NewTag{0}; + std::string m_License; }; /*! - * @brief This class represents the structure PrintRsp defined by the user in the IDL file. + * @brief This class represents the structure Voice defined by the user in the IDL file. * @ingroup System */ -class PrintRsp +class Voice { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport PrintRsp() + eProsima_user_DllExport Voice() { } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~PrintRsp() + eProsima_user_DllExport ~Voice() { } /*! * @brief Copy constructor. - * @param x Reference to the object PrintRsp that will be copied. + * @param x Reference to the object Voice that will be copied. */ - eProsima_user_DllExport PrintRsp( - const PrintRsp& x) + eProsima_user_DllExport Voice( + const Voice& x) { - m_index = x.m_index; + m_VoiceID = x.m_VoiceID; - m_msg = x.m_msg; + m_VoiceContent = x.m_VoiceContent; } /*! * @brief Move constructor. - * @param x Reference to the object PrintRsp that will be copied. + * @param x Reference to the object Voice that will be copied. */ - eProsima_user_DllExport PrintRsp( - PrintRsp&& x) noexcept + eProsima_user_DllExport Voice( + Voice&& x) noexcept { - m_index = x.m_index; - m_msg = std::move(x.m_msg); + m_VoiceID = x.m_VoiceID; + m_VoiceContent = std::move(x.m_VoiceContent); } /*! * @brief Copy assignment. - * @param x Reference to the object PrintRsp that will be copied. + * @param x Reference to the object Voice that will be copied. */ - eProsima_user_DllExport PrintRsp& operator =( - const PrintRsp& x) + eProsima_user_DllExport Voice& operator =( + const Voice& x) { - m_index = x.m_index; + m_VoiceID = x.m_VoiceID; - m_msg = x.m_msg; + m_VoiceContent = x.m_VoiceContent; return *this; } /*! * @brief Move assignment. - * @param x Reference to the object PrintRsp that will be copied. + * @param x Reference to the object Voice that will be copied. */ - eProsima_user_DllExport PrintRsp& operator =( - PrintRsp&& x) noexcept + eProsima_user_DllExport Voice& operator =( + Voice&& x) noexcept { - m_index = x.m_index; - m_msg = std::move(x.m_msg); + m_VoiceID = x.m_VoiceID; + m_VoiceContent = std::move(x.m_VoiceContent); return *this; } /*! * @brief Comparison operator. - * @param x PrintRsp object to compare. + * @param x Voice object to compare. */ eProsima_user_DllExport bool operator ==( - const PrintRsp& x) const + const Voice& x) const { - return (m_index == x.m_index && - m_msg == x.m_msg); + return (m_VoiceID == x.m_VoiceID && + m_VoiceContent == x.m_VoiceContent); } /*! * @brief Comparison operator. - * @param x PrintRsp object to compare. + * @param x Voice object to compare. */ eProsima_user_DllExport bool operator !=( - const PrintRsp& x) const + const Voice& x) const { return !(*this == x); } /*! - * @brief This function sets a value in member index - * @param _index New value for member index + * @brief This function sets a value in member VoiceID + * @param _VoiceID New value for member VoiceID */ - eProsima_user_DllExport void index( - uint32_t _index) + eProsima_user_DllExport void VoiceID( + int32_t _VoiceID) { - m_index = _index; + m_VoiceID = _VoiceID; } /*! - * @brief This function returns the value of member index - * @return Value of member index + * @brief This function returns the value of member VoiceID + * @return Value of member VoiceID */ - eProsima_user_DllExport uint32_t index() const + eProsima_user_DllExport int32_t VoiceID() const { - return m_index; + return m_VoiceID; } /*! - * @brief This function returns a reference to member index - * @return Reference to member index + * @brief This function returns a reference to member VoiceID + * @return Reference to member VoiceID */ - eProsima_user_DllExport uint32_t& index() + eProsima_user_DllExport int32_t& VoiceID() { - return m_index; + return m_VoiceID; } /*! - * @brief This function copies the value in member msg - * @param _msg New value to be copied in member msg + * @brief This function copies the value in member VoiceContent + * @param _VoiceContent New value to be copied in member VoiceContent */ - eProsima_user_DllExport void msg( - const std::string& _msg) + eProsima_user_DllExport void VoiceContent( + const std::string& _VoiceContent) { - m_msg = _msg; + m_VoiceContent = _VoiceContent; } /*! - * @brief This function moves the value in member msg - * @param _msg New value to be moved in member msg + * @brief This function moves the value in member VoiceContent + * @param _VoiceContent New value to be moved in member VoiceContent */ - eProsima_user_DllExport void msg( - std::string&& _msg) + eProsima_user_DllExport void VoiceContent( + std::string&& _VoiceContent) { - m_msg = std::move(_msg); + m_VoiceContent = std::move(_VoiceContent); } /*! - * @brief This function returns a constant reference to member msg - * @return Constant reference to member msg + * @brief This function returns a constant reference to member VoiceContent + * @return Constant reference to member VoiceContent */ - eProsima_user_DllExport const std::string& msg() const + eProsima_user_DllExport const std::string& VoiceContent() const { - return m_msg; + return m_VoiceContent; } /*! - * @brief This function returns a reference to member msg - * @return Reference to member msg + * @brief This function returns a reference to member VoiceContent + * @return Reference to member VoiceContent */ - eProsima_user_DllExport std::string& msg() + eProsima_user_DllExport std::string& VoiceContent() { - return m_msg; + return m_VoiceContent; } private: - uint32_t m_index{0}; - std::string m_msg; + int32_t m_VoiceID{0}; + std::string m_VoiceContent; }; + +} // namespace WeighingSystem +namespace InternalSystem { + /*! - * @brief This class represents the structure WeighReq defined by the user in the IDL file. + * @brief This class represents the structure PrintReq defined by the user in the IDL file. * @ingroup System */ -class WeighReq +class PrintReq { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport WeighReq() + eProsima_user_DllExport PrintReq() { } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~WeighReq() + eProsima_user_DllExport ~PrintReq() { } /*! * @brief Copy constructor. - * @param x Reference to the object WeighReq that will be copied. + * @param x Reference to the object PrintReq that will be copied. */ - eProsima_user_DllExport WeighReq( - const WeighReq& x) + eProsima_user_DllExport PrintReq( + const PrintReq& x) { m_index = x.m_index; @@ -771,10 +3352,10 @@ public: /*! * @brief Move constructor. - * @param x Reference to the object WeighReq that will be copied. + * @param x Reference to the object PrintReq that will be copied. */ - eProsima_user_DllExport WeighReq( - WeighReq&& x) noexcept + eProsima_user_DllExport PrintReq( + PrintReq&& x) noexcept { m_index = x.m_index; m_msg = std::move(x.m_msg); @@ -782,10 +3363,10 @@ public: /*! * @brief Copy assignment. - * @param x Reference to the object WeighReq that will be copied. + * @param x Reference to the object PrintReq that will be copied. */ - eProsima_user_DllExport WeighReq& operator =( - const WeighReq& x) + eProsima_user_DllExport PrintReq& operator =( + const PrintReq& x) { m_index = x.m_index; @@ -797,10 +3378,10 @@ public: /*! * @brief Move assignment. - * @param x Reference to the object WeighReq that will be copied. + * @param x Reference to the object PrintReq that will be copied. */ - eProsima_user_DllExport WeighReq& operator =( - WeighReq&& x) noexcept + eProsima_user_DllExport PrintReq& operator =( + PrintReq&& x) noexcept { m_index = x.m_index; @@ -810,10 +3391,10 @@ public: /*! * @brief Comparison operator. - * @param x WeighReq object to compare. + * @param x PrintReq object to compare. */ eProsima_user_DllExport bool operator ==( - const WeighReq& x) const + const PrintReq& x) const { return (m_index == x.m_index && m_msg == x.m_msg); @@ -821,10 +3402,10 @@ public: /*! * @brief Comparison operator. - * @param x WeighReq object to compare. + * @param x PrintReq object to compare. */ eProsima_user_DllExport bool operator !=( - const WeighReq& x) const + const PrintReq& x) const { return !(*this == x); } @@ -905,103 +3486,96 @@ private: }; /*! - * @brief This class represents the structure WeighRsp defined by the user in the IDL file. + * @brief This class represents the structure PrintRsp defined by the user in the IDL file. * @ingroup System */ -class WeighRsp +class PrintRsp { public: /*! * @brief Default constructor. */ - eProsima_user_DllExport WeighRsp() + eProsima_user_DllExport PrintRsp() { } /*! * @brief Default destructor. */ - eProsima_user_DllExport ~WeighRsp() + eProsima_user_DllExport ~PrintRsp() { } /*! * @brief Copy constructor. - * @param x Reference to the object WeighRsp that will be copied. + * @param x Reference to the object PrintRsp that will be copied. */ - eProsima_user_DllExport WeighRsp( - const WeighRsp& x) + eProsima_user_DllExport PrintRsp( + const PrintRsp& x) { m_index = x.m_index; - m_stable_weight = x.m_stable_weight; - - m_instantaneous_weight = x.m_instantaneous_weight; + m_msg = x.m_msg; } /*! * @brief Move constructor. - * @param x Reference to the object WeighRsp that will be copied. + * @param x Reference to the object PrintRsp that will be copied. */ - eProsima_user_DllExport WeighRsp( - WeighRsp&& x) noexcept + eProsima_user_DllExport PrintRsp( + PrintRsp&& x) noexcept { m_index = x.m_index; - m_stable_weight = x.m_stable_weight; - m_instantaneous_weight = x.m_instantaneous_weight; + m_msg = std::move(x.m_msg); } /*! * @brief Copy assignment. - * @param x Reference to the object WeighRsp that will be copied. + * @param x Reference to the object PrintRsp that will be copied. */ - eProsima_user_DllExport WeighRsp& operator =( - const WeighRsp& x) + eProsima_user_DllExport PrintRsp& operator =( + const PrintRsp& x) { m_index = x.m_index; - m_stable_weight = x.m_stable_weight; - - m_instantaneous_weight = x.m_instantaneous_weight; + m_msg = x.m_msg; return *this; } /*! * @brief Move assignment. - * @param x Reference to the object WeighRsp that will be copied. + * @param x Reference to the object PrintRsp that will be copied. */ - eProsima_user_DllExport WeighRsp& operator =( - WeighRsp&& x) noexcept + eProsima_user_DllExport PrintRsp& operator =( + PrintRsp&& x) noexcept { m_index = x.m_index; - m_stable_weight = x.m_stable_weight; - m_instantaneous_weight = x.m_instantaneous_weight; + m_msg = std::move(x.m_msg); return *this; } /*! * @brief Comparison operator. - * @param x WeighRsp object to compare. + * @param x PrintRsp object to compare. */ eProsima_user_DllExport bool operator ==( - const WeighRsp& x) const + const PrintRsp& x) const { return (m_index == x.m_index && - m_stable_weight == x.m_stable_weight && - m_instantaneous_weight == x.m_instantaneous_weight); + m_msg == x.m_msg); } /*! * @brief Comparison operator. - * @param x WeighRsp object to compare. + * @param x PrintRsp object to compare. */ eProsima_user_DllExport bool operator !=( - const WeighRsp& x) const + const PrintRsp& x) const { return !(*this == x); } @@ -1036,60 +3610,41 @@ public: /*! - * @brief This function sets a value in member stable_weight - * @param _stable_weight New value for member stable_weight - */ - eProsima_user_DllExport void stable_weight( - float _stable_weight) - { - m_stable_weight = _stable_weight; - } - - /*! - * @brief This function returns the value of member stable_weight - * @return Value of member stable_weight - */ - eProsima_user_DllExport float stable_weight() const - { - return m_stable_weight; - } - - /*! - * @brief This function returns a reference to member stable_weight - * @return Reference to member stable_weight + * @brief This function copies the value in member msg + * @param _msg New value to be copied in member msg */ - eProsima_user_DllExport float& stable_weight() + eProsima_user_DllExport void msg( + const std::string& _msg) { - return m_stable_weight; + m_msg = _msg; } - /*! - * @brief This function sets a value in member instantaneous_weight - * @param _instantaneous_weight New value for member instantaneous_weight + * @brief This function moves the value in member msg + * @param _msg New value to be moved in member msg */ - eProsima_user_DllExport void instantaneous_weight( - float _instantaneous_weight) + eProsima_user_DllExport void msg( + std::string&& _msg) { - m_instantaneous_weight = _instantaneous_weight; + m_msg = std::move(_msg); } /*! - * @brief This function returns the value of member instantaneous_weight - * @return Value of member instantaneous_weight + * @brief This function returns a constant reference to member msg + * @return Constant reference to member msg */ - eProsima_user_DllExport float instantaneous_weight() const + eProsima_user_DllExport const std::string& msg() const { - return m_instantaneous_weight; + return m_msg; } /*! - * @brief This function returns a reference to member instantaneous_weight - * @return Reference to member instantaneous_weight + * @brief This function returns a reference to member msg + * @return Reference to member msg */ - eProsima_user_DllExport float& instantaneous_weight() + eProsima_user_DllExport std::string& msg() { - return m_instantaneous_weight; + return m_msg; } @@ -1097,8 +3652,7 @@ public: private: uint32_t m_index{0}; - float m_stable_weight{0.0}; - float m_instantaneous_weight{0.0}; + std::string m_msg; }; /*! diff --git a/lib/System.idl b/lib/System.idl index 39600a7..998379a 100644 --- a/lib/System.idl +++ b/lib/System.idl @@ -1,42 +1,199 @@ @extensibility(APPENDABLE) -module InternalSystem -{ - struct LicencePlateReq - { - unsigned long index; - map msg; +module WeighingSystem { + + // ============================================ + // Topic: onScaleInfoUpdate + // 称重设备信息更新主题 + // ============================================ + struct ScaleInfo { + boolean HasVehicle; // 有车 0:无车 1:有车 + boolean WeightOK; // 重量稳定信号 0: 不稳定 1:稳定 + boolean State; // 设备状态 0:异常仪表 1:正常接收仪表 + float Value; // 实时重量 + float StableValue; // 稳定重量 }; + - struct LicencePlateRsp - { - unsigned long index; - string licence; + // ============================================ + // Topic: onScaleCommandUpdate + // 称重设备命令更新主题 + // ============================================ + struct ScaleCommand { + boolean Enable; // 是否启用 启动参数 + long ResetZero; // 仪表重置0 脉冲信号 1:清零 自动变0 }; - struct PrintReq - { - unsigned long index; - map msg; + + // ============================================ + // Topic: onWeightInfoOKUpdate + // 称重业务成功信息更新主题 + // ============================================ + struct WeightInfoOk { + // 基础信息属性 + long DeviceID; // 磅称编号 + string DeviceName; // 磅称名称 + string DeviceType; // 磅称类型 1:重磅 2:轻磅 3:通用称重 4:转煤 + string EnterpriseName; // 本系统企业名称 + + // 业务单据属性 + string BillNumber; // 票据号 + string CarNumber; // 车牌号 + string Supplier; // 往来单位 + string GoodsType; // 品种 + + // 重量数据属性 + float GrossWeight; // 毛重 + string GrossTime; // 毛重时间 + string GrossOperater; // 毛重操作员 + float Tare; // 皮重 + string TareTime; // 皮重时间 + string TareOperater; // 皮重操作员 + float Suttle; // 净重 + + // 扣重属性 + float duduction1; // 扣矸 大宗物资扣吨打印 + float duduction2; // 扣水 大宗物资扣钱打印 + float duduction3; // 扣杂 + + + // 物流信息属性 + string INCoalYard; // 卸货点 + string OutCoalYard; // 装货点 + string BatchNumber; // 批次号 + + // 操作结果提示属性 + string Warning; // 提示 字符串 + }; - struct PrintRsp - { - unsigned long index; - string msg; + // ============================================ + // Topic: onWeightInfoErrorUpdate + // 称重业务成功信息更新主题 + // ============================================ + struct WeightInfoError { + //车牌 + string CarNumber; // 车牌号 + // 操作结果提示属性 + string Warning; // 提示 字符串 + + }; + + // ============================================ + // Topic: onBarCommandUpdate + // 拦车器命令更新主题 + // ============================================ + struct BarCommandUpdate { + // 前拦车器控制 + long FrontBarSignalUp; // 前拦车器抬起信号 脉冲信号 1-》0 发1 自动置为0 + long FrontBarSignalDown; // 前拦车器放下信号 脉冲信号 1-》0 发1 自动置为0 + boolean FrontBarEnable; // 前拦车器是否启用 1: 启用 0: 不启用 + + // 后拦车器控制 + long BackBarSignalUp; // 后拦车器抬起信号 脉冲信号 1-》0 发1 自动置为0 (属性ID: 7) + long BackBarSignalDown; // 后拦车器放下信号 脉冲信号 1-》0 发1 自动置为0 + boolean BackBarEnable; // 后拦车器是否启用 1: 启用 0: 不启用 + }; - struct WeighReq + // ============================================ + // Topic: onLightsCommandUpdate + // 红绿灯命令更新主题 + // ============================================ + struct LightsCommandUpdate { + // 前红绿灯控制 + long FrontLEDSignal; // 前红绿灯信号 1.红 2.绿 + boolean FrontLEDEnable; // 前红绿灯是否启用 1: 启用 0: 不启用 + + // 后红绿灯控制 + long BackLEDSignal; // 后红绿灯信号 1.红 2.绿 + long BackLEDEnable; // 后红绿灯是否启用 1: 启用 0: 不启用 + }; + + + + // ============================================ + // Topic: InfraredCommandUpdate + // 拦车器与红绿灯命令更新主题 + // ============================================ + struct InfraredCommandUpdate { + // 前红外对射控制 + long FrontResistanceUnLock; // 前红外对射临时解除 1.解除 0.不解除 + boolean FrontResistanceEnable; // 前红外对射启用 1: 启用 0: 不启用 + + // 后红外对射控制 + long BackResistanceUnLock; // 后红外对射临时解除 1.解除 0.不解除 + boolean BackResistanceEnable; // 后红外对射启用 1: 启用 0: 不启用 + }; + + + // ============================================ + // Topic: onBarUpdate + // 拦车器更新主题 + // ============================================ + struct BarUpdate { + // 前拦车器状态 + long FrontBarState; // 1 抬起状态 2 放下状态 + // 后拦车器状态 + long BackBarState; // 1 抬起状态 2 放下状态 + }; + + // ============================================ + // Topic: onLightsUpdate + // 红绿灯状态更新主题 + // ============================================ + struct LightsUpdate { + // 前红绿灯状态 + long FrontLEDState; // 1.红 2.绿 + + // 后红绿灯状态 + long BackLEDState; // 1.红 2.绿 + }; + + // ============================================ + // Topic: onInfraredUpdate + // 拦车器与红绿灯状态更新主题 + // ============================================ + struct InfraredUpdate { + // 前红外对射状态 + long FrontResistanceSignal; // 1 有阻挡 0 无阻挡 + + // 后红外对射状态 + long BackResistanceSignal; // 1 有阻挡 0 无阻挡 + }; + + // ============================================ + // Topic: LicenseSnap + // 车牌识别类 + // ============================================ + struct LicenseSnapUpdate { + long NewTag; // 车牌更新 1 新的 2 旧的不变 + string License; // 车牌号 + }; + + + // ============================================ + // Topic: LicenseSnap + // 语音播放ID + // ============================================ + struct Voice { + long VoiceID; //语音ID + string VoiceContent; //语音string,后续如果可以程序用tts直接播放语音内容 + }; +}; + +module InternalSystem +{ + struct PrintReq { unsigned long index; map msg; }; - struct WeighRsp + struct PrintRsp { unsigned long index; - float stable_weight; - float instantaneous_weight; + string msg; }; struct IoCtrlReq diff --git a/lib/SystemCdrAux.hpp b/lib/SystemCdrAux.hpp index d35e7ba..cb7cae9 100644 --- a/lib/SystemCdrAux.hpp +++ b/lib/SystemCdrAux.hpp @@ -24,30 +24,54 @@ #include "System.hpp" -constexpr uint32_t InternalSystem_WeighRsp_max_cdr_typesize {16UL}; -constexpr uint32_t InternalSystem_WeighRsp_max_key_cdr_typesize {0UL}; +constexpr uint32_t WeighingSystem_LightsUpdate_max_cdr_typesize {12UL}; +constexpr uint32_t WeighingSystem_LightsUpdate_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 InternalSystem_WeighReq_max_cdr_typesize {16UL}; -constexpr uint32_t InternalSystem_WeighReq_max_key_cdr_typesize {0UL}; +constexpr uint32_t WeighingSystem_InfraredUpdate_max_cdr_typesize {12UL}; +constexpr uint32_t WeighingSystem_InfraredUpdate_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 InternalSystem_LicencePlateReq_max_cdr_typesize {16UL}; -constexpr uint32_t InternalSystem_LicencePlateReq_max_key_cdr_typesize {0UL}; +constexpr uint32_t WeighingSystem_WeightInfoError_max_cdr_typesize {524UL}; +constexpr uint32_t WeighingSystem_WeightInfoError_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_WeightInfoOk_max_cdr_typesize {3932UL}; +constexpr uint32_t WeighingSystem_WeightInfoOk_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 WeighingSystem_InfraredCommandUpdate_max_cdr_typesize {17UL}; +constexpr uint32_t WeighingSystem_InfraredCommandUpdate_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_LightsCommandUpdate_max_cdr_typesize {20UL}; +constexpr uint32_t WeighingSystem_LightsCommandUpdate_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_LicenseSnapUpdate_max_cdr_typesize {268UL}; +constexpr uint32_t WeighingSystem_LicenseSnapUpdate_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_ScaleInfo_max_cdr_typesize {16UL}; +constexpr uint32_t WeighingSystem_ScaleInfo_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 WeighingSystem_Voice_max_cdr_typesize {268UL}; +constexpr uint32_t WeighingSystem_Voice_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_BarCommandUpdate_max_cdr_typesize {25UL}; +constexpr uint32_t WeighingSystem_BarCommandUpdate_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_ScaleCommand_max_cdr_typesize {12UL}; +constexpr uint32_t WeighingSystem_ScaleCommand_max_key_cdr_typesize {0UL}; + +constexpr uint32_t WeighingSystem_BarUpdate_max_cdr_typesize {12UL}; +constexpr uint32_t WeighingSystem_BarUpdate_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 InternalSystem_LicencePlateRsp_max_cdr_typesize {268UL}; -constexpr uint32_t InternalSystem_LicencePlateRsp_max_key_cdr_typesize {0UL}; - namespace eprosima { namespace fastcdr { @@ -57,27 +81,59 @@ class CdrSizeCalculator; eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::LicencePlateReq& data); + const WeighingSystem::ScaleInfo& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::LicencePlateRsp& data); + const WeighingSystem::ScaleCommand& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::PrintReq& data); + const WeighingSystem::WeightInfoOk& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::PrintRsp& data); + const WeighingSystem::WeightInfoError& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::BarCommandUpdate& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::LightsCommandUpdate& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::InfraredCommandUpdate& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::BarUpdate& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::LightsUpdate& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::WeighReq& data); + const WeighingSystem::InfraredUpdate& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::WeighRsp& data); + const WeighingSystem::LicenseSnapUpdate& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::Voice& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const InternalSystem::PrintReq& data); + +eProsima_user_DllExport void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const InternalSystem::PrintRsp& data); eProsima_user_DllExport void serialize_key( eprosima::fastcdr::Cdr& scdr, diff --git a/lib/SystemCdrAux.ipp b/lib/SystemCdrAux.ipp index 5b88d77..8932beb 100644 --- a/lib/SystemCdrAux.ipp +++ b/lib/SystemCdrAux.ipp @@ -37,10 +37,876 @@ namespace fastcdr { template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const InternalSystem::LicencePlateReq& data, + const WeighingSystem::ScaleInfo& data, size_t& current_alignment) { - using namespace InternalSystem; + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.HasVehicle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.WeightOK(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.State(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.Value(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.StableValue(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::ScaleInfo& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.HasVehicle() + << eprosima::fastcdr::MemberId(1) << data.WeightOK() + << eprosima::fastcdr::MemberId(2) << data.State() + << eprosima::fastcdr::MemberId(3) << data.Value() + << eprosima::fastcdr::MemberId(4) << data.StableValue() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::ScaleInfo& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.HasVehicle(); + break; + + case 1: + dcdr >> data.WeightOK(); + break; + + case 2: + dcdr >> data.State(); + break; + + case 3: + dcdr >> data.Value(); + break; + + case 4: + dcdr >> data.StableValue(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::ScaleInfo& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.HasVehicle(); + + scdr << data.WeightOK(); + + scdr << data.State(); + + scdr << data.Value(); + + scdr << data.StableValue(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::ScaleCommand& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.Enable(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.ResetZero(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::ScaleCommand& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.Enable() + << eprosima::fastcdr::MemberId(1) << data.ResetZero() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::ScaleCommand& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.Enable(); + break; + + case 1: + dcdr >> data.ResetZero(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::ScaleCommand& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.Enable(); + + scdr << data.ResetZero(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::WeightInfoOk& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.DeviceID(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.DeviceName(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.DeviceType(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.EnterpriseName(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.BillNumber(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.CarNumber(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6), + data.Supplier(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7), + data.GoodsType(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8), + data.GrossWeight(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9), + data.GrossTime(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10), + data.GrossOperater(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11), + data.Tare(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12), + data.TareTime(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13), + data.TareOperater(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14), + data.Suttle(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15), + data.duduction1(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16), + data.duduction2(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17), + data.duduction3(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18), + data.INCoalYard(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19), + data.OutCoalYard(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20), + data.BatchNumber(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(21), + data.Warning(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::WeightInfoOk& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.DeviceID() + << eprosima::fastcdr::MemberId(1) << data.DeviceName() + << eprosima::fastcdr::MemberId(2) << data.DeviceType() + << eprosima::fastcdr::MemberId(3) << data.EnterpriseName() + << eprosima::fastcdr::MemberId(4) << data.BillNumber() + << eprosima::fastcdr::MemberId(5) << data.CarNumber() + << eprosima::fastcdr::MemberId(6) << data.Supplier() + << eprosima::fastcdr::MemberId(7) << data.GoodsType() + << eprosima::fastcdr::MemberId(8) << data.GrossWeight() + << eprosima::fastcdr::MemberId(9) << data.GrossTime() + << eprosima::fastcdr::MemberId(10) << data.GrossOperater() + << eprosima::fastcdr::MemberId(11) << data.Tare() + << eprosima::fastcdr::MemberId(12) << data.TareTime() + << eprosima::fastcdr::MemberId(13) << data.TareOperater() + << eprosima::fastcdr::MemberId(14) << data.Suttle() + << eprosima::fastcdr::MemberId(15) << data.duduction1() + << eprosima::fastcdr::MemberId(16) << data.duduction2() + << eprosima::fastcdr::MemberId(17) << data.duduction3() + << eprosima::fastcdr::MemberId(18) << data.INCoalYard() + << eprosima::fastcdr::MemberId(19) << data.OutCoalYard() + << eprosima::fastcdr::MemberId(20) << data.BatchNumber() + << eprosima::fastcdr::MemberId(21) << data.Warning() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::WeightInfoOk& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.DeviceID(); + break; + + case 1: + dcdr >> data.DeviceName(); + break; + + case 2: + dcdr >> data.DeviceType(); + break; + + case 3: + dcdr >> data.EnterpriseName(); + break; + + case 4: + dcdr >> data.BillNumber(); + break; + + case 5: + dcdr >> data.CarNumber(); + break; + + case 6: + dcdr >> data.Supplier(); + break; + + case 7: + dcdr >> data.GoodsType(); + break; + + case 8: + dcdr >> data.GrossWeight(); + break; + + case 9: + dcdr >> data.GrossTime(); + break; + + case 10: + dcdr >> data.GrossOperater(); + break; + + case 11: + dcdr >> data.Tare(); + break; + + case 12: + dcdr >> data.TareTime(); + break; + + case 13: + dcdr >> data.TareOperater(); + break; + + case 14: + dcdr >> data.Suttle(); + break; + + case 15: + dcdr >> data.duduction1(); + break; + + case 16: + dcdr >> data.duduction2(); + break; + + case 17: + dcdr >> data.duduction3(); + break; + + case 18: + dcdr >> data.INCoalYard(); + break; + + case 19: + dcdr >> data.OutCoalYard(); + break; + + case 20: + dcdr >> data.BatchNumber(); + break; + + case 21: + dcdr >> data.Warning(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::WeightInfoOk& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.DeviceID(); + + scdr << data.DeviceName(); + + scdr << data.DeviceType(); + + scdr << data.EnterpriseName(); + + scdr << data.BillNumber(); + + scdr << data.CarNumber(); + + scdr << data.Supplier(); + + scdr << data.GoodsType(); + + scdr << data.GrossWeight(); + + scdr << data.GrossTime(); + + scdr << data.GrossOperater(); + + scdr << data.Tare(); + + scdr << data.TareTime(); + + scdr << data.TareOperater(); + + scdr << data.Suttle(); + + scdr << data.duduction1(); + + scdr << data.duduction2(); + + scdr << data.duduction3(); + + scdr << data.INCoalYard(); + + scdr << data.OutCoalYard(); + + scdr << data.BatchNumber(); + + scdr << data.Warning(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::WeightInfoError& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.CarNumber(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.Warning(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::WeightInfoError& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.CarNumber() + << eprosima::fastcdr::MemberId(1) << data.Warning() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::WeightInfoError& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.CarNumber(); + break; + + case 1: + dcdr >> data.Warning(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::WeightInfoError& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.CarNumber(); + + scdr << data.Warning(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::BarCommandUpdate& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.FrontBarSignalUp(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.FrontBarSignalDown(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.FrontBarEnable(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.BackBarSignalUp(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4), + data.BackBarSignalDown(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5), + data.BackBarEnable(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::BarCommandUpdate& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.FrontBarSignalUp() + << eprosima::fastcdr::MemberId(1) << data.FrontBarSignalDown() + << eprosima::fastcdr::MemberId(2) << data.FrontBarEnable() + << eprosima::fastcdr::MemberId(3) << data.BackBarSignalUp() + << eprosima::fastcdr::MemberId(4) << data.BackBarSignalDown() + << eprosima::fastcdr::MemberId(5) << data.BackBarEnable() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::BarCommandUpdate& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.FrontBarSignalUp(); + break; + + case 1: + dcdr >> data.FrontBarSignalDown(); + break; + + case 2: + dcdr >> data.FrontBarEnable(); + break; + + case 3: + dcdr >> data.BackBarSignalUp(); + break; + + case 4: + dcdr >> data.BackBarSignalDown(); + break; + + case 5: + dcdr >> data.BackBarEnable(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::BarCommandUpdate& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.FrontBarSignalUp(); + + scdr << data.FrontBarSignalDown(); + + scdr << data.FrontBarEnable(); + + scdr << data.BackBarSignalUp(); + + scdr << data.BackBarSignalDown(); + + scdr << data.BackBarEnable(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::LightsCommandUpdate& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.FrontLEDSignal(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.FrontLEDEnable(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.BackLEDSignal(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.BackLEDEnable(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::LightsCommandUpdate& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.FrontLEDSignal() + << eprosima::fastcdr::MemberId(1) << data.FrontLEDEnable() + << eprosima::fastcdr::MemberId(2) << data.BackLEDSignal() + << eprosima::fastcdr::MemberId(3) << data.BackLEDEnable() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::LightsCommandUpdate& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.FrontLEDSignal(); + break; + + case 1: + dcdr >> data.FrontLEDEnable(); + break; + + case 2: + dcdr >> data.BackLEDSignal(); + break; + + case 3: + dcdr >> data.BackLEDEnable(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::LightsCommandUpdate& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.FrontLEDSignal(); + + scdr << data.FrontLEDEnable(); + + scdr << data.BackLEDSignal(); + + scdr << data.BackLEDEnable(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::InfraredCommandUpdate& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; static_cast(data); @@ -53,10 +919,16 @@ eProsima_user_DllExport size_t calculate_serialized_size( calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.index(), current_alignment); + data.FrontResistanceUnLock(), current_alignment); calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.msg(), current_alignment); + data.FrontResistanceEnable(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), + data.BackResistanceUnLock(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3), + data.BackResistanceEnable(), current_alignment); calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -67,9 +939,9 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::LicencePlateReq& data) + const WeighingSystem::InfraredCommandUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, @@ -78,8 +950,10 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr - << eprosima::fastcdr::MemberId(0) << data.index() - << eprosima::fastcdr::MemberId(1) << data.msg() + << eprosima::fastcdr::MemberId(0) << data.FrontResistanceUnLock() + << eprosima::fastcdr::MemberId(1) << data.FrontResistanceEnable() + << eprosima::fastcdr::MemberId(2) << data.BackResistanceUnLock() + << eprosima::fastcdr::MemberId(3) << data.BackResistanceEnable() ; scdr.end_serialize_type(current_state); } @@ -87,9 +961,9 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - InternalSystem::LicencePlateReq& data) + WeighingSystem::InfraredCommandUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : @@ -100,11 +974,19 @@ eProsima_user_DllExport void deserialize( switch (mid.id) { case 0: - dcdr >> data.index(); + dcdr >> data.FrontResistanceUnLock(); break; case 1: - dcdr >> data.msg(); + dcdr >> data.FrontResistanceEnable(); + break; + + case 2: + dcdr >> data.BackResistanceUnLock(); + break; + + case 3: + dcdr >> data.BackResistanceEnable(); break; default: @@ -117,15 +999,19 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::LicencePlateReq& data) + const WeighingSystem::InfraredCommandUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(scdr); static_cast(data); - scdr << data.index(); + scdr << data.FrontResistanceUnLock(); - scdr << data.msg(); + scdr << data.FrontResistanceEnable(); + + scdr << data.BackResistanceUnLock(); + + scdr << data.BackResistanceEnable(); } @@ -133,10 +1019,10 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const InternalSystem::LicencePlateRsp& data, + const WeighingSystem::BarUpdate& data, size_t& current_alignment) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(data); @@ -149,10 +1035,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.index(), current_alignment); + data.FrontBarState(), current_alignment); calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.licence(), current_alignment); + data.BackBarState(), current_alignment); calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -163,9 +1049,9 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::LicencePlateRsp& data) + const WeighingSystem::BarUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, @@ -174,8 +1060,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr - << eprosima::fastcdr::MemberId(0) << data.index() - << eprosima::fastcdr::MemberId(1) << data.licence() + << eprosima::fastcdr::MemberId(0) << data.FrontBarState() + << eprosima::fastcdr::MemberId(1) << data.BackBarState() ; scdr.end_serialize_type(current_state); } @@ -183,9 +1069,9 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - InternalSystem::LicencePlateRsp& data) + WeighingSystem::BarUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : @@ -196,11 +1082,11 @@ eProsima_user_DllExport void deserialize( switch (mid.id) { case 0: - dcdr >> data.index(); + dcdr >> data.FrontBarState(); break; case 1: - dcdr >> data.licence(); + dcdr >> data.BackBarState(); break; default: @@ -213,15 +1099,15 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::LicencePlateRsp& data) + const WeighingSystem::BarUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(scdr); static_cast(data); - scdr << data.index(); + scdr << data.FrontBarState(); - scdr << data.licence(); + scdr << data.BackBarState(); } @@ -229,10 +1115,10 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const InternalSystem::PrintReq& data, + const WeighingSystem::LightsUpdate& data, size_t& current_alignment) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(data); @@ -245,10 +1131,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.index(), current_alignment); + data.FrontLEDState(), current_alignment); calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.msg(), current_alignment); + data.BackLEDState(), current_alignment); calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -259,9 +1145,9 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::PrintReq& data) + const WeighingSystem::LightsUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, @@ -270,8 +1156,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr - << eprosima::fastcdr::MemberId(0) << data.index() - << eprosima::fastcdr::MemberId(1) << data.msg() + << eprosima::fastcdr::MemberId(0) << data.FrontLEDState() + << eprosima::fastcdr::MemberId(1) << data.BackLEDState() ; scdr.end_serialize_type(current_state); } @@ -279,9 +1165,9 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - InternalSystem::PrintReq& data) + WeighingSystem::LightsUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : @@ -292,11 +1178,11 @@ eProsima_user_DllExport void deserialize( switch (mid.id) { case 0: - dcdr >> data.index(); + dcdr >> data.FrontLEDState(); break; case 1: - dcdr >> data.msg(); + dcdr >> data.BackLEDState(); break; default: @@ -309,15 +1195,15 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::PrintReq& data) + const WeighingSystem::LightsUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(scdr); static_cast(data); - scdr << data.index(); + scdr << data.FrontLEDState(); - scdr << data.msg(); + scdr << data.BackLEDState(); } @@ -325,10 +1211,10 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const InternalSystem::PrintRsp& data, + const WeighingSystem::InfraredUpdate& data, size_t& current_alignment) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(data); @@ -341,10 +1227,10 @@ eProsima_user_DllExport size_t calculate_serialized_size( calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), - data.index(), current_alignment); + data.FrontResistanceSignal(), current_alignment); calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.msg(), current_alignment); + data.BackResistanceSignal(), current_alignment); calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -355,9 +1241,9 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::PrintRsp& data) + const WeighingSystem::InfraredUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; eprosima::fastcdr::Cdr::state current_state(scdr); scdr.begin_serialize_type(current_state, @@ -366,8 +1252,8 @@ eProsima_user_DllExport void serialize( eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); scdr - << eprosima::fastcdr::MemberId(0) << data.index() - << eprosima::fastcdr::MemberId(1) << data.msg() + << eprosima::fastcdr::MemberId(0) << data.FrontResistanceSignal() + << eprosima::fastcdr::MemberId(1) << data.BackResistanceSignal() ; scdr.end_serialize_type(current_state); } @@ -375,9 +1261,9 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - InternalSystem::PrintRsp& data) + WeighingSystem::InfraredUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : @@ -388,11 +1274,11 @@ eProsima_user_DllExport void deserialize( switch (mid.id) { case 0: - dcdr >> data.index(); + dcdr >> data.FrontResistanceSignal(); break; case 1: - dcdr >> data.msg(); + dcdr >> data.BackResistanceSignal(); break; default: @@ -405,15 +1291,207 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::PrintRsp& data) + const WeighingSystem::InfraredUpdate& data) { - using namespace InternalSystem; + using namespace WeighingSystem; static_cast(scdr); static_cast(data); - scdr << data.index(); + scdr << data.FrontResistanceSignal(); - scdr << data.msg(); + scdr << data.BackResistanceSignal(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::LicenseSnapUpdate& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.NewTag(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.License(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::LicenseSnapUpdate& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.NewTag() + << eprosima::fastcdr::MemberId(1) << data.License() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::LicenseSnapUpdate& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.NewTag(); + break; + + case 1: + dcdr >> data.License(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::LicenseSnapUpdate& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.NewTag(); + + scdr << data.License(); + +} + + +template<> +eProsima_user_DllExport size_t calculate_serialized_size( + eprosima::fastcdr::CdrSizeCalculator& calculator, + const WeighingSystem::Voice& data, + size_t& current_alignment) +{ + using namespace WeighingSystem; + + static_cast(data); + + eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding(); + size_t calculated_size {calculator.begin_calculate_type_serialized_size( + eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + current_alignment)}; + + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0), + data.VoiceID(), current_alignment); + + calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), + data.VoiceContent(), current_alignment); + + + calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); + + return calculated_size; +} + +template<> +eProsima_user_DllExport void serialize( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::Voice& data) +{ + using namespace WeighingSystem; + + eprosima::fastcdr::Cdr::state current_state(scdr); + scdr.begin_serialize_type(current_state, + eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR); + + scdr + << eprosima::fastcdr::MemberId(0) << data.VoiceID() + << eprosima::fastcdr::MemberId(1) << data.VoiceContent() +; + scdr.end_serialize_type(current_state); +} + +template<> +eProsima_user_DllExport void deserialize( + eprosima::fastcdr::Cdr& cdr, + WeighingSystem::Voice& data) +{ + using namespace WeighingSystem; + + cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? + eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : + eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR, + [&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool + { + bool ret_value = true; + switch (mid.id) + { + case 0: + dcdr >> data.VoiceID(); + break; + + case 1: + dcdr >> data.VoiceContent(); + break; + + default: + ret_value = false; + break; + } + return ret_value; + }); +} + +void serialize_key( + eprosima::fastcdr::Cdr& scdr, + const WeighingSystem::Voice& data) +{ + using namespace WeighingSystem; + + static_cast(scdr); + static_cast(data); + scdr << data.VoiceID(); + + scdr << data.VoiceContent(); } @@ -421,7 +1499,7 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const InternalSystem::WeighReq& data, + const InternalSystem::PrintReq& data, size_t& current_alignment) { using namespace InternalSystem; @@ -451,7 +1529,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::WeighReq& data) + const InternalSystem::PrintReq& data) { using namespace InternalSystem; @@ -471,7 +1549,7 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - InternalSystem::WeighReq& data) + InternalSystem::PrintReq& data) { using namespace InternalSystem; @@ -501,7 +1579,7 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::WeighReq& data) + const InternalSystem::PrintReq& data) { using namespace InternalSystem; @@ -517,7 +1595,7 @@ void serialize_key( template<> eProsima_user_DllExport size_t calculate_serialized_size( eprosima::fastcdr::CdrSizeCalculator& calculator, - const InternalSystem::WeighRsp& data, + const InternalSystem::PrintRsp& data, size_t& current_alignment) { using namespace InternalSystem; @@ -536,10 +1614,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( data.index(), current_alignment); calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1), - data.stable_weight(), current_alignment); - - calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2), - data.instantaneous_weight(), current_alignment); + data.msg(), current_alignment); calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment); @@ -550,7 +1625,7 @@ eProsima_user_DllExport size_t calculate_serialized_size( template<> eProsima_user_DllExport void serialize( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::WeighRsp& data) + const InternalSystem::PrintRsp& data) { using namespace InternalSystem; @@ -562,8 +1637,7 @@ eProsima_user_DllExport void serialize( scdr << eprosima::fastcdr::MemberId(0) << data.index() - << eprosima::fastcdr::MemberId(1) << data.stable_weight() - << eprosima::fastcdr::MemberId(2) << data.instantaneous_weight() + << eprosima::fastcdr::MemberId(1) << data.msg() ; scdr.end_serialize_type(current_state); } @@ -571,7 +1645,7 @@ eProsima_user_DllExport void serialize( template<> eProsima_user_DllExport void deserialize( eprosima::fastcdr::Cdr& cdr, - InternalSystem::WeighRsp& data) + InternalSystem::PrintRsp& data) { using namespace InternalSystem; @@ -588,11 +1662,7 @@ eProsima_user_DllExport void deserialize( break; case 1: - dcdr >> data.stable_weight(); - break; - - case 2: - dcdr >> data.instantaneous_weight(); + dcdr >> data.msg(); break; default: @@ -605,7 +1675,7 @@ eProsima_user_DllExport void deserialize( void serialize_key( eprosima::fastcdr::Cdr& scdr, - const InternalSystem::WeighRsp& data) + const InternalSystem::PrintRsp& data) { using namespace InternalSystem; @@ -613,9 +1683,7 @@ void serialize_key( static_cast(data); scdr << data.index(); - scdr << data.stable_weight(); - - scdr << data.instantaneous_weight(); + scdr << data.msg(); } diff --git a/lib/SystemPubSubTypes.cxx b/lib/SystemPubSubTypes.cxx index e2e78e5..ab44c09 100644 --- a/lib/SystemPubSubTypes.cxx +++ b/lib/SystemPubSubTypes.cxx @@ -31,20 +31,1294 @@ using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; -namespace InternalSystem { - LicencePlateReqPubSubType::LicencePlateReqPubSubType() +namespace WeighingSystem { + ScaleInfoPubSubType::ScaleInfoPubSubType() + { + set_name("WeighingSystem::ScaleInfo"); + uint32_t type_size = WeighingSystem_ScaleInfo_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 = WeighingSystem_ScaleInfo_max_key_cdr_typesize > 16 ? WeighingSystem_ScaleInfo_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + ScaleInfoPubSubType::~ScaleInfoPubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool ScaleInfoPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const ScaleInfo* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool ScaleInfoPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + ScaleInfo* 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); + + // 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; + } + + return true; + } + + uint32_t ScaleInfoPubSubType::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; + } + } + + void* ScaleInfoPubSubType::create_data() + { + return reinterpret_cast(new ScaleInfo()); + } + + void ScaleInfoPubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ScaleInfoPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + ScaleInfo data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool ScaleInfoPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const ScaleInfo* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_ScaleInfo_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 || WeighingSystem_ScaleInfo_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; + } + + void ScaleInfoPubSubType::register_type_object_representation() + { + register_ScaleInfo_type_identifier(type_identifiers_); + } + + ScaleCommandPubSubType::ScaleCommandPubSubType() + { + set_name("WeighingSystem::ScaleCommand"); + uint32_t type_size = WeighingSystem_ScaleCommand_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 = WeighingSystem_ScaleCommand_max_key_cdr_typesize > 16 ? WeighingSystem_ScaleCommand_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + ScaleCommandPubSubType::~ScaleCommandPubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool ScaleCommandPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const ScaleCommand* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool ScaleCommandPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + ScaleCommand* 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); + + // 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; + } + + return true; + } + + uint32_t ScaleCommandPubSubType::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; + } + } + + void* ScaleCommandPubSubType::create_data() + { + return reinterpret_cast(new ScaleCommand()); + } + + void ScaleCommandPubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool ScaleCommandPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + ScaleCommand data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool ScaleCommandPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const ScaleCommand* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_ScaleCommand_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 || WeighingSystem_ScaleCommand_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; + } + + void ScaleCommandPubSubType::register_type_object_representation() + { + register_ScaleCommand_type_identifier(type_identifiers_); + } + + WeightInfoOkPubSubType::WeightInfoOkPubSubType() + { + set_name("WeighingSystem::WeightInfoOk"); + uint32_t type_size = WeighingSystem_WeightInfoOk_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 = WeighingSystem_WeightInfoOk_max_key_cdr_typesize > 16 ? WeighingSystem_WeightInfoOk_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + WeightInfoOkPubSubType::~WeightInfoOkPubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool WeightInfoOkPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const WeightInfoOk* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool WeightInfoOkPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + WeightInfoOk* 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); + + // 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; + } + + return true; + } + + uint32_t WeightInfoOkPubSubType::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; + } + } + + void* WeightInfoOkPubSubType::create_data() + { + return reinterpret_cast(new WeightInfoOk()); + } + + void WeightInfoOkPubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool WeightInfoOkPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + WeightInfoOk data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool WeightInfoOkPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const WeightInfoOk* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_WeightInfoOk_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 || WeighingSystem_WeightInfoOk_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; + } + + void WeightInfoOkPubSubType::register_type_object_representation() + { + register_WeightInfoOk_type_identifier(type_identifiers_); + } + + WeightInfoErrorPubSubType::WeightInfoErrorPubSubType() + { + set_name("WeighingSystem::WeightInfoError"); + uint32_t type_size = WeighingSystem_WeightInfoError_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 = WeighingSystem_WeightInfoError_max_key_cdr_typesize > 16 ? WeighingSystem_WeightInfoError_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + WeightInfoErrorPubSubType::~WeightInfoErrorPubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool WeightInfoErrorPubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const WeightInfoError* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool WeightInfoErrorPubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + WeightInfoError* 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); + + // 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; + } + + return true; + } + + uint32_t WeightInfoErrorPubSubType::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; + } + } + + void* WeightInfoErrorPubSubType::create_data() + { + return reinterpret_cast(new WeightInfoError()); + } + + void WeightInfoErrorPubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool WeightInfoErrorPubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + WeightInfoError data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool WeightInfoErrorPubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const WeightInfoError* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_WeightInfoError_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 || WeighingSystem_WeightInfoError_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; + } + + void WeightInfoErrorPubSubType::register_type_object_representation() + { + register_WeightInfoError_type_identifier(type_identifiers_); + } + + BarCommandUpdatePubSubType::BarCommandUpdatePubSubType() + { + set_name("WeighingSystem::BarCommandUpdate"); + uint32_t type_size = WeighingSystem_BarCommandUpdate_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 = WeighingSystem_BarCommandUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_BarCommandUpdate_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + BarCommandUpdatePubSubType::~BarCommandUpdatePubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool BarCommandUpdatePubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const BarCommandUpdate* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool BarCommandUpdatePubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + BarCommandUpdate* 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); + + // 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; + } + + return true; + } + + uint32_t BarCommandUpdatePubSubType::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; + } + } + + void* BarCommandUpdatePubSubType::create_data() + { + return reinterpret_cast(new BarCommandUpdate()); + } + + void BarCommandUpdatePubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool BarCommandUpdatePubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + BarCommandUpdate data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool BarCommandUpdatePubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const BarCommandUpdate* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_BarCommandUpdate_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 || WeighingSystem_BarCommandUpdate_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; + } + + void BarCommandUpdatePubSubType::register_type_object_representation() + { + register_BarCommandUpdate_type_identifier(type_identifiers_); + } + + LightsCommandUpdatePubSubType::LightsCommandUpdatePubSubType() + { + set_name("WeighingSystem::LightsCommandUpdate"); + uint32_t type_size = WeighingSystem_LightsCommandUpdate_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 = WeighingSystem_LightsCommandUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_LightsCommandUpdate_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + LightsCommandUpdatePubSubType::~LightsCommandUpdatePubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool LightsCommandUpdatePubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const LightsCommandUpdate* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool LightsCommandUpdatePubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + LightsCommandUpdate* 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); + + // 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; + } + + return true; + } + + uint32_t LightsCommandUpdatePubSubType::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; + } + } + + void* LightsCommandUpdatePubSubType::create_data() + { + return reinterpret_cast(new LightsCommandUpdate()); + } + + void LightsCommandUpdatePubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool LightsCommandUpdatePubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + LightsCommandUpdate data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool LightsCommandUpdatePubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const LightsCommandUpdate* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_LightsCommandUpdate_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 || WeighingSystem_LightsCommandUpdate_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; + } + + void LightsCommandUpdatePubSubType::register_type_object_representation() + { + register_LightsCommandUpdate_type_identifier(type_identifiers_); + } + + InfraredCommandUpdatePubSubType::InfraredCommandUpdatePubSubType() + { + set_name("WeighingSystem::InfraredCommandUpdate"); + uint32_t type_size = WeighingSystem_InfraredCommandUpdate_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 = WeighingSystem_InfraredCommandUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_InfraredCommandUpdate_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + InfraredCommandUpdatePubSubType::~InfraredCommandUpdatePubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool InfraredCommandUpdatePubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const InfraredCommandUpdate* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool InfraredCommandUpdatePubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + InfraredCommandUpdate* 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); + + // 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; + } + + return true; + } + + uint32_t InfraredCommandUpdatePubSubType::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; + } + } + + void* InfraredCommandUpdatePubSubType::create_data() + { + return reinterpret_cast(new InfraredCommandUpdate()); + } + + void InfraredCommandUpdatePubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool InfraredCommandUpdatePubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + InfraredCommandUpdate data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool InfraredCommandUpdatePubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const InfraredCommandUpdate* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_InfraredCommandUpdate_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 || WeighingSystem_InfraredCommandUpdate_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; + } + + void InfraredCommandUpdatePubSubType::register_type_object_representation() { - set_name("InternalSystem::LicencePlateReq"); - uint32_t type_size = InternalSystem_LicencePlateReq_max_cdr_typesize; + register_InfraredCommandUpdate_type_identifier(type_identifiers_); + } + + BarUpdatePubSubType::BarUpdatePubSubType() + { + set_name("WeighingSystem::BarUpdate"); + uint32_t type_size = WeighingSystem_BarUpdate_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; + uint32_t key_length = WeighingSystem_BarUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_BarUpdate_max_key_cdr_typesize : 16; key_buffer_ = reinterpret_cast(malloc(key_length)); memset(key_buffer_, 0, key_length); } - LicencePlateReqPubSubType::~LicencePlateReqPubSubType() + BarUpdatePubSubType::~BarUpdatePubSubType() { if (key_buffer_ != nullptr) { @@ -52,12 +1326,12 @@ namespace InternalSystem { } } - bool LicencePlateReqPubSubType::serialize( + bool BarUpdatePubSubType::serialize( const void* const data, SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const LicencePlateReq* p_type = static_cast(data); + const BarUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); @@ -89,14 +1363,14 @@ namespace InternalSystem { return true; } - bool LicencePlateReqPubSubType::deserialize( + bool BarUpdatePubSubType::deserialize( SerializedPayload_t& payload, void* data) { try { // Convert DATA to pointer of your type - LicencePlateReq* p_type = static_cast(data); + BarUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -119,7 +1393,7 @@ namespace InternalSystem { return true; } - uint32_t LicencePlateReqPubSubType::calculate_serialized_size( + uint32_t BarUpdatePubSubType::calculate_serialized_size( const void* const data, DataRepresentationId_t data_representation) { @@ -130,7 +1404,7 @@ namespace InternalSystem { 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)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -139,18 +1413,18 @@ namespace InternalSystem { } } - void* LicencePlateReqPubSubType::create_data() + void* BarUpdatePubSubType::create_data() { - return reinterpret_cast(new LicencePlateReq()); + return reinterpret_cast(new BarUpdate()); } - void LicencePlateReqPubSubType::delete_data( + void BarUpdatePubSubType::delete_data( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool LicencePlateReqPubSubType::compute_key( + bool BarUpdatePubSubType::compute_key( SerializedPayload_t& payload, InstanceHandle_t& handle, bool force_md5) @@ -160,7 +1434,7 @@ namespace InternalSystem { return false; } - LicencePlateReq data; + BarUpdate data; if (deserialize(payload, static_cast(&data))) { return compute_key(static_cast(&data), handle, force_md5); @@ -169,7 +1443,7 @@ namespace InternalSystem { return false; } - bool LicencePlateReqPubSubType::compute_key( + bool BarUpdatePubSubType::compute_key( const void* const data, InstanceHandle_t& handle, bool force_md5) @@ -179,17 +1453,17 @@ namespace InternalSystem { return false; } - const LicencePlateReq* p_type = static_cast(data); + const BarUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - InternalSystem_LicencePlateReq_max_key_cdr_typesize); + WeighingSystem_BarUpdate_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) + if (force_md5 || WeighingSystem_BarUpdate_max_key_cdr_typesize > 16) { md5_.init(); md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); @@ -209,24 +1483,24 @@ namespace InternalSystem { return true; } - void LicencePlateReqPubSubType::register_type_object_representation() + void BarUpdatePubSubType::register_type_object_representation() { - register_LicencePlateReq_type_identifier(type_identifiers_); + register_BarUpdate_type_identifier(type_identifiers_); } - LicencePlateRspPubSubType::LicencePlateRspPubSubType() + LightsUpdatePubSubType::LightsUpdatePubSubType() { - set_name("InternalSystem::LicencePlateRsp"); - uint32_t type_size = InternalSystem_LicencePlateRsp_max_cdr_typesize; + set_name("WeighingSystem::LightsUpdate"); + uint32_t type_size = WeighingSystem_LightsUpdate_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; + uint32_t key_length = WeighingSystem_LightsUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_LightsUpdate_max_key_cdr_typesize : 16; key_buffer_ = reinterpret_cast(malloc(key_length)); memset(key_buffer_, 0, key_length); } - LicencePlateRspPubSubType::~LicencePlateRspPubSubType() + LightsUpdatePubSubType::~LightsUpdatePubSubType() { if (key_buffer_ != nullptr) { @@ -234,12 +1508,12 @@ namespace InternalSystem { } } - bool LicencePlateRspPubSubType::serialize( + bool LightsUpdatePubSubType::serialize( const void* const data, SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const LicencePlateRsp* p_type = static_cast(data); + const LightsUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); @@ -271,14 +1545,14 @@ namespace InternalSystem { return true; } - bool LicencePlateRspPubSubType::deserialize( + bool LightsUpdatePubSubType::deserialize( SerializedPayload_t& payload, void* data) { try { // Convert DATA to pointer of your type - LicencePlateRsp* p_type = static_cast(data); + LightsUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -301,7 +1575,7 @@ namespace InternalSystem { return true; } - uint32_t LicencePlateRspPubSubType::calculate_serialized_size( + uint32_t LightsUpdatePubSubType::calculate_serialized_size( const void* const data, DataRepresentationId_t data_representation) { @@ -312,7 +1586,7 @@ namespace InternalSystem { 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)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -321,18 +1595,18 @@ namespace InternalSystem { } } - void* LicencePlateRspPubSubType::create_data() + void* LightsUpdatePubSubType::create_data() { - return reinterpret_cast(new LicencePlateRsp()); + return reinterpret_cast(new LightsUpdate()); } - void LicencePlateRspPubSubType::delete_data( + void LightsUpdatePubSubType::delete_data( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool LicencePlateRspPubSubType::compute_key( + bool LightsUpdatePubSubType::compute_key( SerializedPayload_t& payload, InstanceHandle_t& handle, bool force_md5) @@ -342,7 +1616,7 @@ namespace InternalSystem { return false; } - LicencePlateRsp data; + LightsUpdate data; if (deserialize(payload, static_cast(&data))) { return compute_key(static_cast(&data), handle, force_md5); @@ -351,7 +1625,7 @@ namespace InternalSystem { return false; } - bool LicencePlateRspPubSubType::compute_key( + bool LightsUpdatePubSubType::compute_key( const void* const data, InstanceHandle_t& handle, bool force_md5) @@ -361,17 +1635,17 @@ namespace InternalSystem { return false; } - const LicencePlateRsp* p_type = static_cast(data); + const LightsUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - InternalSystem_LicencePlateRsp_max_key_cdr_typesize); + WeighingSystem_LightsUpdate_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) + if (force_md5 || WeighingSystem_LightsUpdate_max_key_cdr_typesize > 16) { md5_.init(); md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); @@ -391,24 +1665,24 @@ namespace InternalSystem { return true; } - void LicencePlateRspPubSubType::register_type_object_representation() + void LightsUpdatePubSubType::register_type_object_representation() { - register_LicencePlateRsp_type_identifier(type_identifiers_); + register_LightsUpdate_type_identifier(type_identifiers_); } - PrintReqPubSubType::PrintReqPubSubType() + InfraredUpdatePubSubType::InfraredUpdatePubSubType() { - set_name("InternalSystem::PrintReq"); - uint32_t type_size = InternalSystem_PrintReq_max_cdr_typesize; + set_name("WeighingSystem::InfraredUpdate"); + uint32_t type_size = WeighingSystem_InfraredUpdate_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; + uint32_t key_length = WeighingSystem_InfraredUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_InfraredUpdate_max_key_cdr_typesize : 16; key_buffer_ = reinterpret_cast(malloc(key_length)); memset(key_buffer_, 0, key_length); } - PrintReqPubSubType::~PrintReqPubSubType() + InfraredUpdatePubSubType::~InfraredUpdatePubSubType() { if (key_buffer_ != nullptr) { @@ -416,12 +1690,12 @@ namespace InternalSystem { } } - bool PrintReqPubSubType::serialize( + bool InfraredUpdatePubSubType::serialize( const void* const data, SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const PrintReq* p_type = static_cast(data); + const InfraredUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); @@ -453,14 +1727,14 @@ namespace InternalSystem { return true; } - bool PrintReqPubSubType::deserialize( + bool InfraredUpdatePubSubType::deserialize( SerializedPayload_t& payload, void* data) { try { // Convert DATA to pointer of your type - PrintReq* p_type = static_cast(data); + InfraredUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -483,7 +1757,7 @@ namespace InternalSystem { return true; } - uint32_t PrintReqPubSubType::calculate_serialized_size( + uint32_t InfraredUpdatePubSubType::calculate_serialized_size( const void* const data, DataRepresentationId_t data_representation) { @@ -494,7 +1768,7 @@ namespace InternalSystem { 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)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -503,18 +1777,18 @@ namespace InternalSystem { } } - void* PrintReqPubSubType::create_data() + void* InfraredUpdatePubSubType::create_data() { - return reinterpret_cast(new PrintReq()); + return reinterpret_cast(new InfraredUpdate()); } - void PrintReqPubSubType::delete_data( + void InfraredUpdatePubSubType::delete_data( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool PrintReqPubSubType::compute_key( + bool InfraredUpdatePubSubType::compute_key( SerializedPayload_t& payload, InstanceHandle_t& handle, bool force_md5) @@ -524,7 +1798,7 @@ namespace InternalSystem { return false; } - PrintReq data; + InfraredUpdate data; if (deserialize(payload, static_cast(&data))) { return compute_key(static_cast(&data), handle, force_md5); @@ -533,7 +1807,7 @@ namespace InternalSystem { return false; } - bool PrintReqPubSubType::compute_key( + bool InfraredUpdatePubSubType::compute_key( const void* const data, InstanceHandle_t& handle, bool force_md5) @@ -543,17 +1817,17 @@ namespace InternalSystem { return false; } - const PrintReq* p_type = static_cast(data); + const InfraredUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - InternalSystem_PrintReq_max_key_cdr_typesize); + WeighingSystem_InfraredUpdate_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) + if (force_md5 || WeighingSystem_InfraredUpdate_max_key_cdr_typesize > 16) { md5_.init(); md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); @@ -573,24 +1847,24 @@ namespace InternalSystem { return true; } - void PrintReqPubSubType::register_type_object_representation() + void InfraredUpdatePubSubType::register_type_object_representation() { - register_PrintReq_type_identifier(type_identifiers_); + register_InfraredUpdate_type_identifier(type_identifiers_); } - PrintRspPubSubType::PrintRspPubSubType() + LicenseSnapUpdatePubSubType::LicenseSnapUpdatePubSubType() { - set_name("InternalSystem::PrintRsp"); - uint32_t type_size = InternalSystem_PrintRsp_max_cdr_typesize; + set_name("WeighingSystem::LicenseSnapUpdate"); + uint32_t type_size = WeighingSystem_LicenseSnapUpdate_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; + uint32_t key_length = WeighingSystem_LicenseSnapUpdate_max_key_cdr_typesize > 16 ? WeighingSystem_LicenseSnapUpdate_max_key_cdr_typesize : 16; key_buffer_ = reinterpret_cast(malloc(key_length)); memset(key_buffer_, 0, key_length); } - PrintRspPubSubType::~PrintRspPubSubType() + LicenseSnapUpdatePubSubType::~LicenseSnapUpdatePubSubType() { if (key_buffer_ != nullptr) { @@ -598,12 +1872,12 @@ namespace InternalSystem { } } - bool PrintRspPubSubType::serialize( + bool LicenseSnapUpdatePubSubType::serialize( const void* const data, SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const PrintRsp* p_type = static_cast(data); + const LicenseSnapUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); @@ -635,14 +1909,14 @@ namespace InternalSystem { return true; } - bool PrintRspPubSubType::deserialize( + bool LicenseSnapUpdatePubSubType::deserialize( SerializedPayload_t& payload, void* data) { try { // Convert DATA to pointer of your type - PrintRsp* p_type = static_cast(data); + LicenseSnapUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -665,7 +1939,7 @@ namespace InternalSystem { return true; } - uint32_t PrintRspPubSubType::calculate_serialized_size( + uint32_t LicenseSnapUpdatePubSubType::calculate_serialized_size( const void* const data, DataRepresentationId_t data_representation) { @@ -676,7 +1950,7 @@ namespace InternalSystem { 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)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -685,18 +1959,18 @@ namespace InternalSystem { } } - void* PrintRspPubSubType::create_data() + void* LicenseSnapUpdatePubSubType::create_data() { - return reinterpret_cast(new PrintRsp()); + return reinterpret_cast(new LicenseSnapUpdate()); } - void PrintRspPubSubType::delete_data( + void LicenseSnapUpdatePubSubType::delete_data( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool PrintRspPubSubType::compute_key( + bool LicenseSnapUpdatePubSubType::compute_key( SerializedPayload_t& payload, InstanceHandle_t& handle, bool force_md5) @@ -706,7 +1980,7 @@ namespace InternalSystem { return false; } - PrintRsp data; + LicenseSnapUpdate data; if (deserialize(payload, static_cast(&data))) { return compute_key(static_cast(&data), handle, force_md5); @@ -715,7 +1989,7 @@ namespace InternalSystem { return false; } - bool PrintRspPubSubType::compute_key( + bool LicenseSnapUpdatePubSubType::compute_key( const void* const data, InstanceHandle_t& handle, bool force_md5) @@ -725,17 +1999,17 @@ namespace InternalSystem { return false; } - const PrintRsp* p_type = static_cast(data); + const LicenseSnapUpdate* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - InternalSystem_PrintRsp_max_key_cdr_typesize); + WeighingSystem_LicenseSnapUpdate_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) + if (force_md5 || WeighingSystem_LicenseSnapUpdate_max_key_cdr_typesize > 16) { md5_.init(); md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); @@ -755,24 +2029,209 @@ namespace InternalSystem { return true; } - void PrintRspPubSubType::register_type_object_representation() + void LicenseSnapUpdatePubSubType::register_type_object_representation() { - register_PrintRsp_type_identifier(type_identifiers_); + register_LicenseSnapUpdate_type_identifier(type_identifiers_); + } + + VoicePubSubType::VoicePubSubType() + { + set_name("WeighingSystem::Voice"); + uint32_t type_size = WeighingSystem_Voice_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 = WeighingSystem_Voice_max_key_cdr_typesize > 16 ? WeighingSystem_Voice_max_key_cdr_typesize : 16; + key_buffer_ = reinterpret_cast(malloc(key_length)); + memset(key_buffer_, 0, key_length); + } + + VoicePubSubType::~VoicePubSubType() + { + if (key_buffer_ != nullptr) + { + free(key_buffer_); + } + } + + bool VoicePubSubType::serialize( + const void* const data, + SerializedPayload_t& payload, + DataRepresentationId_t data_representation) + { + const Voice* 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 + { + // 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; + } + + // Get the serialized length + payload.length = static_cast(ser.get_serialized_data_length()); + return true; + } + + bool VoicePubSubType::deserialize( + SerializedPayload_t& payload, + void* data) + { + try + { + // Convert DATA to pointer of your type + Voice* 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); + + // 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; + } + + return true; + } + + uint32_t VoicePubSubType::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; + } + } + + void* VoicePubSubType::create_data() + { + return reinterpret_cast(new Voice()); + } + + void VoicePubSubType::delete_data( + void* data) + { + delete(reinterpret_cast(data)); + } + + bool VoicePubSubType::compute_key( + SerializedPayload_t& payload, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + Voice data; + if (deserialize(payload, static_cast(&data))) + { + return compute_key(static_cast(&data), handle, force_md5); + } + + return false; + } + + bool VoicePubSubType::compute_key( + const void* const data, + InstanceHandle_t& handle, + bool force_md5) + { + if (!is_compute_key_provided) + { + return false; + } + + const Voice* p_type = static_cast(data); + + // Object that manages the raw buffer. + eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), + WeighingSystem_Voice_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 || WeighingSystem_Voice_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; + } + + void VoicePubSubType::register_type_object_representation() + { + register_Voice_type_identifier(type_identifiers_); } - WeighReqPubSubType::WeighReqPubSubType() +} // namespace WeighingSystem + +namespace InternalSystem { + PrintReqPubSubType::PrintReqPubSubType() { - set_name("InternalSystem::WeighReq"); - uint32_t type_size = InternalSystem_WeighReq_max_cdr_typesize; + 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_WeighReq_max_key_cdr_typesize > 16 ? InternalSystem_WeighReq_max_key_cdr_typesize : 16; + 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); } - WeighReqPubSubType::~WeighReqPubSubType() + PrintReqPubSubType::~PrintReqPubSubType() { if (key_buffer_ != nullptr) { @@ -780,12 +2239,12 @@ namespace InternalSystem { } } - bool WeighReqPubSubType::serialize( + bool PrintReqPubSubType::serialize( const void* const data, SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const WeighReq* 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.max_size); @@ -817,14 +2276,14 @@ namespace InternalSystem { return true; } - bool WeighReqPubSubType::deserialize( + bool PrintReqPubSubType::deserialize( SerializedPayload_t& payload, void* data) { try { // Convert DATA to pointer of your type - WeighReq* p_type = static_cast(data); + PrintReq* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -847,7 +2306,7 @@ namespace InternalSystem { return true; } - uint32_t WeighReqPubSubType::calculate_serialized_size( + uint32_t PrintReqPubSubType::calculate_serialized_size( const void* const data, DataRepresentationId_t data_representation) { @@ -858,7 +2317,7 @@ namespace InternalSystem { 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)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -867,18 +2326,18 @@ namespace InternalSystem { } } - void* WeighReqPubSubType::create_data() + void* PrintReqPubSubType::create_data() { - return reinterpret_cast(new WeighReq()); + return reinterpret_cast(new PrintReq()); } - void WeighReqPubSubType::delete_data( + void PrintReqPubSubType::delete_data( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool WeighReqPubSubType::compute_key( + bool PrintReqPubSubType::compute_key( SerializedPayload_t& payload, InstanceHandle_t& handle, bool force_md5) @@ -888,7 +2347,7 @@ namespace InternalSystem { return false; } - WeighReq data; + PrintReq data; if (deserialize(payload, static_cast(&data))) { return compute_key(static_cast(&data), handle, force_md5); @@ -897,7 +2356,7 @@ namespace InternalSystem { return false; } - bool WeighReqPubSubType::compute_key( + bool PrintReqPubSubType::compute_key( const void* const data, InstanceHandle_t& handle, bool force_md5) @@ -907,17 +2366,17 @@ namespace InternalSystem { return false; } - const WeighReq* p_type = static_cast(data); + const PrintReq* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - InternalSystem_WeighReq_max_key_cdr_typesize); + 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_WeighReq_max_key_cdr_typesize > 16) + if (force_md5 || InternalSystem_PrintReq_max_key_cdr_typesize > 16) { md5_.init(); md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); @@ -937,24 +2396,24 @@ namespace InternalSystem { return true; } - void WeighReqPubSubType::register_type_object_representation() + void PrintReqPubSubType::register_type_object_representation() { - register_WeighReq_type_identifier(type_identifiers_); + register_PrintReq_type_identifier(type_identifiers_); } - WeighRspPubSubType::WeighRspPubSubType() + PrintRspPubSubType::PrintRspPubSubType() { - set_name("InternalSystem::WeighRsp"); - uint32_t type_size = InternalSystem_WeighRsp_max_cdr_typesize; + 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_WeighRsp_max_key_cdr_typesize > 16 ? InternalSystem_WeighRsp_max_key_cdr_typesize : 16; + 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); } - WeighRspPubSubType::~WeighRspPubSubType() + PrintRspPubSubType::~PrintRspPubSubType() { if (key_buffer_ != nullptr) { @@ -962,12 +2421,12 @@ namespace InternalSystem { } } - bool WeighRspPubSubType::serialize( + bool PrintRspPubSubType::serialize( const void* const data, SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const WeighRsp* 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.max_size); @@ -999,14 +2458,14 @@ namespace InternalSystem { return true; } - bool WeighRspPubSubType::deserialize( + bool PrintRspPubSubType::deserialize( SerializedPayload_t& payload, void* data) { try { // Convert DATA to pointer of your type - WeighRsp* p_type = static_cast(data); + PrintRsp* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -1029,7 +2488,7 @@ namespace InternalSystem { return true; } - uint32_t WeighRspPubSubType::calculate_serialized_size( + uint32_t PrintRspPubSubType::calculate_serialized_size( const void* const data, DataRepresentationId_t data_representation) { @@ -1040,7 +2499,7 @@ namespace InternalSystem { 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)) + + *static_cast(data), current_alignment)) + 4u /*encapsulation*/; } catch (eprosima::fastcdr::exception::Exception& /*exception*/) @@ -1049,18 +2508,18 @@ namespace InternalSystem { } } - void* WeighRspPubSubType::create_data() + void* PrintRspPubSubType::create_data() { - return reinterpret_cast(new WeighRsp()); + return reinterpret_cast(new PrintRsp()); } - void WeighRspPubSubType::delete_data( + void PrintRspPubSubType::delete_data( void* data) { - delete(reinterpret_cast(data)); + delete(reinterpret_cast(data)); } - bool WeighRspPubSubType::compute_key( + bool PrintRspPubSubType::compute_key( SerializedPayload_t& payload, InstanceHandle_t& handle, bool force_md5) @@ -1070,7 +2529,7 @@ namespace InternalSystem { return false; } - WeighRsp data; + PrintRsp data; if (deserialize(payload, static_cast(&data))) { return compute_key(static_cast(&data), handle, force_md5); @@ -1079,7 +2538,7 @@ namespace InternalSystem { return false; } - bool WeighRspPubSubType::compute_key( + bool PrintRspPubSubType::compute_key( const void* const data, InstanceHandle_t& handle, bool force_md5) @@ -1089,17 +2548,17 @@ namespace InternalSystem { return false; } - const WeighRsp* p_type = static_cast(data); + const PrintRsp* p_type = static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - InternalSystem_WeighRsp_max_key_cdr_typesize); + 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_WeighRsp_max_key_cdr_typesize > 16) + if (force_md5 || InternalSystem_PrintRsp_max_key_cdr_typesize > 16) { md5_.init(); md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); @@ -1119,9 +2578,9 @@ namespace InternalSystem { return true; } - void WeighRspPubSubType::register_type_object_representation() + void PrintRspPubSubType::register_type_object_representation() { - register_WeighRsp_type_identifier(type_identifiers_); + register_PrintRsp_type_identifier(type_identifiers_); } IoCtrlReqPubSubType::IoCtrlReqPubSubType() diff --git a/lib/SystemPubSubTypes.hpp b/lib/SystemPubSubTypes.hpp index c35a6c8..093759a 100644 --- a/lib/SystemPubSubTypes.hpp +++ b/lib/SystemPubSubTypes.hpp @@ -37,22 +37,22 @@ Generated System is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // FASTDDS_GEN_API_VER -namespace InternalSystem +namespace WeighingSystem { /*! - * @brief This class represents the TopicDataType of the type LicencePlateReq defined by the user in the IDL file. + * @brief This class represents the TopicDataType of the type ScaleInfo defined by the user in the IDL file. * @ingroup System */ - class LicencePlateReqPubSubType : public eprosima::fastdds::dds::TopicDataType + class ScaleInfoPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef LicencePlateReq type; + typedef ScaleInfo type; - eProsima_user_DllExport LicencePlateReqPubSubType(); + eProsima_user_DllExport ScaleInfoPubSubType(); - eProsima_user_DllExport ~LicencePlateReqPubSubType() override; + eProsima_user_DllExport ~ScaleInfoPubSubType() override; eProsima_user_DllExport bool serialize( const void* const data, @@ -88,9 +88,90 @@ namespace InternalSystem #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + + #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; } + #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 ScaleCommand defined by the user in the IDL file. + * @ingroup System + */ + class ScaleCommandPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef ScaleCommand type; + + eProsima_user_DllExport ScaleCommandPubSubType(); + + eProsima_user_DllExport ~ScaleCommandPubSubType() 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 deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -122,18 +203,18 @@ namespace InternalSystem }; /*! - * @brief This class represents the TopicDataType of the type LicencePlateRsp defined by the user in the IDL file. + * @brief This class represents the TopicDataType of the type WeightInfoOk defined by the user in the IDL file. * @ingroup System */ - class LicencePlateRspPubSubType : public eprosima::fastdds::dds::TopicDataType + class WeightInfoOkPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef LicencePlateRsp type; + typedef WeightInfoOk type; - eProsima_user_DllExport LicencePlateRspPubSubType(); + eProsima_user_DllExport WeightInfoOkPubSubType(); - eProsima_user_DllExport ~LicencePlateRspPubSubType() override; + eProsima_user_DllExport ~WeightInfoOkPubSubType() override; eProsima_user_DllExport bool serialize( const void* const data, @@ -203,18 +284,18 @@ namespace InternalSystem }; /*! - * @brief This class represents the TopicDataType of the type PrintReq defined by the user in the IDL file. + * @brief This class represents the TopicDataType of the type WeightInfoError defined by the user in the IDL file. * @ingroup System */ - class PrintReqPubSubType : public eprosima::fastdds::dds::TopicDataType + class WeightInfoErrorPubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef PrintReq type; + typedef WeightInfoError type; - eProsima_user_DllExport PrintReqPubSubType(); + eProsima_user_DllExport WeightInfoErrorPubSubType(); - eProsima_user_DllExport ~PrintReqPubSubType() override; + eProsima_user_DllExport ~WeightInfoErrorPubSubType() override; eProsima_user_DllExport bool serialize( const void* const data, @@ -284,18 +365,18 @@ namespace InternalSystem }; /*! - * @brief This class represents the TopicDataType of the type PrintRsp defined by the user in the IDL file. + * @brief This class represents the TopicDataType of the type BarCommandUpdate defined by the user in the IDL file. * @ingroup System */ - class PrintRspPubSubType : public eprosima::fastdds::dds::TopicDataType + class BarCommandUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef PrintRsp type; + typedef BarCommandUpdate type; - eProsima_user_DllExport PrintRspPubSubType(); + eProsima_user_DllExport BarCommandUpdatePubSubType(); - eProsima_user_DllExport ~PrintRspPubSubType() override; + eProsima_user_DllExport ~BarCommandUpdatePubSubType() override; eProsima_user_DllExport bool serialize( const void* const data, @@ -331,9 +412,90 @@ namespace InternalSystem #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + + #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; } + #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 LightsCommandUpdate defined by the user in the IDL file. + * @ingroup System + */ + class LightsCommandUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LightsCommandUpdate type; + + eProsima_user_DllExport LightsCommandUpdatePubSubType(); + + eProsima_user_DllExport ~LightsCommandUpdatePubSubType() 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 deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -365,18 +527,18 @@ namespace InternalSystem }; /*! - * @brief This class represents the TopicDataType of the type WeighReq defined by the user in the IDL file. + * @brief This class represents the TopicDataType of the type InfraredCommandUpdate defined by the user in the IDL file. * @ingroup System */ - class WeighReqPubSubType : public eprosima::fastdds::dds::TopicDataType + class InfraredCommandUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef WeighReq type; + typedef InfraredCommandUpdate type; - eProsima_user_DllExport WeighReqPubSubType(); + eProsima_user_DllExport InfraredCommandUpdatePubSubType(); - eProsima_user_DllExport ~WeighReqPubSubType() override; + eProsima_user_DllExport ~InfraredCommandUpdatePubSubType() override; eProsima_user_DllExport bool serialize( const void* const data, @@ -412,9 +574,90 @@ namespace InternalSystem #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED eProsima_user_DllExport inline bool is_bounded() const override { + return true; + } + + #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; } + #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 BarUpdate defined by the user in the IDL file. + * @ingroup System + */ + class BarUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef BarUpdate type; + + eProsima_user_DllExport BarUpdatePubSubType(); + + eProsima_user_DllExport ~BarUpdatePubSubType() 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 deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + #endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED #ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN @@ -446,18 +689,18 @@ namespace InternalSystem }; /*! - * @brief This class represents the TopicDataType of the type WeighRsp defined by the user in the IDL file. + * @brief This class represents the TopicDataType of the type LightsUpdate defined by the user in the IDL file. * @ingroup System */ - class WeighRspPubSubType : public eprosima::fastdds::dds::TopicDataType + class LightsUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType { public: - typedef WeighRsp type; + typedef LightsUpdate type; - eProsima_user_DllExport WeighRspPubSubType(); + eProsima_user_DllExport LightsUpdatePubSubType(); - eProsima_user_DllExport ~WeighRspPubSubType() override; + eProsima_user_DllExport ~LightsUpdatePubSubType() override; eProsima_user_DllExport bool serialize( const void* const data, @@ -526,6 +769,414 @@ namespace InternalSystem }; + /*! + * @brief This class represents the TopicDataType of the type InfraredUpdate defined by the user in the IDL file. + * @ingroup System + */ + class InfraredUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef InfraredUpdate type; + + eProsima_user_DllExport InfraredUpdatePubSubType(); + + eProsima_user_DllExport ~InfraredUpdatePubSubType() 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 deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED + eProsima_user_DllExport inline bool is_bounded() const override + { + return true; + } + + #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; + } + + #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 LicenseSnapUpdate defined by the user in the IDL file. + * @ingroup System + */ + class LicenseSnapUpdatePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef LicenseSnapUpdate type; + + eProsima_user_DllExport LicenseSnapUpdatePubSubType(); + + eProsima_user_DllExport ~LicenseSnapUpdatePubSubType() 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 deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #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_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; + } + + #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 Voice defined by the user in the IDL file. + * @ingroup System + */ + class VoicePubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef Voice type; + + eProsima_user_DllExport VoicePubSubType(); + + eProsima_user_DllExport ~VoicePubSubType() 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 deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #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_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; + } + + #endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE + + private: + + eprosima::fastdds::MD5 md5_; + unsigned char* key_buffer_; + + }; +} // namespace WeighingSystem +namespace InternalSystem +{ + + /*! + * @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: + + typedef PrintReq type; + + eProsima_user_DllExport PrintReqPubSubType(); + + 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; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #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_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; + } + + #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 PrintRsp defined by the user in the IDL file. + * @ingroup System + */ + class PrintRspPubSubType : public eprosima::fastdds::dds::TopicDataType + { + public: + + typedef PrintRsp type; + + eProsima_user_DllExport PrintRspPubSubType(); + + 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; + + eProsima_user_DllExport bool deserialize( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + void* 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 bool compute_key( + eprosima::fastdds::rtps::SerializedPayload_t& payload, + eprosima::fastdds::rtps::InstanceHandle_t& ihandle, + bool force_md5 = false) 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* create_data() override; + + eProsima_user_DllExport void delete_data( + void* data) override; + + //Register TypeObject representation in Fast DDS TypeObjectRegistry + eProsima_user_DllExport void register_type_object_representation() override; + + #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_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; + } + + #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 IoCtrlReq defined by the user in the IDL file. * @ingroup System diff --git a/lib/SystemTypeObjectSupport.cxx b/lib/SystemTypeObjectSupport.cxx index 4575eae..ab59ab6 100644 --- a/lib/SystemTypeObjectSupport.cxx +++ b/lib/SystemTypeObjectSupport.cxx @@ -38,268 +38,2160 @@ using namespace eprosima::fastdds::dds::xtypes; -namespace InternalSystem { +namespace WeighingSystem { // TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method -void register_LicencePlateReq_type_identifier( - TypeIdentifierPair& type_ids_LicencePlateReq) +void register_ScaleInfo_type_identifier( + TypeIdentifierPair& type_ids_ScaleInfo) { - ReturnCode_t return_code_LicencePlateReq {eprosima::fastdds::dds::RETCODE_OK}; - return_code_LicencePlateReq = + ReturnCode_t return_code_ScaleInfo {eprosima::fastdds::dds::RETCODE_OK}; + return_code_ScaleInfo = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "InternalSystem::LicencePlateReq", type_ids_LicencePlateReq); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicencePlateReq) + "WeighingSystem::ScaleInfo", type_ids_ScaleInfo); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_ScaleInfo) { - StructTypeFlag struct_flags_LicencePlateReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + StructTypeFlag struct_flags_ScaleInfo = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - QualifiedTypeName type_name_LicencePlateReq = "InternalSystem::LicencePlateReq"; - eprosima::fastcdr::optional type_ann_builtin_LicencePlateReq; - eprosima::fastcdr::optional 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); - CompleteStructMemberSeq member_seq_LicencePlateReq; + QualifiedTypeName type_name_ScaleInfo = "WeighingSystem::ScaleInfo"; + eprosima::fastcdr::optional type_ann_builtin_ScaleInfo; + eprosima::fastcdr::optional ann_custom_ScaleInfo; + CompleteTypeDetail detail_ScaleInfo = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ScaleInfo, ann_custom_ScaleInfo, type_name_ScaleInfo.to_string()); + CompleteStructHeader header_ScaleInfo; + header_ScaleInfo = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ScaleInfo); + CompleteStructMemberSeq member_seq_ScaleInfo; { - TypeIdentifierPair type_ids_index; - ReturnCode_t return_code_index {eprosima::fastdds::dds::RETCODE_OK}; - return_code_index = + TypeIdentifierPair type_ids_HasVehicle; + ReturnCode_t return_code_HasVehicle {eprosima::fastdds::dds::RETCODE_OK}; + return_code_HasVehicle = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_index); + "_bool", type_ids_HasVehicle); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_index) + if (eprosima::fastdds::dds::RETCODE_OK != return_code_HasVehicle) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + "HasVehicle Structure member TypeIdentifier unknown to TypeObjectRegistry."); return; } - StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + StructMemberFlag member_flags_HasVehicle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, false, false, false, false); - MemberId member_id_index = 0x00000000; - bool common_index_ec {false}; - CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_index, common_index_ec))}; - if (!common_index_ec) + MemberId member_id_HasVehicle = 0x00000000; + bool common_HasVehicle_ec {false}; + CommonStructMember common_HasVehicle {TypeObjectUtils::build_common_struct_member(member_id_HasVehicle, member_flags_HasVehicle, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_HasVehicle, common_HasVehicle_ec))}; + if (!common_HasVehicle_ec) { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure index member TypeIdentifier inconsistent."); + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure HasVehicle member TypeIdentifier inconsistent."); return; } - MemberName name_index = "index"; - eprosima::fastcdr::optional member_ann_builtin_index; - ann_custom_LicencePlateReq.reset(); - CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_LicencePlateReq); - CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); - TypeObjectUtils::add_complete_struct_member(member_seq_LicencePlateReq, member_index); + MemberName name_HasVehicle = "HasVehicle"; + eprosima::fastcdr::optional member_ann_builtin_HasVehicle; + ann_custom_ScaleInfo.reset(); + CompleteMemberDetail detail_HasVehicle = TypeObjectUtils::build_complete_member_detail(name_HasVehicle, member_ann_builtin_HasVehicle, ann_custom_ScaleInfo); + CompleteStructMember member_HasVehicle = TypeObjectUtils::build_complete_struct_member(common_HasVehicle, detail_HasVehicle); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleInfo, member_HasVehicle); } { - TypeIdentifierPair type_ids_msg; - ReturnCode_t return_code_msg {eprosima::fastdds::dds::RETCODE_OK}; - return_code_msg = + TypeIdentifierPair type_ids_WeightOK; + ReturnCode_t return_code_WeightOK {eprosima::fastdds::dds::RETCODE_OK}; + return_code_WeightOK = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded", type_ids_msg); + "_bool", type_ids_WeightOK); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg) + if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeightOK) { - return_code_msg = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_msg); + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeightOK Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_WeightOK = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_WeightOK = 0x00000001; + bool common_WeightOK_ec {false}; + CommonStructMember common_WeightOK {TypeObjectUtils::build_common_struct_member(member_id_WeightOK, member_flags_WeightOK, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_WeightOK, common_WeightOK_ec))}; + if (!common_WeightOK_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure WeightOK member TypeIdentifier inconsistent."); + return; + } + MemberName name_WeightOK = "WeightOK"; + eprosima::fastcdr::optional member_ann_builtin_WeightOK; + ann_custom_ScaleInfo.reset(); + CompleteMemberDetail detail_WeightOK = TypeObjectUtils::build_complete_member_detail(name_WeightOK, member_ann_builtin_WeightOK, ann_custom_ScaleInfo); + CompleteStructMember member_WeightOK = TypeObjectUtils::build_complete_struct_member(common_WeightOK, detail_WeightOK); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleInfo, member_WeightOK); + } + { + TypeIdentifierPair type_ids_State; + ReturnCode_t return_code_State {eprosima::fastdds::dds::RETCODE_OK}; + return_code_State = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_State); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg) + if (eprosima::fastdds::dds::RETCODE_OK != return_code_State) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "State Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_State = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_State = 0x00000002; + bool common_State_ec {false}; + CommonStructMember common_State {TypeObjectUtils::build_common_struct_member(member_id_State, member_flags_State, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_State, common_State_ec))}; + if (!common_State_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure State member TypeIdentifier inconsistent."); + return; + } + MemberName name_State = "State"; + eprosima::fastcdr::optional member_ann_builtin_State; + ann_custom_ScaleInfo.reset(); + CompleteMemberDetail detail_State = TypeObjectUtils::build_complete_member_detail(name_State, member_ann_builtin_State, ann_custom_ScaleInfo); + CompleteStructMember member_State = TypeObjectUtils::build_complete_struct_member(common_State, detail_State); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleInfo, member_State); + } + { + TypeIdentifierPair type_ids_Value; + ReturnCode_t return_code_Value {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Value = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Value); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Value) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Value Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_Value = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Value = 0x00000003; + bool common_Value_ec {false}; + CommonStructMember common_Value {TypeObjectUtils::build_common_struct_member(member_id_Value, member_flags_Value, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Value, common_Value_ec))}; + if (!common_Value_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Value member TypeIdentifier inconsistent."); + return; + } + MemberName name_Value = "Value"; + eprosima::fastcdr::optional member_ann_builtin_Value; + ann_custom_ScaleInfo.reset(); + CompleteMemberDetail detail_Value = TypeObjectUtils::build_complete_member_detail(name_Value, member_ann_builtin_Value, ann_custom_ScaleInfo); + CompleteStructMember member_Value = TypeObjectUtils::build_complete_struct_member(common_Value, detail_Value); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleInfo, member_Value); + } + { + TypeIdentifierPair type_ids_StableValue; + ReturnCode_t return_code_StableValue {eprosima::fastdds::dds::RETCODE_OK}; + return_code_StableValue = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_StableValue); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_StableValue) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "StableValue Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_StableValue = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_StableValue = 0x00000004; + bool common_StableValue_ec {false}; + CommonStructMember common_StableValue {TypeObjectUtils::build_common_struct_member(member_id_StableValue, member_flags_StableValue, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_StableValue, common_StableValue_ec))}; + if (!common_StableValue_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure StableValue member TypeIdentifier inconsistent."); + return; + } + MemberName name_StableValue = "StableValue"; + eprosima::fastcdr::optional member_ann_builtin_StableValue; + ann_custom_ScaleInfo.reset(); + CompleteMemberDetail detail_StableValue = TypeObjectUtils::build_complete_member_detail(name_StableValue, member_ann_builtin_StableValue, ann_custom_ScaleInfo); + CompleteStructMember member_StableValue = TypeObjectUtils::build_complete_struct_member(common_StableValue, detail_StableValue); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleInfo, member_StableValue); + } + CompleteStructType struct_type_ScaleInfo = TypeObjectUtils::build_complete_struct_type(struct_flags_ScaleInfo, header_ScaleInfo, member_seq_ScaleInfo); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ScaleInfo, type_name_ScaleInfo.to_string(), type_ids_ScaleInfo)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::ScaleInfo already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_ScaleCommand_type_identifier( + TypeIdentifierPair& type_ids_ScaleCommand) +{ + + ReturnCode_t return_code_ScaleCommand {eprosima::fastdds::dds::RETCODE_OK}; + return_code_ScaleCommand = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::ScaleCommand", type_ids_ScaleCommand); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_ScaleCommand) + { + StructTypeFlag struct_flags_ScaleCommand = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_ScaleCommand = "WeighingSystem::ScaleCommand"; + eprosima::fastcdr::optional type_ann_builtin_ScaleCommand; + eprosima::fastcdr::optional ann_custom_ScaleCommand; + CompleteTypeDetail detail_ScaleCommand = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_ScaleCommand, ann_custom_ScaleCommand, type_name_ScaleCommand.to_string()); + CompleteStructHeader header_ScaleCommand; + header_ScaleCommand = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_ScaleCommand); + CompleteStructMemberSeq member_seq_ScaleCommand; + { + TypeIdentifierPair type_ids_Enable; + ReturnCode_t return_code_Enable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Enable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_Enable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Enable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Enable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_Enable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Enable = 0x00000000; + bool common_Enable_ec {false}; + CommonStructMember common_Enable {TypeObjectUtils::build_common_struct_member(member_id_Enable, member_flags_Enable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Enable, common_Enable_ec))}; + if (!common_Enable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Enable member TypeIdentifier inconsistent."); + return; + } + MemberName name_Enable = "Enable"; + eprosima::fastcdr::optional member_ann_builtin_Enable; + ann_custom_ScaleCommand.reset(); + CompleteMemberDetail detail_Enable = TypeObjectUtils::build_complete_member_detail(name_Enable, member_ann_builtin_Enable, ann_custom_ScaleCommand); + CompleteStructMember member_Enable = TypeObjectUtils::build_complete_struct_member(common_Enable, detail_Enable); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleCommand, member_Enable); + } + { + TypeIdentifierPair type_ids_ResetZero; + ReturnCode_t return_code_ResetZero {eprosima::fastdds::dds::RETCODE_OK}; + return_code_ResetZero = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_ResetZero); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_ResetZero) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "ResetZero Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_ResetZero = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_ResetZero = 0x00000001; + bool common_ResetZero_ec {false}; + CommonStructMember common_ResetZero {TypeObjectUtils::build_common_struct_member(member_id_ResetZero, member_flags_ResetZero, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_ResetZero, common_ResetZero_ec))}; + if (!common_ResetZero_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure ResetZero member TypeIdentifier inconsistent."); + return; + } + MemberName name_ResetZero = "ResetZero"; + eprosima::fastcdr::optional member_ann_builtin_ResetZero; + ann_custom_ScaleCommand.reset(); + CompleteMemberDetail detail_ResetZero = TypeObjectUtils::build_complete_member_detail(name_ResetZero, member_ann_builtin_ResetZero, ann_custom_ScaleCommand); + CompleteStructMember member_ResetZero = TypeObjectUtils::build_complete_struct_member(common_ResetZero, detail_ResetZero); + TypeObjectUtils::add_complete_struct_member(member_seq_ScaleCommand, member_ResetZero); + } + CompleteStructType struct_type_ScaleCommand = TypeObjectUtils::build_complete_struct_type(struct_flags_ScaleCommand, header_ScaleCommand, member_seq_ScaleCommand); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_ScaleCommand, type_name_ScaleCommand.to_string(), type_ids_ScaleCommand)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::ScaleCommand already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_WeightInfoOk_type_identifier( + TypeIdentifierPair& type_ids_WeightInfoOk) +{ + + ReturnCode_t return_code_WeightInfoOk {eprosima::fastdds::dds::RETCODE_OK}; + return_code_WeightInfoOk = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::WeightInfoOk", type_ids_WeightInfoOk); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeightInfoOk) + { + StructTypeFlag struct_flags_WeightInfoOk = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_WeightInfoOk = "WeighingSystem::WeightInfoOk"; + eprosima::fastcdr::optional type_ann_builtin_WeightInfoOk; + eprosima::fastcdr::optional ann_custom_WeightInfoOk; + CompleteTypeDetail detail_WeightInfoOk = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeightInfoOk, ann_custom_WeightInfoOk, type_name_WeightInfoOk.to_string()); + CompleteStructHeader header_WeightInfoOk; + header_WeightInfoOk = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WeightInfoOk); + CompleteStructMemberSeq member_seq_WeightInfoOk; + { + TypeIdentifierPair type_ids_DeviceID; + ReturnCode_t return_code_DeviceID {eprosima::fastdds::dds::RETCODE_OK}; + return_code_DeviceID = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_DeviceID); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_DeviceID) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "DeviceID Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_DeviceID = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_DeviceID = 0x00000000; + bool common_DeviceID_ec {false}; + CommonStructMember common_DeviceID {TypeObjectUtils::build_common_struct_member(member_id_DeviceID, member_flags_DeviceID, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_DeviceID, common_DeviceID_ec))}; + if (!common_DeviceID_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure DeviceID member TypeIdentifier inconsistent."); + return; + } + MemberName name_DeviceID = "DeviceID"; + eprosima::fastcdr::optional member_ann_builtin_DeviceID; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_DeviceID = TypeObjectUtils::build_complete_member_detail(name_DeviceID, member_ann_builtin_DeviceID, ann_custom_WeightInfoOk); + CompleteStructMember member_DeviceID = TypeObjectUtils::build_complete_struct_member(common_DeviceID, detail_DeviceID); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_DeviceID); + } + { + TypeIdentifierPair type_ids_DeviceName; + ReturnCode_t return_code_DeviceName {eprosima::fastdds::dds::RETCODE_OK}; + return_code_DeviceName = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DeviceName); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_DeviceName) + { { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_DeviceName)) { - SBound bound = 0; - StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, - "anonymous_string_unbounded", type_ids_msg)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); - } + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); } } - bool element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec {false}; - TypeIdentifier* element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg, element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec))}; - if (!element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec) + } + StructMemberFlag member_flags_DeviceName = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_DeviceName = 0x00000001; + bool common_DeviceName_ec {false}; + CommonStructMember common_DeviceName {TypeObjectUtils::build_common_struct_member(member_id_DeviceName, member_flags_DeviceName, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_DeviceName, common_DeviceName_ec))}; + if (!common_DeviceName_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure DeviceName member TypeIdentifier inconsistent."); + return; + } + MemberName name_DeviceName = "DeviceName"; + eprosima::fastcdr::optional member_ann_builtin_DeviceName; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_DeviceName = TypeObjectUtils::build_complete_member_detail(name_DeviceName, member_ann_builtin_DeviceName, ann_custom_WeightInfoOk); + CompleteStructMember member_DeviceName = TypeObjectUtils::build_complete_struct_member(common_DeviceName, detail_DeviceName); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_DeviceName); + } + { + TypeIdentifierPair type_ids_DeviceType; + ReturnCode_t return_code_DeviceType {eprosima::fastdds::dds::RETCODE_OK}; + return_code_DeviceType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_DeviceType); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_DeviceType) + { { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded inconsistent element TypeIdentifier."); - return; + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_DeviceType)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } } - return_code_msg = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_msg); + } + StructMemberFlag member_flags_DeviceType = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_DeviceType = 0x00000002; + bool common_DeviceType_ec {false}; + CommonStructMember common_DeviceType {TypeObjectUtils::build_common_struct_member(member_id_DeviceType, member_flags_DeviceType, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_DeviceType, common_DeviceType_ec))}; + if (!common_DeviceType_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure DeviceType member TypeIdentifier inconsistent."); + return; + } + MemberName name_DeviceType = "DeviceType"; + eprosima::fastcdr::optional member_ann_builtin_DeviceType; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_DeviceType = TypeObjectUtils::build_complete_member_detail(name_DeviceType, member_ann_builtin_DeviceType, ann_custom_WeightInfoOk); + CompleteStructMember member_DeviceType = TypeObjectUtils::build_complete_struct_member(common_DeviceType, detail_DeviceType); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_DeviceType); + } + { + TypeIdentifierPair type_ids_EnterpriseName; + ReturnCode_t return_code_EnterpriseName {eprosima::fastdds::dds::RETCODE_OK}; + return_code_EnterpriseName = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_EnterpriseName); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg) + if (eprosima::fastdds::dds::RETCODE_OK != return_code_EnterpriseName) + { { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_EnterpriseName)) { - SBound bound = 0; - StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, - "anonymous_string_unbounded", type_ids_msg)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); - } + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); } } - bool key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec {false}; - TypeIdentifier* key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg, key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec))}; - if (!key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec) + } + StructMemberFlag member_flags_EnterpriseName = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_EnterpriseName = 0x00000003; + bool common_EnterpriseName_ec {false}; + CommonStructMember common_EnterpriseName {TypeObjectUtils::build_common_struct_member(member_id_EnterpriseName, member_flags_EnterpriseName, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_EnterpriseName, common_EnterpriseName_ec))}; + if (!common_EnterpriseName_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure EnterpriseName member TypeIdentifier inconsistent."); + return; + } + MemberName name_EnterpriseName = "EnterpriseName"; + eprosima::fastcdr::optional member_ann_builtin_EnterpriseName; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_EnterpriseName = TypeObjectUtils::build_complete_member_detail(name_EnterpriseName, member_ann_builtin_EnterpriseName, ann_custom_WeightInfoOk); + CompleteStructMember member_EnterpriseName = TypeObjectUtils::build_complete_struct_member(common_EnterpriseName, detail_EnterpriseName); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_EnterpriseName); + } + { + TypeIdentifierPair type_ids_BillNumber; + ReturnCode_t return_code_BillNumber {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BillNumber = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_BillNumber); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BillNumber) + { { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded inconsistent key TypeIdentifier."); - return; + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_BillNumber)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } } - EquivalenceKind equiv_kind_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_ldefn().header().equiv_kind()))) + } + StructMemberFlag member_flags_BillNumber = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BillNumber = 0x00000004; + bool common_BillNumber_ec {false}; + CommonStructMember common_BillNumber {TypeObjectUtils::build_common_struct_member(member_id_BillNumber, member_flags_BillNumber, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BillNumber, common_BillNumber_ec))}; + if (!common_BillNumber_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BillNumber member TypeIdentifier inconsistent."); + return; + } + MemberName name_BillNumber = "BillNumber"; + eprosima::fastcdr::optional member_ann_builtin_BillNumber; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_BillNumber = TypeObjectUtils::build_complete_member_detail(name_BillNumber, member_ann_builtin_BillNumber, ann_custom_WeightInfoOk); + CompleteStructMember member_BillNumber = TypeObjectUtils::build_complete_struct_member(common_BillNumber, detail_BillNumber); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_BillNumber); + } + { + TypeIdentifierPair type_ids_CarNumber; + ReturnCode_t return_code_CarNumber {eprosima::fastdds::dds::RETCODE_OK}; + return_code_CarNumber = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_CarNumber); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_CarNumber) + { { - equiv_kind_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = EK_COMPLETE; + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_CarNumber)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } } - CollectionElementFlag element_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded, element_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded); + } + StructMemberFlag member_flags_CarNumber = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_CarNumber = 0x00000005; + bool common_CarNumber_ec {false}; + CommonStructMember common_CarNumber {TypeObjectUtils::build_common_struct_member(member_id_CarNumber, member_flags_CarNumber, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_CarNumber, common_CarNumber_ec))}; + if (!common_CarNumber_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure CarNumber member TypeIdentifier inconsistent."); + return; + } + MemberName name_CarNumber = "CarNumber"; + eprosima::fastcdr::optional member_ann_builtin_CarNumber; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_CarNumber = TypeObjectUtils::build_complete_member_detail(name_CarNumber, member_ann_builtin_CarNumber, ann_custom_WeightInfoOk); + CompleteStructMember member_CarNumber = TypeObjectUtils::build_complete_struct_member(common_CarNumber, detail_CarNumber); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_CarNumber); + } + { + TypeIdentifierPair type_ids_Supplier; + ReturnCode_t return_code_Supplier {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Supplier = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Supplier); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Supplier) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_Supplier)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_Supplier = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Supplier = 0x00000006; + bool common_Supplier_ec {false}; + CommonStructMember common_Supplier {TypeObjectUtils::build_common_struct_member(member_id_Supplier, member_flags_Supplier, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Supplier, common_Supplier_ec))}; + if (!common_Supplier_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Supplier member TypeIdentifier inconsistent."); + return; + } + MemberName name_Supplier = "Supplier"; + eprosima::fastcdr::optional member_ann_builtin_Supplier; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_Supplier = TypeObjectUtils::build_complete_member_detail(name_Supplier, member_ann_builtin_Supplier, ann_custom_WeightInfoOk); + CompleteStructMember member_Supplier = TypeObjectUtils::build_complete_struct_member(common_Supplier, detail_Supplier); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_Supplier); + } + { + TypeIdentifierPair type_ids_GoodsType; + ReturnCode_t return_code_GoodsType {eprosima::fastdds::dds::RETCODE_OK}; + return_code_GoodsType = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_GoodsType); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_GoodsType) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_GoodsType)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_GoodsType = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_GoodsType = 0x00000007; + bool common_GoodsType_ec {false}; + CommonStructMember common_GoodsType {TypeObjectUtils::build_common_struct_member(member_id_GoodsType, member_flags_GoodsType, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_GoodsType, common_GoodsType_ec))}; + if (!common_GoodsType_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure GoodsType member TypeIdentifier inconsistent."); + return; + } + MemberName name_GoodsType = "GoodsType"; + eprosima::fastcdr::optional member_ann_builtin_GoodsType; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_GoodsType = TypeObjectUtils::build_complete_member_detail(name_GoodsType, member_ann_builtin_GoodsType, ann_custom_WeightInfoOk); + CompleteStructMember member_GoodsType = TypeObjectUtils::build_complete_struct_member(common_GoodsType, detail_GoodsType); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_GoodsType); + } + { + TypeIdentifierPair type_ids_GrossWeight; + ReturnCode_t return_code_GrossWeight {eprosima::fastdds::dds::RETCODE_OK}; + return_code_GrossWeight = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_GrossWeight); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_GrossWeight) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "GrossWeight Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_GrossWeight = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_GrossWeight = 0x00000008; + bool common_GrossWeight_ec {false}; + CommonStructMember common_GrossWeight {TypeObjectUtils::build_common_struct_member(member_id_GrossWeight, member_flags_GrossWeight, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_GrossWeight, common_GrossWeight_ec))}; + if (!common_GrossWeight_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure GrossWeight member TypeIdentifier inconsistent."); + return; + } + MemberName name_GrossWeight = "GrossWeight"; + eprosima::fastcdr::optional member_ann_builtin_GrossWeight; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_GrossWeight = TypeObjectUtils::build_complete_member_detail(name_GrossWeight, member_ann_builtin_GrossWeight, ann_custom_WeightInfoOk); + CompleteStructMember member_GrossWeight = TypeObjectUtils::build_complete_struct_member(common_GrossWeight, detail_GrossWeight); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_GrossWeight); + } + { + TypeIdentifierPair type_ids_GrossTime; + ReturnCode_t return_code_GrossTime {eprosima::fastdds::dds::RETCODE_OK}; + return_code_GrossTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_GrossTime); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_GrossTime) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_GrossTime)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_GrossTime = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_GrossTime = 0x00000009; + bool common_GrossTime_ec {false}; + CommonStructMember common_GrossTime {TypeObjectUtils::build_common_struct_member(member_id_GrossTime, member_flags_GrossTime, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_GrossTime, common_GrossTime_ec))}; + if (!common_GrossTime_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure GrossTime member TypeIdentifier inconsistent."); + return; + } + MemberName name_GrossTime = "GrossTime"; + eprosima::fastcdr::optional member_ann_builtin_GrossTime; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_GrossTime = TypeObjectUtils::build_complete_member_detail(name_GrossTime, member_ann_builtin_GrossTime, ann_custom_WeightInfoOk); + CompleteStructMember member_GrossTime = TypeObjectUtils::build_complete_struct_member(common_GrossTime, detail_GrossTime); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_GrossTime); + } + { + TypeIdentifierPair type_ids_GrossOperater; + ReturnCode_t return_code_GrossOperater {eprosima::fastdds::dds::RETCODE_OK}; + return_code_GrossOperater = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_GrossOperater); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_GrossOperater) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_GrossOperater)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_GrossOperater = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_GrossOperater = 0x0000000a; + bool common_GrossOperater_ec {false}; + CommonStructMember common_GrossOperater {TypeObjectUtils::build_common_struct_member(member_id_GrossOperater, member_flags_GrossOperater, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_GrossOperater, common_GrossOperater_ec))}; + if (!common_GrossOperater_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure GrossOperater member TypeIdentifier inconsistent."); + return; + } + MemberName name_GrossOperater = "GrossOperater"; + eprosima::fastcdr::optional member_ann_builtin_GrossOperater; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_GrossOperater = TypeObjectUtils::build_complete_member_detail(name_GrossOperater, member_ann_builtin_GrossOperater, ann_custom_WeightInfoOk); + CompleteStructMember member_GrossOperater = TypeObjectUtils::build_complete_struct_member(common_GrossOperater, detail_GrossOperater); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_GrossOperater); + } + { + TypeIdentifierPair type_ids_Tare; + ReturnCode_t return_code_Tare {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Tare = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Tare); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Tare) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Tare Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_Tare = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Tare = 0x0000000b; + bool common_Tare_ec {false}; + CommonStructMember common_Tare {TypeObjectUtils::build_common_struct_member(member_id_Tare, member_flags_Tare, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Tare, common_Tare_ec))}; + if (!common_Tare_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Tare member TypeIdentifier inconsistent."); + return; + } + MemberName name_Tare = "Tare"; + eprosima::fastcdr::optional member_ann_builtin_Tare; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_Tare = TypeObjectUtils::build_complete_member_detail(name_Tare, member_ann_builtin_Tare, ann_custom_WeightInfoOk); + CompleteStructMember member_Tare = TypeObjectUtils::build_complete_struct_member(common_Tare, detail_Tare); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_Tare); + } + { + TypeIdentifierPair type_ids_TareTime; + ReturnCode_t return_code_TareTime {eprosima::fastdds::dds::RETCODE_OK}; + return_code_TareTime = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_TareTime); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_TareTime) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_TareTime)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_TareTime = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_TareTime = 0x0000000c; + bool common_TareTime_ec {false}; + CommonStructMember common_TareTime {TypeObjectUtils::build_common_struct_member(member_id_TareTime, member_flags_TareTime, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_TareTime, common_TareTime_ec))}; + if (!common_TareTime_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure TareTime member TypeIdentifier inconsistent."); + return; + } + MemberName name_TareTime = "TareTime"; + eprosima::fastcdr::optional member_ann_builtin_TareTime; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_TareTime = TypeObjectUtils::build_complete_member_detail(name_TareTime, member_ann_builtin_TareTime, ann_custom_WeightInfoOk); + CompleteStructMember member_TareTime = TypeObjectUtils::build_complete_struct_member(common_TareTime, detail_TareTime); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_TareTime); + } + { + TypeIdentifierPair type_ids_TareOperater; + ReturnCode_t return_code_TareOperater {eprosima::fastdds::dds::RETCODE_OK}; + return_code_TareOperater = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_TareOperater); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_TareOperater) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_TareOperater)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_TareOperater = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_TareOperater = 0x0000000d; + bool common_TareOperater_ec {false}; + CommonStructMember common_TareOperater {TypeObjectUtils::build_common_struct_member(member_id_TareOperater, member_flags_TareOperater, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_TareOperater, common_TareOperater_ec))}; + if (!common_TareOperater_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure TareOperater member TypeIdentifier inconsistent."); + return; + } + MemberName name_TareOperater = "TareOperater"; + eprosima::fastcdr::optional member_ann_builtin_TareOperater; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_TareOperater = TypeObjectUtils::build_complete_member_detail(name_TareOperater, member_ann_builtin_TareOperater, ann_custom_WeightInfoOk); + CompleteStructMember member_TareOperater = TypeObjectUtils::build_complete_struct_member(common_TareOperater, detail_TareOperater); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_TareOperater); + } + { + TypeIdentifierPair type_ids_Suttle; + ReturnCode_t return_code_Suttle {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Suttle = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_Suttle); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Suttle) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "Suttle Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_Suttle = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Suttle = 0x0000000e; + bool common_Suttle_ec {false}; + CommonStructMember common_Suttle {TypeObjectUtils::build_common_struct_member(member_id_Suttle, member_flags_Suttle, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Suttle, common_Suttle_ec))}; + if (!common_Suttle_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Suttle member TypeIdentifier inconsistent."); + return; + } + MemberName name_Suttle = "Suttle"; + eprosima::fastcdr::optional member_ann_builtin_Suttle; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_Suttle = TypeObjectUtils::build_complete_member_detail(name_Suttle, member_ann_builtin_Suttle, ann_custom_WeightInfoOk); + CompleteStructMember member_Suttle = TypeObjectUtils::build_complete_struct_member(common_Suttle, detail_Suttle); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_Suttle); + } + { + TypeIdentifierPair type_ids_duduction1; + ReturnCode_t return_code_duduction1 {eprosima::fastdds::dds::RETCODE_OK}; + return_code_duduction1 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_duduction1); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_duduction1) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "duduction1 Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_duduction1 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_duduction1 = 0x0000000f; + bool common_duduction1_ec {false}; + CommonStructMember common_duduction1 {TypeObjectUtils::build_common_struct_member(member_id_duduction1, member_flags_duduction1, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_duduction1, common_duduction1_ec))}; + if (!common_duduction1_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure duduction1 member TypeIdentifier inconsistent."); + return; + } + MemberName name_duduction1 = "duduction1"; + eprosima::fastcdr::optional member_ann_builtin_duduction1; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_duduction1 = TypeObjectUtils::build_complete_member_detail(name_duduction1, member_ann_builtin_duduction1, ann_custom_WeightInfoOk); + CompleteStructMember member_duduction1 = TypeObjectUtils::build_complete_struct_member(common_duduction1, detail_duduction1); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_duduction1); + } + { + TypeIdentifierPair type_ids_duduction2; + ReturnCode_t return_code_duduction2 {eprosima::fastdds::dds::RETCODE_OK}; + return_code_duduction2 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_duduction2); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_duduction2) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "duduction2 Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_duduction2 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_duduction2 = 0x00000010; + bool common_duduction2_ec {false}; + CommonStructMember common_duduction2 {TypeObjectUtils::build_common_struct_member(member_id_duduction2, member_flags_duduction2, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_duduction2, common_duduction2_ec))}; + if (!common_duduction2_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure duduction2 member TypeIdentifier inconsistent."); + return; + } + MemberName name_duduction2 = "duduction2"; + eprosima::fastcdr::optional member_ann_builtin_duduction2; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_duduction2 = TypeObjectUtils::build_complete_member_detail(name_duduction2, member_ann_builtin_duduction2, ann_custom_WeightInfoOk); + CompleteStructMember member_duduction2 = TypeObjectUtils::build_complete_struct_member(common_duduction2, detail_duduction2); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_duduction2); + } + { + TypeIdentifierPair type_ids_duduction3; + ReturnCode_t return_code_duduction3 {eprosima::fastdds::dds::RETCODE_OK}; + return_code_duduction3 = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_float", type_ids_duduction3); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_duduction3) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "duduction3 Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_duduction3 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_duduction3 = 0x00000011; + bool common_duduction3_ec {false}; + CommonStructMember common_duduction3 {TypeObjectUtils::build_common_struct_member(member_id_duduction3, member_flags_duduction3, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_duduction3, common_duduction3_ec))}; + if (!common_duduction3_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure duduction3 member TypeIdentifier inconsistent."); + return; + } + MemberName name_duduction3 = "duduction3"; + eprosima::fastcdr::optional member_ann_builtin_duduction3; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_duduction3 = TypeObjectUtils::build_complete_member_detail(name_duduction3, member_ann_builtin_duduction3, ann_custom_WeightInfoOk); + CompleteStructMember member_duduction3 = TypeObjectUtils::build_complete_struct_member(common_duduction3, detail_duduction3); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_duduction3); + } + { + TypeIdentifierPair type_ids_INCoalYard; + ReturnCode_t return_code_INCoalYard {eprosima::fastdds::dds::RETCODE_OK}; + return_code_INCoalYard = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_INCoalYard); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_INCoalYard) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_INCoalYard)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_INCoalYard = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_INCoalYard = 0x00000012; + bool common_INCoalYard_ec {false}; + CommonStructMember common_INCoalYard {TypeObjectUtils::build_common_struct_member(member_id_INCoalYard, member_flags_INCoalYard, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_INCoalYard, common_INCoalYard_ec))}; + if (!common_INCoalYard_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure INCoalYard member TypeIdentifier inconsistent."); + return; + } + MemberName name_INCoalYard = "INCoalYard"; + eprosima::fastcdr::optional member_ann_builtin_INCoalYard; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_INCoalYard = TypeObjectUtils::build_complete_member_detail(name_INCoalYard, member_ann_builtin_INCoalYard, ann_custom_WeightInfoOk); + CompleteStructMember member_INCoalYard = TypeObjectUtils::build_complete_struct_member(common_INCoalYard, detail_INCoalYard); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_INCoalYard); + } + { + TypeIdentifierPair type_ids_OutCoalYard; + ReturnCode_t return_code_OutCoalYard {eprosima::fastdds::dds::RETCODE_OK}; + return_code_OutCoalYard = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_OutCoalYard); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_OutCoalYard) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_OutCoalYard)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_OutCoalYard = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_OutCoalYard = 0x00000013; + bool common_OutCoalYard_ec {false}; + CommonStructMember common_OutCoalYard {TypeObjectUtils::build_common_struct_member(member_id_OutCoalYard, member_flags_OutCoalYard, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_OutCoalYard, common_OutCoalYard_ec))}; + if (!common_OutCoalYard_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure OutCoalYard member TypeIdentifier inconsistent."); + return; + } + MemberName name_OutCoalYard = "OutCoalYard"; + eprosima::fastcdr::optional member_ann_builtin_OutCoalYard; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_OutCoalYard = TypeObjectUtils::build_complete_member_detail(name_OutCoalYard, member_ann_builtin_OutCoalYard, ann_custom_WeightInfoOk); + CompleteStructMember member_OutCoalYard = TypeObjectUtils::build_complete_struct_member(common_OutCoalYard, detail_OutCoalYard); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_OutCoalYard); + } + { + TypeIdentifierPair type_ids_BatchNumber; + ReturnCode_t return_code_BatchNumber {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BatchNumber = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_BatchNumber); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BatchNumber) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_BatchNumber)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_BatchNumber = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BatchNumber = 0x00000014; + bool common_BatchNumber_ec {false}; + CommonStructMember common_BatchNumber {TypeObjectUtils::build_common_struct_member(member_id_BatchNumber, member_flags_BatchNumber, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BatchNumber, common_BatchNumber_ec))}; + if (!common_BatchNumber_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BatchNumber member TypeIdentifier inconsistent."); + return; + } + MemberName name_BatchNumber = "BatchNumber"; + eprosima::fastcdr::optional member_ann_builtin_BatchNumber; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_BatchNumber = TypeObjectUtils::build_complete_member_detail(name_BatchNumber, member_ann_builtin_BatchNumber, ann_custom_WeightInfoOk); + CompleteStructMember member_BatchNumber = TypeObjectUtils::build_complete_struct_member(common_BatchNumber, detail_BatchNumber); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_BatchNumber); + } + { + TypeIdentifierPair type_ids_Warning; + ReturnCode_t return_code_Warning {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Warning = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Warning); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Warning) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_Warning)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_Warning = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Warning = 0x00000015; + bool common_Warning_ec {false}; + CommonStructMember common_Warning {TypeObjectUtils::build_common_struct_member(member_id_Warning, member_flags_Warning, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Warning, common_Warning_ec))}; + if (!common_Warning_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Warning member TypeIdentifier inconsistent."); + return; + } + MemberName name_Warning = "Warning"; + eprosima::fastcdr::optional member_ann_builtin_Warning; + ann_custom_WeightInfoOk.reset(); + CompleteMemberDetail detail_Warning = TypeObjectUtils::build_complete_member_detail(name_Warning, member_ann_builtin_Warning, ann_custom_WeightInfoOk); + CompleteStructMember member_Warning = TypeObjectUtils::build_complete_struct_member(common_Warning, detail_Warning); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoOk, member_Warning); + } + CompleteStructType struct_type_WeightInfoOk = TypeObjectUtils::build_complete_struct_type(struct_flags_WeightInfoOk, header_WeightInfoOk, member_seq_WeightInfoOk); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeightInfoOk, type_name_WeightInfoOk.to_string(), type_ids_WeightInfoOk)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::WeightInfoOk already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_WeightInfoError_type_identifier( + TypeIdentifierPair& type_ids_WeightInfoError) +{ + + ReturnCode_t return_code_WeightInfoError {eprosima::fastdds::dds::RETCODE_OK}; + return_code_WeightInfoError = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::WeightInfoError", type_ids_WeightInfoError); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeightInfoError) + { + StructTypeFlag struct_flags_WeightInfoError = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_WeightInfoError = "WeighingSystem::WeightInfoError"; + eprosima::fastcdr::optional type_ann_builtin_WeightInfoError; + eprosima::fastcdr::optional ann_custom_WeightInfoError; + CompleteTypeDetail detail_WeightInfoError = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeightInfoError, ann_custom_WeightInfoError, type_name_WeightInfoError.to_string()); + CompleteStructHeader header_WeightInfoError; + header_WeightInfoError = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WeightInfoError); + CompleteStructMemberSeq member_seq_WeightInfoError; + { + TypeIdentifierPair type_ids_CarNumber; + ReturnCode_t return_code_CarNumber {eprosima::fastdds::dds::RETCODE_OK}; + return_code_CarNumber = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_CarNumber); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_CarNumber) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_CarNumber)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_CarNumber = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_CarNumber = 0x00000000; + bool common_CarNumber_ec {false}; + CommonStructMember common_CarNumber {TypeObjectUtils::build_common_struct_member(member_id_CarNumber, member_flags_CarNumber, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_CarNumber, common_CarNumber_ec))}; + if (!common_CarNumber_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure CarNumber member TypeIdentifier inconsistent."); + return; + } + MemberName name_CarNumber = "CarNumber"; + eprosima::fastcdr::optional member_ann_builtin_CarNumber; + ann_custom_WeightInfoError.reset(); + CompleteMemberDetail detail_CarNumber = TypeObjectUtils::build_complete_member_detail(name_CarNumber, member_ann_builtin_CarNumber, ann_custom_WeightInfoError); + CompleteStructMember member_CarNumber = TypeObjectUtils::build_complete_struct_member(common_CarNumber, detail_CarNumber); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoError, member_CarNumber); + } + { + TypeIdentifierPair type_ids_Warning; + ReturnCode_t return_code_Warning {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Warning = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_Warning); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Warning) + { + { + SBound bound = 0; + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_Warning)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); + } + } + } + StructMemberFlag member_flags_Warning = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_Warning = 0x00000001; + bool common_Warning_ec {false}; + CommonStructMember common_Warning {TypeObjectUtils::build_common_struct_member(member_id_Warning, member_flags_Warning, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_Warning, common_Warning_ec))}; + if (!common_Warning_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure Warning member TypeIdentifier inconsistent."); + return; + } + MemberName name_Warning = "Warning"; + eprosima::fastcdr::optional member_ann_builtin_Warning; + ann_custom_WeightInfoError.reset(); + CompleteMemberDetail detail_Warning = TypeObjectUtils::build_complete_member_detail(name_Warning, member_ann_builtin_Warning, ann_custom_WeightInfoError); + CompleteStructMember member_Warning = TypeObjectUtils::build_complete_struct_member(common_Warning, detail_Warning); + TypeObjectUtils::add_complete_struct_member(member_seq_WeightInfoError, member_Warning); + } + CompleteStructType struct_type_WeightInfoError = TypeObjectUtils::build_complete_struct_type(struct_flags_WeightInfoError, header_WeightInfoError, member_seq_WeightInfoError); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeightInfoError, type_name_WeightInfoError.to_string(), type_ids_WeightInfoError)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::WeightInfoError already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_BarCommandUpdate_type_identifier( + TypeIdentifierPair& type_ids_BarCommandUpdate) +{ + + ReturnCode_t return_code_BarCommandUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BarCommandUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::BarCommandUpdate", type_ids_BarCommandUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BarCommandUpdate) + { + StructTypeFlag struct_flags_BarCommandUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_BarCommandUpdate = "WeighingSystem::BarCommandUpdate"; + eprosima::fastcdr::optional type_ann_builtin_BarCommandUpdate; + eprosima::fastcdr::optional ann_custom_BarCommandUpdate; + CompleteTypeDetail detail_BarCommandUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BarCommandUpdate, ann_custom_BarCommandUpdate, type_name_BarCommandUpdate.to_string()); + CompleteStructHeader header_BarCommandUpdate; + header_BarCommandUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BarCommandUpdate); + CompleteStructMemberSeq member_seq_BarCommandUpdate; + { + TypeIdentifierPair type_ids_FrontBarSignalUp; + ReturnCode_t return_code_FrontBarSignalUp {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontBarSignalUp = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontBarSignalUp); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontBarSignalUp) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontBarSignalUp Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontBarSignalUp = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontBarSignalUp = 0x00000000; + bool common_FrontBarSignalUp_ec {false}; + CommonStructMember common_FrontBarSignalUp {TypeObjectUtils::build_common_struct_member(member_id_FrontBarSignalUp, member_flags_FrontBarSignalUp, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontBarSignalUp, common_FrontBarSignalUp_ec))}; + if (!common_FrontBarSignalUp_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontBarSignalUp member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontBarSignalUp = "FrontBarSignalUp"; + eprosima::fastcdr::optional member_ann_builtin_FrontBarSignalUp; + ann_custom_BarCommandUpdate.reset(); + CompleteMemberDetail detail_FrontBarSignalUp = TypeObjectUtils::build_complete_member_detail(name_FrontBarSignalUp, member_ann_builtin_FrontBarSignalUp, ann_custom_BarCommandUpdate); + CompleteStructMember member_FrontBarSignalUp = TypeObjectUtils::build_complete_struct_member(common_FrontBarSignalUp, detail_FrontBarSignalUp); + TypeObjectUtils::add_complete_struct_member(member_seq_BarCommandUpdate, member_FrontBarSignalUp); + } + { + TypeIdentifierPair type_ids_FrontBarSignalDown; + ReturnCode_t return_code_FrontBarSignalDown {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontBarSignalDown = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontBarSignalDown); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontBarSignalDown) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontBarSignalDown Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontBarSignalDown = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontBarSignalDown = 0x00000001; + bool common_FrontBarSignalDown_ec {false}; + CommonStructMember common_FrontBarSignalDown {TypeObjectUtils::build_common_struct_member(member_id_FrontBarSignalDown, member_flags_FrontBarSignalDown, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontBarSignalDown, common_FrontBarSignalDown_ec))}; + if (!common_FrontBarSignalDown_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontBarSignalDown member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontBarSignalDown = "FrontBarSignalDown"; + eprosima::fastcdr::optional member_ann_builtin_FrontBarSignalDown; + ann_custom_BarCommandUpdate.reset(); + CompleteMemberDetail detail_FrontBarSignalDown = TypeObjectUtils::build_complete_member_detail(name_FrontBarSignalDown, member_ann_builtin_FrontBarSignalDown, ann_custom_BarCommandUpdate); + CompleteStructMember member_FrontBarSignalDown = TypeObjectUtils::build_complete_struct_member(common_FrontBarSignalDown, detail_FrontBarSignalDown); + TypeObjectUtils::add_complete_struct_member(member_seq_BarCommandUpdate, member_FrontBarSignalDown); + } + { + TypeIdentifierPair type_ids_FrontBarEnable; + ReturnCode_t return_code_FrontBarEnable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontBarEnable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_FrontBarEnable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontBarEnable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontBarEnable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontBarEnable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontBarEnable = 0x00000002; + bool common_FrontBarEnable_ec {false}; + CommonStructMember common_FrontBarEnable {TypeObjectUtils::build_common_struct_member(member_id_FrontBarEnable, member_flags_FrontBarEnable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontBarEnable, common_FrontBarEnable_ec))}; + if (!common_FrontBarEnable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontBarEnable member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontBarEnable = "FrontBarEnable"; + eprosima::fastcdr::optional member_ann_builtin_FrontBarEnable; + ann_custom_BarCommandUpdate.reset(); + CompleteMemberDetail detail_FrontBarEnable = TypeObjectUtils::build_complete_member_detail(name_FrontBarEnable, member_ann_builtin_FrontBarEnable, ann_custom_BarCommandUpdate); + CompleteStructMember member_FrontBarEnable = TypeObjectUtils::build_complete_struct_member(common_FrontBarEnable, detail_FrontBarEnable); + TypeObjectUtils::add_complete_struct_member(member_seq_BarCommandUpdate, member_FrontBarEnable); + } + { + TypeIdentifierPair type_ids_BackBarSignalUp; + ReturnCode_t return_code_BackBarSignalUp {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackBarSignalUp = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackBarSignalUp); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackBarSignalUp) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackBarSignalUp Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackBarSignalUp = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackBarSignalUp = 0x00000003; + bool common_BackBarSignalUp_ec {false}; + CommonStructMember common_BackBarSignalUp {TypeObjectUtils::build_common_struct_member(member_id_BackBarSignalUp, member_flags_BackBarSignalUp, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackBarSignalUp, common_BackBarSignalUp_ec))}; + if (!common_BackBarSignalUp_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackBarSignalUp member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackBarSignalUp = "BackBarSignalUp"; + eprosima::fastcdr::optional member_ann_builtin_BackBarSignalUp; + ann_custom_BarCommandUpdate.reset(); + CompleteMemberDetail detail_BackBarSignalUp = TypeObjectUtils::build_complete_member_detail(name_BackBarSignalUp, member_ann_builtin_BackBarSignalUp, ann_custom_BarCommandUpdate); + CompleteStructMember member_BackBarSignalUp = TypeObjectUtils::build_complete_struct_member(common_BackBarSignalUp, detail_BackBarSignalUp); + TypeObjectUtils::add_complete_struct_member(member_seq_BarCommandUpdate, member_BackBarSignalUp); + } + { + TypeIdentifierPair type_ids_BackBarSignalDown; + ReturnCode_t return_code_BackBarSignalDown {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackBarSignalDown = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackBarSignalDown); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackBarSignalDown) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackBarSignalDown Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackBarSignalDown = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackBarSignalDown = 0x00000004; + bool common_BackBarSignalDown_ec {false}; + CommonStructMember common_BackBarSignalDown {TypeObjectUtils::build_common_struct_member(member_id_BackBarSignalDown, member_flags_BackBarSignalDown, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackBarSignalDown, common_BackBarSignalDown_ec))}; + if (!common_BackBarSignalDown_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackBarSignalDown member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackBarSignalDown = "BackBarSignalDown"; + eprosima::fastcdr::optional member_ann_builtin_BackBarSignalDown; + ann_custom_BarCommandUpdate.reset(); + CompleteMemberDetail detail_BackBarSignalDown = TypeObjectUtils::build_complete_member_detail(name_BackBarSignalDown, member_ann_builtin_BackBarSignalDown, ann_custom_BarCommandUpdate); + CompleteStructMember member_BackBarSignalDown = TypeObjectUtils::build_complete_struct_member(common_BackBarSignalDown, detail_BackBarSignalDown); + TypeObjectUtils::add_complete_struct_member(member_seq_BarCommandUpdate, member_BackBarSignalDown); + } + { + TypeIdentifierPair type_ids_BackBarEnable; + ReturnCode_t return_code_BackBarEnable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackBarEnable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_BackBarEnable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackBarEnable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackBarEnable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackBarEnable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackBarEnable = 0x00000005; + bool common_BackBarEnable_ec {false}; + CommonStructMember common_BackBarEnable {TypeObjectUtils::build_common_struct_member(member_id_BackBarEnable, member_flags_BackBarEnable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackBarEnable, common_BackBarEnable_ec))}; + if (!common_BackBarEnable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackBarEnable member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackBarEnable = "BackBarEnable"; + eprosima::fastcdr::optional member_ann_builtin_BackBarEnable; + ann_custom_BarCommandUpdate.reset(); + CompleteMemberDetail detail_BackBarEnable = TypeObjectUtils::build_complete_member_detail(name_BackBarEnable, member_ann_builtin_BackBarEnable, ann_custom_BarCommandUpdate); + CompleteStructMember member_BackBarEnable = TypeObjectUtils::build_complete_struct_member(common_BackBarEnable, detail_BackBarEnable); + TypeObjectUtils::add_complete_struct_member(member_seq_BarCommandUpdate, member_BackBarEnable); + } + CompleteStructType struct_type_BarCommandUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_BarCommandUpdate, header_BarCommandUpdate, member_seq_BarCommandUpdate); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BarCommandUpdate, type_name_BarCommandUpdate.to_string(), type_ids_BarCommandUpdate)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::BarCommandUpdate already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_LightsCommandUpdate_type_identifier( + TypeIdentifierPair& type_ids_LightsCommandUpdate) +{ + + ReturnCode_t return_code_LightsCommandUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_LightsCommandUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::LightsCommandUpdate", type_ids_LightsCommandUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_LightsCommandUpdate) + { + StructTypeFlag struct_flags_LightsCommandUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_LightsCommandUpdate = "WeighingSystem::LightsCommandUpdate"; + eprosima::fastcdr::optional type_ann_builtin_LightsCommandUpdate; + eprosima::fastcdr::optional ann_custom_LightsCommandUpdate; + CompleteTypeDetail detail_LightsCommandUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LightsCommandUpdate, ann_custom_LightsCommandUpdate, type_name_LightsCommandUpdate.to_string()); + CompleteStructHeader header_LightsCommandUpdate; + header_LightsCommandUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LightsCommandUpdate); + CompleteStructMemberSeq member_seq_LightsCommandUpdate; + { + TypeIdentifierPair type_ids_FrontLEDSignal; + ReturnCode_t return_code_FrontLEDSignal {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontLEDSignal = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontLEDSignal); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontLEDSignal) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontLEDSignal Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontLEDSignal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontLEDSignal = 0x00000000; + bool common_FrontLEDSignal_ec {false}; + CommonStructMember common_FrontLEDSignal {TypeObjectUtils::build_common_struct_member(member_id_FrontLEDSignal, member_flags_FrontLEDSignal, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontLEDSignal, common_FrontLEDSignal_ec))}; + if (!common_FrontLEDSignal_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontLEDSignal member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontLEDSignal = "FrontLEDSignal"; + eprosima::fastcdr::optional member_ann_builtin_FrontLEDSignal; + ann_custom_LightsCommandUpdate.reset(); + CompleteMemberDetail detail_FrontLEDSignal = TypeObjectUtils::build_complete_member_detail(name_FrontLEDSignal, member_ann_builtin_FrontLEDSignal, ann_custom_LightsCommandUpdate); + CompleteStructMember member_FrontLEDSignal = TypeObjectUtils::build_complete_struct_member(common_FrontLEDSignal, detail_FrontLEDSignal); + TypeObjectUtils::add_complete_struct_member(member_seq_LightsCommandUpdate, member_FrontLEDSignal); + } + { + TypeIdentifierPair type_ids_FrontLEDEnable; + ReturnCode_t return_code_FrontLEDEnable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontLEDEnable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_FrontLEDEnable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontLEDEnable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontLEDEnable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontLEDEnable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontLEDEnable = 0x00000001; + bool common_FrontLEDEnable_ec {false}; + CommonStructMember common_FrontLEDEnable {TypeObjectUtils::build_common_struct_member(member_id_FrontLEDEnable, member_flags_FrontLEDEnable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontLEDEnable, common_FrontLEDEnable_ec))}; + if (!common_FrontLEDEnable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontLEDEnable member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontLEDEnable = "FrontLEDEnable"; + eprosima::fastcdr::optional member_ann_builtin_FrontLEDEnable; + ann_custom_LightsCommandUpdate.reset(); + CompleteMemberDetail detail_FrontLEDEnable = TypeObjectUtils::build_complete_member_detail(name_FrontLEDEnable, member_ann_builtin_FrontLEDEnable, ann_custom_LightsCommandUpdate); + CompleteStructMember member_FrontLEDEnable = TypeObjectUtils::build_complete_struct_member(common_FrontLEDEnable, detail_FrontLEDEnable); + TypeObjectUtils::add_complete_struct_member(member_seq_LightsCommandUpdate, member_FrontLEDEnable); + } + { + TypeIdentifierPair type_ids_BackLEDSignal; + ReturnCode_t return_code_BackLEDSignal {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackLEDSignal = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackLEDSignal); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackLEDSignal) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackLEDSignal Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackLEDSignal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackLEDSignal = 0x00000002; + bool common_BackLEDSignal_ec {false}; + CommonStructMember common_BackLEDSignal {TypeObjectUtils::build_common_struct_member(member_id_BackLEDSignal, member_flags_BackLEDSignal, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackLEDSignal, common_BackLEDSignal_ec))}; + if (!common_BackLEDSignal_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackLEDSignal member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackLEDSignal = "BackLEDSignal"; + eprosima::fastcdr::optional member_ann_builtin_BackLEDSignal; + ann_custom_LightsCommandUpdate.reset(); + CompleteMemberDetail detail_BackLEDSignal = TypeObjectUtils::build_complete_member_detail(name_BackLEDSignal, member_ann_builtin_BackLEDSignal, ann_custom_LightsCommandUpdate); + CompleteStructMember member_BackLEDSignal = TypeObjectUtils::build_complete_struct_member(common_BackLEDSignal, detail_BackLEDSignal); + TypeObjectUtils::add_complete_struct_member(member_seq_LightsCommandUpdate, member_BackLEDSignal); + } + { + TypeIdentifierPair type_ids_BackLEDEnable; + ReturnCode_t return_code_BackLEDEnable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackLEDEnable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackLEDEnable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackLEDEnable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackLEDEnable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackLEDEnable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackLEDEnable = 0x00000003; + bool common_BackLEDEnable_ec {false}; + CommonStructMember common_BackLEDEnable {TypeObjectUtils::build_common_struct_member(member_id_BackLEDEnable, member_flags_BackLEDEnable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackLEDEnable, common_BackLEDEnable_ec))}; + if (!common_BackLEDEnable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackLEDEnable member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackLEDEnable = "BackLEDEnable"; + eprosima::fastcdr::optional member_ann_builtin_BackLEDEnable; + ann_custom_LightsCommandUpdate.reset(); + CompleteMemberDetail detail_BackLEDEnable = TypeObjectUtils::build_complete_member_detail(name_BackLEDEnable, member_ann_builtin_BackLEDEnable, ann_custom_LightsCommandUpdate); + CompleteStructMember member_BackLEDEnable = TypeObjectUtils::build_complete_struct_member(common_BackLEDEnable, detail_BackLEDEnable); + TypeObjectUtils::add_complete_struct_member(member_seq_LightsCommandUpdate, member_BackLEDEnable); + } + CompleteStructType struct_type_LightsCommandUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_LightsCommandUpdate, header_LightsCommandUpdate, member_seq_LightsCommandUpdate); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LightsCommandUpdate, type_name_LightsCommandUpdate.to_string(), type_ids_LightsCommandUpdate)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::LightsCommandUpdate already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_InfraredCommandUpdate_type_identifier( + TypeIdentifierPair& type_ids_InfraredCommandUpdate) +{ + + ReturnCode_t return_code_InfraredCommandUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_InfraredCommandUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::InfraredCommandUpdate", type_ids_InfraredCommandUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_InfraredCommandUpdate) + { + StructTypeFlag struct_flags_InfraredCommandUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_InfraredCommandUpdate = "WeighingSystem::InfraredCommandUpdate"; + eprosima::fastcdr::optional type_ann_builtin_InfraredCommandUpdate; + eprosima::fastcdr::optional ann_custom_InfraredCommandUpdate; + CompleteTypeDetail detail_InfraredCommandUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InfraredCommandUpdate, ann_custom_InfraredCommandUpdate, type_name_InfraredCommandUpdate.to_string()); + CompleteStructHeader header_InfraredCommandUpdate; + header_InfraredCommandUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_InfraredCommandUpdate); + CompleteStructMemberSeq member_seq_InfraredCommandUpdate; + { + TypeIdentifierPair type_ids_FrontResistanceUnLock; + ReturnCode_t return_code_FrontResistanceUnLock {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontResistanceUnLock = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontResistanceUnLock); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontResistanceUnLock) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontResistanceUnLock Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontResistanceUnLock = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontResistanceUnLock = 0x00000000; + bool common_FrontResistanceUnLock_ec {false}; + CommonStructMember common_FrontResistanceUnLock {TypeObjectUtils::build_common_struct_member(member_id_FrontResistanceUnLock, member_flags_FrontResistanceUnLock, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontResistanceUnLock, common_FrontResistanceUnLock_ec))}; + if (!common_FrontResistanceUnLock_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontResistanceUnLock member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontResistanceUnLock = "FrontResistanceUnLock"; + eprosima::fastcdr::optional member_ann_builtin_FrontResistanceUnLock; + ann_custom_InfraredCommandUpdate.reset(); + CompleteMemberDetail detail_FrontResistanceUnLock = TypeObjectUtils::build_complete_member_detail(name_FrontResistanceUnLock, member_ann_builtin_FrontResistanceUnLock, ann_custom_InfraredCommandUpdate); + CompleteStructMember member_FrontResistanceUnLock = TypeObjectUtils::build_complete_struct_member(common_FrontResistanceUnLock, detail_FrontResistanceUnLock); + TypeObjectUtils::add_complete_struct_member(member_seq_InfraredCommandUpdate, member_FrontResistanceUnLock); + } + { + TypeIdentifierPair type_ids_FrontResistanceEnable; + ReturnCode_t return_code_FrontResistanceEnable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontResistanceEnable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_FrontResistanceEnable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontResistanceEnable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontResistanceEnable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontResistanceEnable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontResistanceEnable = 0x00000001; + bool common_FrontResistanceEnable_ec {false}; + CommonStructMember common_FrontResistanceEnable {TypeObjectUtils::build_common_struct_member(member_id_FrontResistanceEnable, member_flags_FrontResistanceEnable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontResistanceEnable, common_FrontResistanceEnable_ec))}; + if (!common_FrontResistanceEnable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontResistanceEnable member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontResistanceEnable = "FrontResistanceEnable"; + eprosima::fastcdr::optional member_ann_builtin_FrontResistanceEnable; + ann_custom_InfraredCommandUpdate.reset(); + CompleteMemberDetail detail_FrontResistanceEnable = TypeObjectUtils::build_complete_member_detail(name_FrontResistanceEnable, member_ann_builtin_FrontResistanceEnable, ann_custom_InfraredCommandUpdate); + CompleteStructMember member_FrontResistanceEnable = TypeObjectUtils::build_complete_struct_member(common_FrontResistanceEnable, detail_FrontResistanceEnable); + TypeObjectUtils::add_complete_struct_member(member_seq_InfraredCommandUpdate, member_FrontResistanceEnable); + } + { + TypeIdentifierPair type_ids_BackResistanceUnLock; + ReturnCode_t return_code_BackResistanceUnLock {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackResistanceUnLock = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackResistanceUnLock); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackResistanceUnLock) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackResistanceUnLock Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackResistanceUnLock = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackResistanceUnLock = 0x00000002; + bool common_BackResistanceUnLock_ec {false}; + CommonStructMember common_BackResistanceUnLock {TypeObjectUtils::build_common_struct_member(member_id_BackResistanceUnLock, member_flags_BackResistanceUnLock, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackResistanceUnLock, common_BackResistanceUnLock_ec))}; + if (!common_BackResistanceUnLock_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackResistanceUnLock member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackResistanceUnLock = "BackResistanceUnLock"; + eprosima::fastcdr::optional member_ann_builtin_BackResistanceUnLock; + ann_custom_InfraredCommandUpdate.reset(); + CompleteMemberDetail detail_BackResistanceUnLock = TypeObjectUtils::build_complete_member_detail(name_BackResistanceUnLock, member_ann_builtin_BackResistanceUnLock, ann_custom_InfraredCommandUpdate); + CompleteStructMember member_BackResistanceUnLock = TypeObjectUtils::build_complete_struct_member(common_BackResistanceUnLock, detail_BackResistanceUnLock); + TypeObjectUtils::add_complete_struct_member(member_seq_InfraredCommandUpdate, member_BackResistanceUnLock); + } + { + TypeIdentifierPair type_ids_BackResistanceEnable; + ReturnCode_t return_code_BackResistanceEnable {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackResistanceEnable = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_bool", type_ids_BackResistanceEnable); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackResistanceEnable) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackResistanceEnable Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackResistanceEnable = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackResistanceEnable = 0x00000003; + bool common_BackResistanceEnable_ec {false}; + CommonStructMember common_BackResistanceEnable {TypeObjectUtils::build_common_struct_member(member_id_BackResistanceEnable, member_flags_BackResistanceEnable, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackResistanceEnable, common_BackResistanceEnable_ec))}; + if (!common_BackResistanceEnable_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackResistanceEnable member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackResistanceEnable = "BackResistanceEnable"; + eprosima::fastcdr::optional member_ann_builtin_BackResistanceEnable; + ann_custom_InfraredCommandUpdate.reset(); + CompleteMemberDetail detail_BackResistanceEnable = TypeObjectUtils::build_complete_member_detail(name_BackResistanceEnable, member_ann_builtin_BackResistanceEnable, ann_custom_InfraredCommandUpdate); + CompleteStructMember member_BackResistanceEnable = TypeObjectUtils::build_complete_struct_member(common_BackResistanceEnable, detail_BackResistanceEnable); + TypeObjectUtils::add_complete_struct_member(member_seq_InfraredCommandUpdate, member_BackResistanceEnable); + } + CompleteStructType struct_type_InfraredCommandUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_InfraredCommandUpdate, header_InfraredCommandUpdate, member_seq_InfraredCommandUpdate); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_InfraredCommandUpdate, type_name_InfraredCommandUpdate.to_string(), type_ids_InfraredCommandUpdate)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::InfraredCommandUpdate already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_BarUpdate_type_identifier( + TypeIdentifierPair& type_ids_BarUpdate) +{ + + ReturnCode_t return_code_BarUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BarUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::BarUpdate", type_ids_BarUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BarUpdate) + { + StructTypeFlag struct_flags_BarUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_BarUpdate = "WeighingSystem::BarUpdate"; + eprosima::fastcdr::optional type_ann_builtin_BarUpdate; + eprosima::fastcdr::optional ann_custom_BarUpdate; + CompleteTypeDetail detail_BarUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_BarUpdate, ann_custom_BarUpdate, type_name_BarUpdate.to_string()); + CompleteStructHeader header_BarUpdate; + header_BarUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_BarUpdate); + CompleteStructMemberSeq member_seq_BarUpdate; + { + TypeIdentifierPair type_ids_FrontBarState; + ReturnCode_t return_code_FrontBarState {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontBarState = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontBarState); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontBarState) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontBarState Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontBarState = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontBarState = 0x00000000; + bool common_FrontBarState_ec {false}; + CommonStructMember common_FrontBarState {TypeObjectUtils::build_common_struct_member(member_id_FrontBarState, member_flags_FrontBarState, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontBarState, common_FrontBarState_ec))}; + if (!common_FrontBarState_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontBarState member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontBarState = "FrontBarState"; + eprosima::fastcdr::optional member_ann_builtin_FrontBarState; + ann_custom_BarUpdate.reset(); + CompleteMemberDetail detail_FrontBarState = TypeObjectUtils::build_complete_member_detail(name_FrontBarState, member_ann_builtin_FrontBarState, ann_custom_BarUpdate); + CompleteStructMember member_FrontBarState = TypeObjectUtils::build_complete_struct_member(common_FrontBarState, detail_FrontBarState); + TypeObjectUtils::add_complete_struct_member(member_seq_BarUpdate, member_FrontBarState); + } + { + TypeIdentifierPair type_ids_BackBarState; + ReturnCode_t return_code_BackBarState {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackBarState = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackBarState); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackBarState) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackBarState Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackBarState = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackBarState = 0x00000001; + bool common_BackBarState_ec {false}; + CommonStructMember common_BackBarState {TypeObjectUtils::build_common_struct_member(member_id_BackBarState, member_flags_BackBarState, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackBarState, common_BackBarState_ec))}; + if (!common_BackBarState_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackBarState member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackBarState = "BackBarState"; + eprosima::fastcdr::optional member_ann_builtin_BackBarState; + ann_custom_BarUpdate.reset(); + CompleteMemberDetail detail_BackBarState = TypeObjectUtils::build_complete_member_detail(name_BackBarState, member_ann_builtin_BackBarState, ann_custom_BarUpdate); + CompleteStructMember member_BackBarState = TypeObjectUtils::build_complete_struct_member(common_BackBarState, detail_BackBarState); + TypeObjectUtils::add_complete_struct_member(member_seq_BarUpdate, member_BackBarState); + } + CompleteStructType struct_type_BarUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_BarUpdate, header_BarUpdate, member_seq_BarUpdate); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_BarUpdate, type_name_BarUpdate.to_string(), type_ids_BarUpdate)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::BarUpdate already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_LightsUpdate_type_identifier( + TypeIdentifierPair& type_ids_LightsUpdate) +{ + + ReturnCode_t return_code_LightsUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_LightsUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::LightsUpdate", type_ids_LightsUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_LightsUpdate) + { + StructTypeFlag struct_flags_LightsUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_LightsUpdate = "WeighingSystem::LightsUpdate"; + eprosima::fastcdr::optional type_ann_builtin_LightsUpdate; + eprosima::fastcdr::optional ann_custom_LightsUpdate; + CompleteTypeDetail detail_LightsUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LightsUpdate, ann_custom_LightsUpdate, type_name_LightsUpdate.to_string()); + CompleteStructHeader header_LightsUpdate; + header_LightsUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LightsUpdate); + CompleteStructMemberSeq member_seq_LightsUpdate; + { + TypeIdentifierPair type_ids_FrontLEDState; + ReturnCode_t return_code_FrontLEDState {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontLEDState = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontLEDState); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontLEDState) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontLEDState Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontLEDState = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontLEDState = 0x00000000; + bool common_FrontLEDState_ec {false}; + CommonStructMember common_FrontLEDState {TypeObjectUtils::build_common_struct_member(member_id_FrontLEDState, member_flags_FrontLEDState, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontLEDState, common_FrontLEDState_ec))}; + if (!common_FrontLEDState_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontLEDState member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontLEDState = "FrontLEDState"; + eprosima::fastcdr::optional member_ann_builtin_FrontLEDState; + ann_custom_LightsUpdate.reset(); + CompleteMemberDetail detail_FrontLEDState = TypeObjectUtils::build_complete_member_detail(name_FrontLEDState, member_ann_builtin_FrontLEDState, ann_custom_LightsUpdate); + CompleteStructMember member_FrontLEDState = TypeObjectUtils::build_complete_struct_member(common_FrontLEDState, detail_FrontLEDState); + TypeObjectUtils::add_complete_struct_member(member_seq_LightsUpdate, member_FrontLEDState); + } + { + TypeIdentifierPair type_ids_BackLEDState; + ReturnCode_t return_code_BackLEDState {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackLEDState = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackLEDState); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackLEDState) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackLEDState Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackLEDState = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackLEDState = 0x00000001; + bool common_BackLEDState_ec {false}; + CommonStructMember common_BackLEDState {TypeObjectUtils::build_common_struct_member(member_id_BackLEDState, member_flags_BackLEDState, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackLEDState, common_BackLEDState_ec))}; + if (!common_BackLEDState_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackLEDState member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackLEDState = "BackLEDState"; + eprosima::fastcdr::optional member_ann_builtin_BackLEDState; + ann_custom_LightsUpdate.reset(); + CompleteMemberDetail detail_BackLEDState = TypeObjectUtils::build_complete_member_detail(name_BackLEDState, member_ann_builtin_BackLEDState, ann_custom_LightsUpdate); + CompleteStructMember member_BackLEDState = TypeObjectUtils::build_complete_struct_member(common_BackLEDState, detail_BackLEDState); + TypeObjectUtils::add_complete_struct_member(member_seq_LightsUpdate, member_BackLEDState); + } + CompleteStructType struct_type_LightsUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_LightsUpdate, header_LightsUpdate, member_seq_LightsUpdate); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LightsUpdate, type_name_LightsUpdate.to_string(), type_ids_LightsUpdate)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::LightsUpdate already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_InfraredUpdate_type_identifier( + TypeIdentifierPair& type_ids_InfraredUpdate) +{ + + ReturnCode_t return_code_InfraredUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_InfraredUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::InfraredUpdate", type_ids_InfraredUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_InfraredUpdate) + { + StructTypeFlag struct_flags_InfraredUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_InfraredUpdate = "WeighingSystem::InfraredUpdate"; + eprosima::fastcdr::optional type_ann_builtin_InfraredUpdate; + eprosima::fastcdr::optional ann_custom_InfraredUpdate; + CompleteTypeDetail detail_InfraredUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_InfraredUpdate, ann_custom_InfraredUpdate, type_name_InfraredUpdate.to_string()); + CompleteStructHeader header_InfraredUpdate; + header_InfraredUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_InfraredUpdate); + CompleteStructMemberSeq member_seq_InfraredUpdate; + { + TypeIdentifierPair type_ids_FrontResistanceSignal; + ReturnCode_t return_code_FrontResistanceSignal {eprosima::fastdds::dds::RETCODE_OK}; + return_code_FrontResistanceSignal = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_FrontResistanceSignal); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_FrontResistanceSignal) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "FrontResistanceSignal Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_FrontResistanceSignal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_FrontResistanceSignal = 0x00000000; + bool common_FrontResistanceSignal_ec {false}; + CommonStructMember common_FrontResistanceSignal {TypeObjectUtils::build_common_struct_member(member_id_FrontResistanceSignal, member_flags_FrontResistanceSignal, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_FrontResistanceSignal, common_FrontResistanceSignal_ec))}; + if (!common_FrontResistanceSignal_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure FrontResistanceSignal member TypeIdentifier inconsistent."); + return; + } + MemberName name_FrontResistanceSignal = "FrontResistanceSignal"; + eprosima::fastcdr::optional member_ann_builtin_FrontResistanceSignal; + ann_custom_InfraredUpdate.reset(); + CompleteMemberDetail detail_FrontResistanceSignal = TypeObjectUtils::build_complete_member_detail(name_FrontResistanceSignal, member_ann_builtin_FrontResistanceSignal, ann_custom_InfraredUpdate); + CompleteStructMember member_FrontResistanceSignal = TypeObjectUtils::build_complete_struct_member(common_FrontResistanceSignal, detail_FrontResistanceSignal); + TypeObjectUtils::add_complete_struct_member(member_seq_InfraredUpdate, member_FrontResistanceSignal); + } + { + TypeIdentifierPair type_ids_BackResistanceSignal; + ReturnCode_t return_code_BackResistanceSignal {eprosima::fastdds::dds::RETCODE_OK}; + return_code_BackResistanceSignal = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_BackResistanceSignal); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_BackResistanceSignal) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "BackResistanceSignal Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_BackResistanceSignal = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_BackResistanceSignal = 0x00000001; + bool common_BackResistanceSignal_ec {false}; + CommonStructMember common_BackResistanceSignal {TypeObjectUtils::build_common_struct_member(member_id_BackResistanceSignal, member_flags_BackResistanceSignal, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_BackResistanceSignal, common_BackResistanceSignal_ec))}; + if (!common_BackResistanceSignal_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure BackResistanceSignal member TypeIdentifier inconsistent."); + return; + } + MemberName name_BackResistanceSignal = "BackResistanceSignal"; + eprosima::fastcdr::optional member_ann_builtin_BackResistanceSignal; + ann_custom_InfraredUpdate.reset(); + CompleteMemberDetail detail_BackResistanceSignal = TypeObjectUtils::build_complete_member_detail(name_BackResistanceSignal, member_ann_builtin_BackResistanceSignal, ann_custom_InfraredUpdate); + CompleteStructMember member_BackResistanceSignal = TypeObjectUtils::build_complete_struct_member(common_BackResistanceSignal, detail_BackResistanceSignal); + TypeObjectUtils::add_complete_struct_member(member_seq_InfraredUpdate, member_BackResistanceSignal); + } + CompleteStructType struct_type_InfraredUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_InfraredUpdate, header_InfraredUpdate, member_seq_InfraredUpdate); + if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == + TypeObjectUtils::build_and_register_struct_type_object(struct_type_InfraredUpdate, type_name_InfraredUpdate.to_string(), type_ids_InfraredUpdate)) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "WeighingSystem::InfraredUpdate already registered in TypeObjectRegistry for a different type."); + } + } +} +// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method +void register_LicenseSnapUpdate_type_identifier( + TypeIdentifierPair& type_ids_LicenseSnapUpdate) +{ + + ReturnCode_t return_code_LicenseSnapUpdate {eprosima::fastdds::dds::RETCODE_OK}; + return_code_LicenseSnapUpdate = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "WeighingSystem::LicenseSnapUpdate", type_ids_LicenseSnapUpdate); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicenseSnapUpdate) + { + StructTypeFlag struct_flags_LicenseSnapUpdate = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + false, false); + QualifiedTypeName type_name_LicenseSnapUpdate = "WeighingSystem::LicenseSnapUpdate"; + eprosima::fastcdr::optional type_ann_builtin_LicenseSnapUpdate; + eprosima::fastcdr::optional ann_custom_LicenseSnapUpdate; + CompleteTypeDetail detail_LicenseSnapUpdate = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LicenseSnapUpdate, ann_custom_LicenseSnapUpdate, type_name_LicenseSnapUpdate.to_string()); + CompleteStructHeader header_LicenseSnapUpdate; + header_LicenseSnapUpdate = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LicenseSnapUpdate); + CompleteStructMemberSeq member_seq_LicenseSnapUpdate; + { + TypeIdentifierPair type_ids_NewTag; + ReturnCode_t return_code_NewTag {eprosima::fastdds::dds::RETCODE_OK}; + return_code_NewTag = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "_int32_t", type_ids_NewTag); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_NewTag) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, + "NewTag Structure member TypeIdentifier unknown to TypeObjectRegistry."); + return; + } + StructMemberFlag member_flags_NewTag = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + false, false, false, false); + MemberId member_id_NewTag = 0x00000000; + bool common_NewTag_ec {false}; + CommonStructMember common_NewTag {TypeObjectUtils::build_common_struct_member(member_id_NewTag, member_flags_NewTag, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_NewTag, common_NewTag_ec))}; + if (!common_NewTag_ec) + { + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure NewTag member TypeIdentifier inconsistent."); + return; + } + MemberName name_NewTag = "NewTag"; + eprosima::fastcdr::optional member_ann_builtin_NewTag; + ann_custom_LicenseSnapUpdate.reset(); + CompleteMemberDetail detail_NewTag = TypeObjectUtils::build_complete_member_detail(name_NewTag, member_ann_builtin_NewTag, ann_custom_LicenseSnapUpdate); + CompleteStructMember member_NewTag = TypeObjectUtils::build_complete_struct_member(common_NewTag, detail_NewTag); + TypeObjectUtils::add_complete_struct_member(member_seq_LicenseSnapUpdate, member_NewTag); + } + { + TypeIdentifierPair type_ids_License; + ReturnCode_t return_code_License {eprosima::fastdds::dds::RETCODE_OK}; + return_code_License = + eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( + "anonymous_string_unbounded", type_ids_License); + + if (eprosima::fastdds::dds::RETCODE_OK != return_code_License) + { { SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded), key_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded)); + StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded", type_ids_msg)) + TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, + "anonymous_string_unbounded", type_ids_License)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); + "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); } } } - StructMemberFlag member_flags_msg = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + StructMemberFlag member_flags_License = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, false, false, false, false); - MemberId member_id_msg = 0x00000001; - bool common_msg_ec {false}; - CommonStructMember common_msg {TypeObjectUtils::build_common_struct_member(member_id_msg, member_flags_msg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg, common_msg_ec))}; - if (!common_msg_ec) + MemberId member_id_License = 0x00000001; + bool common_License_ec {false}; + CommonStructMember common_License {TypeObjectUtils::build_common_struct_member(member_id_License, member_flags_License, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_License, common_License_ec))}; + if (!common_License_ec) { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure msg member TypeIdentifier inconsistent."); + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure License member TypeIdentifier inconsistent."); return; } - MemberName name_msg = "msg"; - eprosima::fastcdr::optional member_ann_builtin_msg; - ann_custom_LicencePlateReq.reset(); - CompleteMemberDetail detail_msg = TypeObjectUtils::build_complete_member_detail(name_msg, member_ann_builtin_msg, ann_custom_LicencePlateReq); - CompleteStructMember member_msg = TypeObjectUtils::build_complete_struct_member(common_msg, detail_msg); - TypeObjectUtils::add_complete_struct_member(member_seq_LicencePlateReq, member_msg); + MemberName name_License = "License"; + eprosima::fastcdr::optional member_ann_builtin_License; + ann_custom_LicenseSnapUpdate.reset(); + CompleteMemberDetail detail_License = TypeObjectUtils::build_complete_member_detail(name_License, member_ann_builtin_License, ann_custom_LicenseSnapUpdate); + CompleteStructMember member_License = TypeObjectUtils::build_complete_struct_member(common_License, detail_License); + TypeObjectUtils::add_complete_struct_member(member_seq_LicenseSnapUpdate, member_License); } - CompleteStructType struct_type_LicencePlateReq = TypeObjectUtils::build_complete_struct_type(struct_flags_LicencePlateReq, header_LicencePlateReq, member_seq_LicencePlateReq); + CompleteStructType struct_type_LicenseSnapUpdate = TypeObjectUtils::build_complete_struct_type(struct_flags_LicenseSnapUpdate, header_LicenseSnapUpdate, member_seq_LicenseSnapUpdate); if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicencePlateReq, type_name_LicencePlateReq.to_string(), type_ids_LicencePlateReq)) + TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicenseSnapUpdate, type_name_LicenseSnapUpdate.to_string(), type_ids_LicenseSnapUpdate)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "InternalSystem::LicencePlateReq already registered in TypeObjectRegistry for a different type."); + "WeighingSystem::LicenseSnapUpdate already registered in TypeObjectRegistry for a different type."); } } } // TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method -void register_LicencePlateRsp_type_identifier( - TypeIdentifierPair& type_ids_LicencePlateRsp) +void register_Voice_type_identifier( + TypeIdentifierPair& type_ids_Voice) { - ReturnCode_t return_code_LicencePlateRsp {eprosima::fastdds::dds::RETCODE_OK}; - return_code_LicencePlateRsp = + ReturnCode_t return_code_Voice {eprosima::fastdds::dds::RETCODE_OK}; + return_code_Voice = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "InternalSystem::LicencePlateRsp", type_ids_LicencePlateRsp); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicencePlateRsp) + "WeighingSystem::Voice", type_ids_Voice); + if (eprosima::fastdds::dds::RETCODE_OK != return_code_Voice) { - StructTypeFlag struct_flags_LicencePlateRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, + StructTypeFlag struct_flags_Voice = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, false, false); - 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()); - CompleteStructHeader header_LicencePlateRsp; - header_LicencePlateRsp = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LicencePlateRsp); - CompleteStructMemberSeq member_seq_LicencePlateRsp; + QualifiedTypeName type_name_Voice = "WeighingSystem::Voice"; + eprosima::fastcdr::optional type_ann_builtin_Voice; + eprosima::fastcdr::optional ann_custom_Voice; + CompleteTypeDetail detail_Voice = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Voice, ann_custom_Voice, type_name_Voice.to_string()); + CompleteStructHeader header_Voice; + header_Voice = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Voice); + CompleteStructMemberSeq member_seq_Voice; { - TypeIdentifierPair type_ids_index; - ReturnCode_t return_code_index {eprosima::fastdds::dds::RETCODE_OK}; - return_code_index = + TypeIdentifierPair type_ids_VoiceID; + ReturnCode_t return_code_VoiceID {eprosima::fastdds::dds::RETCODE_OK}; + return_code_VoiceID = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_index); + "_int32_t", type_ids_VoiceID); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_index) + if (eprosima::fastdds::dds::RETCODE_OK != return_code_VoiceID) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); + "VoiceID Structure member TypeIdentifier unknown to TypeObjectRegistry."); return; } - StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + StructMemberFlag member_flags_VoiceID = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, false, false, false, false); - MemberId member_id_index = 0x00000000; - bool common_index_ec {false}; - CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_index, common_index_ec))}; - if (!common_index_ec) + MemberId member_id_VoiceID = 0x00000000; + bool common_VoiceID_ec {false}; + CommonStructMember common_VoiceID {TypeObjectUtils::build_common_struct_member(member_id_VoiceID, member_flags_VoiceID, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_VoiceID, common_VoiceID_ec))}; + if (!common_VoiceID_ec) { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure index member TypeIdentifier inconsistent."); + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure VoiceID member TypeIdentifier inconsistent."); return; } - MemberName name_index = "index"; - eprosima::fastcdr::optional member_ann_builtin_index; - ann_custom_LicencePlateRsp.reset(); - CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_LicencePlateRsp); - CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); - TypeObjectUtils::add_complete_struct_member(member_seq_LicencePlateRsp, member_index); + MemberName name_VoiceID = "VoiceID"; + eprosima::fastcdr::optional member_ann_builtin_VoiceID; + ann_custom_Voice.reset(); + CompleteMemberDetail detail_VoiceID = TypeObjectUtils::build_complete_member_detail(name_VoiceID, member_ann_builtin_VoiceID, ann_custom_Voice); + CompleteStructMember member_VoiceID = TypeObjectUtils::build_complete_struct_member(common_VoiceID, detail_VoiceID); + TypeObjectUtils::add_complete_struct_member(member_seq_Voice, member_VoiceID); } { - TypeIdentifierPair type_ids_licence; - ReturnCode_t return_code_licence {eprosima::fastdds::dds::RETCODE_OK}; - return_code_licence = + TypeIdentifierPair type_ids_VoiceContent; + ReturnCode_t return_code_VoiceContent {eprosima::fastdds::dds::RETCODE_OK}; + return_code_VoiceContent = eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_licence); + "anonymous_string_unbounded", type_ids_VoiceContent); - if (eprosima::fastdds::dds::RETCODE_OK != return_code_licence) + if (eprosima::fastdds::dds::RETCODE_OK != return_code_VoiceContent) { { SBound bound = 0; StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, - "anonymous_string_unbounded", type_ids_licence)) + "anonymous_string_unbounded", type_ids_VoiceContent)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); } } } - StructMemberFlag member_flags_licence = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, + StructMemberFlag member_flags_VoiceContent = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, false, false, false, false); - MemberId member_id_licence = 0x00000001; - bool common_licence_ec {false}; - CommonStructMember common_licence {TypeObjectUtils::build_common_struct_member(member_id_licence, member_flags_licence, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_licence, common_licence_ec))}; - if (!common_licence_ec) + MemberId member_id_VoiceContent = 0x00000001; + bool common_VoiceContent_ec {false}; + CommonStructMember common_VoiceContent {TypeObjectUtils::build_common_struct_member(member_id_VoiceContent, member_flags_VoiceContent, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_VoiceContent, common_VoiceContent_ec))}; + if (!common_VoiceContent_ec) { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure licence member TypeIdentifier inconsistent."); + EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure VoiceContent member TypeIdentifier inconsistent."); return; } - MemberName name_licence = "licence"; - eprosima::fastcdr::optional member_ann_builtin_licence; - ann_custom_LicencePlateRsp.reset(); - CompleteMemberDetail detail_licence = TypeObjectUtils::build_complete_member_detail(name_licence, member_ann_builtin_licence, ann_custom_LicencePlateRsp); - CompleteStructMember member_licence = TypeObjectUtils::build_complete_struct_member(common_licence, detail_licence); - TypeObjectUtils::add_complete_struct_member(member_seq_LicencePlateRsp, member_licence); + MemberName name_VoiceContent = "VoiceContent"; + eprosima::fastcdr::optional member_ann_builtin_VoiceContent; + ann_custom_Voice.reset(); + CompleteMemberDetail detail_VoiceContent = TypeObjectUtils::build_complete_member_detail(name_VoiceContent, member_ann_builtin_VoiceContent, ann_custom_Voice); + CompleteStructMember member_VoiceContent = TypeObjectUtils::build_complete_struct_member(common_VoiceContent, detail_VoiceContent); + TypeObjectUtils::add_complete_struct_member(member_seq_Voice, member_VoiceContent); } - CompleteStructType struct_type_LicencePlateRsp = TypeObjectUtils::build_complete_struct_type(struct_flags_LicencePlateRsp, header_LicencePlateRsp, member_seq_LicencePlateRsp); + CompleteStructType struct_type_Voice = TypeObjectUtils::build_complete_struct_type(struct_flags_Voice, header_Voice, member_seq_Voice); if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicencePlateRsp, type_name_LicencePlateRsp.to_string(), type_ids_LicencePlateRsp)) + TypeObjectUtils::build_and_register_struct_type_object(struct_type_Voice, type_name_Voice.to_string(), type_ids_Voice)) { EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "InternalSystem::LicencePlateRsp already registered in TypeObjectRegistry for a different type."); + "WeighingSystem::Voice already registered in TypeObjectRegistry for a different type."); } } } + +} // namespace WeighingSystem +namespace InternalSystem { // TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method void register_PrintReq_type_identifier( TypeIdentifierPair& type_ids_PrintReq) @@ -562,289 +2454,6 @@ void register_PrintRsp_type_identifier( } } // TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method -void register_WeighReq_type_identifier( - TypeIdentifierPair& type_ids_WeighReq) -{ - - 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( - "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 = "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()); - CompleteStructHeader header_WeighReq; - header_WeighReq = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WeighReq); - CompleteStructMemberSeq member_seq_WeighReq; - { - TypeIdentifierPair type_ids_index; - ReturnCode_t return_code_index {eprosima::fastdds::dds::RETCODE_OK}; - return_code_index = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_index); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_index) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, - false, false, false, false); - MemberId member_id_index = 0x00000000; - bool common_index_ec {false}; - CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_index, common_index_ec))}; - if (!common_index_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure index member TypeIdentifier inconsistent."); - return; - } - MemberName name_index = "index"; - eprosima::fastcdr::optional member_ann_builtin_index; - ann_custom_WeighReq.reset(); - CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_WeighReq); - CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); - TypeObjectUtils::add_complete_struct_member(member_seq_WeighReq, member_index); - } - { - TypeIdentifierPair type_ids_msg; - ReturnCode_t return_code_msg {eprosima::fastdds::dds::RETCODE_OK}; - return_code_msg = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded", type_ids_msg); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg) - { - return_code_msg = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_msg); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg) - { - { - SBound bound = 0; - StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, - "anonymous_string_unbounded", type_ids_msg)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - } - bool element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec {false}; - TypeIdentifier* element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg, element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec))}; - if (!element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded inconsistent element TypeIdentifier."); - return; - } - return_code_msg = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "anonymous_string_unbounded", type_ids_msg); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_msg) - { - { - SBound bound = 0; - StringSTypeDefn string_sdefn = TypeObjectUtils::build_string_s_type_defn(bound); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_string_type_identifier(string_sdefn, - "anonymous_string_unbounded", type_ids_msg)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_string_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - } - bool key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec {false}; - TypeIdentifier* key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg, key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec))}; - if (!key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded inconsistent key TypeIdentifier."); - return; - } - EquivalenceKind equiv_kind_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = EK_BOTH; - if ((EK_COMPLETE == key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() || EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d()) || - (TI_PLAIN_SEQUENCE_SMALL == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->seq_sdefn().header().equiv_kind()) || - (TI_PLAIN_SEQUENCE_LARGE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->seq_ldefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_SMALL == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->array_sdefn().header().equiv_kind()) || - (TI_PLAIN_ARRAY_LARGE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->array_ldefn().header().equiv_kind()) || - (TI_PLAIN_MAP_SMALL == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_sdefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_sdefn().header().equiv_kind())) || - (TI_PLAIN_MAP_LARGE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->_d() && (EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_ldefn().key_identifier()->_d() || EK_COMPLETE == element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded->map_ldefn().header().equiv_kind()))) - { - equiv_kind_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = EK_COMPLETE; - } - CollectionElementFlag element_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = 0; - CollectionElementFlag key_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = 0; - PlainCollectionHeader header_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded, element_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded); - { - SBound bound = 0; - PlainMapSTypeDefn map_sdefn = TypeObjectUtils::build_plain_map_s_type_defn(header_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded, bound, - eprosima::fastcdr::external(element_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded), key_flags_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded, - eprosima::fastcdr::external(key_identifier_anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded)); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_s_map_type_identifier(map_sdefn, "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded", type_ids_msg)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "anonymous_map_anonymous_string_unbounded_anonymous_string_unbounded_unbounded already registered in TypeObjectRegistry for a different type."); - } - } - } - StructMemberFlag member_flags_msg = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, - false, false, false, false); - MemberId member_id_msg = 0x00000001; - bool common_msg_ec {false}; - CommonStructMember common_msg {TypeObjectUtils::build_common_struct_member(member_id_msg, member_flags_msg, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_msg, common_msg_ec))}; - if (!common_msg_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure msg member TypeIdentifier inconsistent."); - return; - } - MemberName name_msg = "msg"; - eprosima::fastcdr::optional member_ann_builtin_msg; - ann_custom_WeighReq.reset(); - CompleteMemberDetail detail_msg = TypeObjectUtils::build_complete_member_detail(name_msg, member_ann_builtin_msg, ann_custom_WeighReq); - CompleteStructMember member_msg = TypeObjectUtils::build_complete_struct_member(common_msg, detail_msg); - TypeObjectUtils::add_complete_struct_member(member_seq_WeighReq, member_msg); - } - CompleteStructType struct_type_WeighReq = TypeObjectUtils::build_complete_struct_type(struct_flags_WeighReq, header_WeighReq, member_seq_WeighReq); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeighReq, type_name_WeighReq.to_string(), type_ids_WeighReq)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "InternalSystem::WeighReq already registered in TypeObjectRegistry for a different type."); - } - } -} -// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method -void register_WeighRsp_type_identifier( - TypeIdentifierPair& type_ids_WeighRsp) -{ - - 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( - "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 = "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()); - CompleteStructHeader header_WeighRsp; - header_WeighRsp = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WeighRsp); - CompleteStructMemberSeq member_seq_WeighRsp; - { - TypeIdentifierPair type_ids_index; - ReturnCode_t return_code_index {eprosima::fastdds::dds::RETCODE_OK}; - return_code_index = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_uint32_t", type_ids_index); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_index) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "index Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, - false, false, false, false); - MemberId member_id_index = 0x00000000; - bool common_index_ec {false}; - CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_index, common_index_ec))}; - if (!common_index_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure index member TypeIdentifier inconsistent."); - return; - } - MemberName name_index = "index"; - eprosima::fastcdr::optional member_ann_builtin_index; - ann_custom_WeighRsp.reset(); - CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_WeighRsp); - CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index); - TypeObjectUtils::add_complete_struct_member(member_seq_WeighRsp, member_index); - } - { - TypeIdentifierPair type_ids_stable_weight; - ReturnCode_t return_code_stable_weight {eprosima::fastdds::dds::RETCODE_OK}; - return_code_stable_weight = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_stable_weight); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_stable_weight) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "stable_weight Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_stable_weight = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, - false, false, false, false); - MemberId member_id_stable_weight = 0x00000001; - bool common_stable_weight_ec {false}; - CommonStructMember common_stable_weight {TypeObjectUtils::build_common_struct_member(member_id_stable_weight, member_flags_stable_weight, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_stable_weight, common_stable_weight_ec))}; - if (!common_stable_weight_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure stable_weight member TypeIdentifier inconsistent."); - return; - } - MemberName name_stable_weight = "stable_weight"; - eprosima::fastcdr::optional member_ann_builtin_stable_weight; - ann_custom_WeighRsp.reset(); - CompleteMemberDetail detail_stable_weight = TypeObjectUtils::build_complete_member_detail(name_stable_weight, member_ann_builtin_stable_weight, ann_custom_WeighRsp); - CompleteStructMember member_stable_weight = TypeObjectUtils::build_complete_struct_member(common_stable_weight, detail_stable_weight); - TypeObjectUtils::add_complete_struct_member(member_seq_WeighRsp, member_stable_weight); - } - { - TypeIdentifierPair type_ids_instantaneous_weight; - ReturnCode_t return_code_instantaneous_weight {eprosima::fastdds::dds::RETCODE_OK}; - return_code_instantaneous_weight = - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( - "_float", type_ids_instantaneous_weight); - - if (eprosima::fastdds::dds::RETCODE_OK != return_code_instantaneous_weight) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "instantaneous_weight Structure member TypeIdentifier unknown to TypeObjectRegistry."); - return; - } - StructMemberFlag member_flags_instantaneous_weight = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD, - false, false, false, false); - MemberId member_id_instantaneous_weight = 0x00000002; - bool common_instantaneous_weight_ec {false}; - CommonStructMember common_instantaneous_weight {TypeObjectUtils::build_common_struct_member(member_id_instantaneous_weight, member_flags_instantaneous_weight, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_instantaneous_weight, common_instantaneous_weight_ec))}; - if (!common_instantaneous_weight_ec) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure instantaneous_weight member TypeIdentifier inconsistent."); - return; - } - MemberName name_instantaneous_weight = "instantaneous_weight"; - eprosima::fastcdr::optional member_ann_builtin_instantaneous_weight; - ann_custom_WeighRsp.reset(); - CompleteMemberDetail detail_instantaneous_weight = TypeObjectUtils::build_complete_member_detail(name_instantaneous_weight, member_ann_builtin_instantaneous_weight, ann_custom_WeighRsp); - CompleteStructMember member_instantaneous_weight = TypeObjectUtils::build_complete_struct_member(common_instantaneous_weight, detail_instantaneous_weight); - TypeObjectUtils::add_complete_struct_member(member_seq_WeighRsp, member_instantaneous_weight); - } - CompleteStructType struct_type_WeighRsp = TypeObjectUtils::build_complete_struct_type(struct_flags_WeighRsp, header_WeighRsp, member_seq_WeighRsp); - if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER == - TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeighRsp, type_name_WeighRsp.to_string(), type_ids_WeighRsp)) - { - EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, - "InternalSystem::WeighRsp already registered in TypeObjectRegistry for a different type."); - } - } -} -// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method void register_IoCtrlReq_type_identifier( TypeIdentifierPair& type_ids_IoCtrlReq) { diff --git a/lib/SystemTypeObjectSupport.hpp b/lib/SystemTypeObjectSupport.hpp index ad179ec..aec3f6e 100644 --- a/lib/SystemTypeObjectSupport.hpp +++ b/lib/SystemTypeObjectSupport.hpp @@ -37,9 +37,9 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC -namespace InternalSystem { +namespace WeighingSystem { /** - * @brief Register LicencePlateReq related TypeIdentifier. + * @brief Register ScaleInfo related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is * indirectly registered as well. @@ -48,11 +48,11 @@ namespace InternalSystem { * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. * Invalid TypeIdentifier is returned in case of error. */ -eProsima_user_DllExport void register_LicencePlateReq_type_identifier( +eProsima_user_DllExport void register_ScaleInfo_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); /** - * @brief Register LicencePlateRsp related TypeIdentifier. + * @brief Register ScaleCommand related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is * indirectly registered as well. @@ -61,11 +61,11 @@ eProsima_user_DllExport void register_LicencePlateReq_type_identifier( * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. * Invalid TypeIdentifier is returned in case of error. */ -eProsima_user_DllExport void register_LicencePlateRsp_type_identifier( +eProsima_user_DllExport void register_ScaleCommand_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); /** - * @brief Register PrintReq related TypeIdentifier. + * @brief Register WeightInfoOk related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is * indirectly registered as well. @@ -74,11 +74,11 @@ eProsima_user_DllExport void register_LicencePlateRsp_type_identifier( * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. * Invalid TypeIdentifier is returned in case of error. */ -eProsima_user_DllExport void register_PrintReq_type_identifier( +eProsima_user_DllExport void register_WeightInfoOk_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); /** - * @brief Register PrintRsp related TypeIdentifier. + * @brief Register WeightInfoError related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is * indirectly registered as well. @@ -87,11 +87,63 @@ eProsima_user_DllExport void register_PrintReq_type_identifier( * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. * Invalid TypeIdentifier is returned in case of error. */ -eProsima_user_DllExport void register_PrintRsp_type_identifier( +eProsima_user_DllExport void register_WeightInfoError_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register BarCommandUpdate related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_BarCommandUpdate_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register LightsCommandUpdate related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_LightsCommandUpdate_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register InfraredCommandUpdate related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_InfraredCommandUpdate_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register BarUpdate related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_BarUpdate_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); /** - * @brief Register WeighReq related TypeIdentifier. + * @brief Register LightsUpdate related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is * indirectly registered as well. @@ -100,11 +152,11 @@ eProsima_user_DllExport void register_PrintRsp_type_identifier( * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. * Invalid TypeIdentifier is returned in case of error. */ -eProsima_user_DllExport void register_WeighReq_type_identifier( +eProsima_user_DllExport void register_LightsUpdate_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); /** - * @brief Register WeighRsp related TypeIdentifier. + * @brief Register InfraredUpdate related TypeIdentifier. * Fully-descriptive TypeIdentifiers are directly registered. * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is * indirectly registered as well. @@ -113,7 +165,61 @@ eProsima_user_DllExport void register_WeighReq_type_identifier( * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. * Invalid TypeIdentifier is returned in case of error. */ -eProsima_user_DllExport void register_WeighRsp_type_identifier( +eProsima_user_DllExport void register_InfraredUpdate_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register LicenseSnapUpdate related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_LicenseSnapUpdate_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +/** + * @brief Register Voice related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_Voice_type_identifier( + eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); + +} // namespace WeighingSystem +namespace InternalSystem { +/** + * @brief Register PrintReq related TypeIdentifier. + * Fully-descriptive TypeIdentifiers are directly registered. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +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. + * Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is + * indirectly registered as well. + * + * @param[out] TypeIdentifier of the registered type. + * The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers. + * Invalid TypeIdentifier is returned in case of error. + */ +eProsima_user_DllExport void register_PrintRsp_type_identifier( eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids); /** diff --git a/print/Publisher.cxx b/print/Publisher.cxx index 6d0a130..4453e3d 100644 --- a/print/Publisher.cxx +++ b/print/Publisher.cxx @@ -47,7 +47,7 @@ PublisherApp::PublisherApp( , publisher_(nullptr) , topic_(nullptr) , writer_(nullptr) - , type_(new PrintRspPubSubType()) + , type_(new InternalSystem::PrintRspPubSubType()) , matched_(0) , samples_sent_(0) , stop_(false) @@ -190,7 +190,7 @@ bool PublisherApp::publish() if (!is_stopped()) { /* Initialize your structure here */ - InternalSystem::LicencePlateRsp sample_; + InternalSystem::PrintReq sample_; ret = (RETCODE_OK == writer_->write(&sample_)); } return ret; diff --git a/print/Subscriber.cxx b/print/Subscriber.cxx index d01f780..907a658 100644 --- a/print/Subscriber.cxx +++ b/print/Subscriber.cxx @@ -45,7 +45,7 @@ SubscriberApp::SubscriberApp( , subscriber_(nullptr) , topic_(nullptr) , reader_(nullptr) - , type_(new PrintReqPubSubType()) + , type_(new InternalSystem::PrintReqPubSubType()) , samples_received_(0) , stop_(false) { diff --git a/weigh/MsgHandler.cxx b/weigh/MsgHandler.cxx index 8de4a2a..90c0d3f 100644 --- a/weigh/MsgHandler.cxx +++ b/weigh/MsgHandler.cxx @@ -33,6 +33,13 @@ bool MsgHandler::SetDevice(const std::string& device) return true; } +bool MsgHandler::SetEmptyWeight(const int& empty_weight) +{ + this->empty_weight = empty_weight; + + return true; +} + int MsgHandler::SendDeviceMsg(const std::vector& data) { std::cout << "write to " << this->device << std::endl; diff --git a/weigh/MsgHandler.hpp b/weigh/MsgHandler.hpp index 4165132..7f7c842 100644 --- a/weigh/MsgHandler.hpp +++ b/weigh/MsgHandler.hpp @@ -10,6 +10,7 @@ class MsgHandler { public: int fd; std::string device; + int empty_weight; std::vector m_WeightData; MsgHandler(); @@ -19,6 +20,7 @@ public: template bool HandleDeviceMsg(T& msg); bool SetDevice(const std::string& device); + bool SetEmptyWeight(const int& empty_weight); virtual bool OpenPort(const std::string& port, const std::string& baudrate); virtual int SendDeviceMsg(const std::vector& data); diff --git a/weigh/Publisher.cxx b/weigh/Publisher.cxx index c8ba67f..ecbe03e 100644 --- a/weigh/Publisher.cxx +++ b/weigh/Publisher.cxx @@ -48,7 +48,7 @@ PublisherApp::PublisherApp( , publisher_(nullptr) , topic_(nullptr) , writer_(nullptr) - , type_(new WeighRspPubSubType()) + , type_(new WeighingSystem::ScaleInfoPubSubType()) , matched_(0) , samples_sent_(0) , stop_(false) @@ -64,7 +64,7 @@ PublisherApp::PublisherApp( participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none()); if (participant_ == nullptr) { - throw std::runtime_error("WeighRsp Participant initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleInfo Participant initialization failed"); } // Register the type @@ -76,28 +76,34 @@ PublisherApp::PublisherApp( publisher_ = participant_->create_publisher(pub_qos, nullptr, StatusMask::none()); if (publisher_ == nullptr) { - throw std::runtime_error("WeighRsp Publisher initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleInfo Publisher initialization failed"); } // Create the topic TopicQos topic_qos = TOPIC_QOS_DEFAULT; participant_->get_default_topic_qos(topic_qos); - topic_ = participant_->create_topic("WeighRspTopic", type_.get_type_name(), topic_qos); + topic_ = participant_->create_topic("ScaleInfo", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("WeighRsp Topic initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleInfo Topic initialization failed"); } // Create the data writer DataWriterQos writer_qos = DATAWRITER_QOS_DEFAULT; publisher_->get_default_datawriter_qos(writer_qos); writer_qos.reliability().kind = ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS; + writer_qos.reliability().max_blocking_time = Duration_t(1, 0); writer_qos.durability().kind = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS; writer_qos.history().kind = HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS; + writer_qos.history().depth = 1; + writer_qos.resource_limits().max_samples = 200; + writer_qos.resource_limits().max_instances = 1; + writer_qos.resource_limits().max_samples_per_instance = 100; + writer_qos.data_sharing().off(); writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all()); if (writer_ == nullptr) { - throw std::runtime_error("WeighRsp DataWriter initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleInfo DataWriter initialization failed"); } } @@ -143,13 +149,11 @@ void PublisherApp::on_publication_matched( void PublisherApp::run(std::shared_ptr handler) { - uint8_t send_stable = 0; - // 配置检测器 - 使用更合理的参数 WeightStabilityDetector::Config config; config.jitter_threshold = 30.0f; // 30kg抖动阈值 - config.min_weight_threshold = 5000.0f; // 5吨开始检测 - config.empty_car_threshold = 300.0f; // 300kg为空车 + config.min_weight_threshold = handler->empty_weight; // 300kg开始检测 + config.empty_car_threshold = handler->empty_weight; // 默认300kg为空车 config.fast_drop_threshold = 1000.0f; // 快速下降1吨认为车辆离开 config.required_stable_count = 6; // 6次稳定即可 config.min_jitter_count = 2; // 至少2次非增长 @@ -190,9 +194,9 @@ void PublisherApp::run(std::shared_ptr handler) std::unique_lock lock(MsgData::queue_cv_mtx_, std::try_to_lock); if (lock.owns_lock()) { - if(!MsgData::WeighReq_queue_.empty()) + if(!MsgData::ScaleCommand_queue_.empty()) { - MsgData::WeighReq_queue_.pop(); + MsgData::ScaleCommand_queue_.pop(); lock.unlock(); } else @@ -206,9 +210,6 @@ void PublisherApp::run(std::shared_ptr handler) float weight; if (handler->HandleDeviceMsg(weight) == true) { - WeighRsp rsp; - rsp.instantaneous_weight() = weight; - bool success = detector.processWeight(weight); if (!success) { @@ -236,22 +237,31 @@ void PublisherApp::run(std::shared_ptr handler) } // 如果稳定,显示稳定重量 + WeighingSystem::ScaleInfo info; + info.State() = 1; + if (weight < handler->empty_weight) + { + info.HasVehicle() = 0; + } + else + { + info.HasVehicle() = 1; + } if (detector.isStable()) { - if(send_stable == 0) - { - rsp.stable_weight() = rsp.instantaneous_weight(); - send_stable = 1; - } + info.WeightOK() = 1; + info.Value() = weight; + info.StableValue() = weight; std::cout << "STABLE WEIGHT: " << detector.getStableWeight() << " kg" << std::endl; } else { - rsp.stable_weight() = 0; - send_stable = 0; + info.WeightOK() = 0; + info.Value() = weight; + info.StableValue() = 0; } - writer_->write(&rsp); + writer_->write(&info); } } @@ -279,7 +289,7 @@ bool PublisherApp::publish() if (!is_stopped()) { /* Initialize your structure here */ - WeighRsp sample_; + WeighingSystem::ScaleInfo sample_; ret = (RETCODE_OK == writer_->write(&sample_)); } return ret; diff --git a/weigh/Subscriber.cxx b/weigh/Subscriber.cxx index ba53473..37b95b8 100644 --- a/weigh/Subscriber.cxx +++ b/weigh/Subscriber.cxx @@ -45,7 +45,7 @@ SubscriberApp::SubscriberApp( , subscriber_(nullptr) , topic_(nullptr) , reader_(nullptr) - , type_(new WeighReqPubSubType()) + , type_(new WeighingSystem::ScaleCommandPubSubType()) , 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("WeighReq Participant initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleCommand Participant initialization failed"); } // Register the type @@ -70,28 +70,34 @@ SubscriberApp::SubscriberApp( subscriber_ = participant_->create_subscriber(sub_qos, nullptr, StatusMask::none()); if (subscriber_ == nullptr) { - throw std::runtime_error("WeighReq Subscriber initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleCommand Subscriber initialization failed"); } // Create the topic TopicQos topic_qos = TOPIC_QOS_DEFAULT; participant_->get_default_topic_qos(topic_qos); - topic_ = participant_->create_topic("WeighReqTopic", type_.get_type_name(), topic_qos); + topic_ = participant_->create_topic("ScaleCommand", type_.get_type_name(), topic_qos); if (topic_ == nullptr) { - throw std::runtime_error("WeighReq Topic initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleCommand Topic initialization failed"); } // Create the reader DataReaderQos reader_qos = DATAREADER_QOS_DEFAULT; subscriber_->get_default_datareader_qos(reader_qos); reader_qos.reliability().kind = ReliabilityQosPolicyKind::RELIABLE_RELIABILITY_QOS; - reader_qos.durability().kind = DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS; + reader_qos.reliability().max_blocking_time = Duration_t(1, 0); + reader_qos.durability().kind = DurabilityQosPolicyKind::VOLATILE_DURABILITY_QOS; reader_qos.history().kind = HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS; + reader_qos.history().depth = 1; + reader_qos.resource_limits().max_samples = 200; + reader_qos.resource_limits().max_instances = 1; + reader_qos.resource_limits().max_samples_per_instance = 100; + reader_qos.data_sharing().off(); reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all()); if (reader_ == nullptr) { - throw std::runtime_error("WeighReq DataReader initialization failed"); + throw std::runtime_error("WeighingSystem::ScaleCommand DataReader initialization failed"); } } @@ -133,16 +139,16 @@ void SubscriberApp::on_data_available( std::string topic_name = reader->get_topicdescription()->get_name(); std::cout << topic_name << std::endl; - if (topic_name == "WeighReqTopic") + if (topic_name == "ScaleCommand") { - WeighReq sample_; + WeighingSystem::ScaleCommand sample_; while ((!is_stopped()) && (RETCODE_OK == reader->take_next_sample(&sample_, &info))) { if ((info.instance_state == ALIVE_INSTANCE_STATE) && info.valid_data) { { std::unique_lock lock(MsgData::queue_cv_mtx_); - MsgData::WeighReq_queue_.push(std::move(sample_)); + MsgData::ScaleCommand_queue_.push(std::move(sample_)); lock.unlock(); } } diff --git a/weigh/main.cxx b/weigh/main.cxx index 00bda76..388492d 100644 --- a/weigh/main.cxx +++ b/weigh/main.cxx @@ -64,7 +64,7 @@ std::string parse_signal( } } -std::queue MsgData::WeighReq_queue_; +std::queue MsgData::ScaleCommand_queue_; std::mutex MsgData::queue_cv_mtx_; int main(int argc, char** argv) @@ -78,7 +78,8 @@ int main(int argc, char** argv) const char* interface = "serial"; const char* port = "ttyS1"; const char* baudrate = "9600"; - const char* device = "Toledo"; + const char* device = "Keli"; + int empty_weight = 300; for (int i = 1; i < argc; i++) { @@ -102,6 +103,10 @@ int main(int argc, char** argv) { device = argv[++i]; } + else if (strcmp(argv[i], "--empty") == 0 && i + 1 < argc) + { + empty_weight = atoi(argv[++i]); + } else if (strcmp(argv[i], "--version") == 0) { std::cout << "Vesrion: " << VERSION << "\n"; @@ -116,6 +121,7 @@ int main(int argc, char** argv) << " --baudrate Set baudrate (e.g., 9600)\n" << " --port Set port name (e.g., ttyS1)\n" << " --device Set device name (e.g., Toledo)\n" + << " --empty Set empty weight (e.g., 300)\n" << " --version Show software Version\n" << " --help Show this help message\n"; return EXIT_SUCCESS; @@ -142,6 +148,7 @@ int main(int argc, char** argv) dev->OpenPort(port, baudrate); dev->SetDevice(device); + dev->SetEmptyWeight(empty_weight); std::thread pub_thread(&PublisherApp::run, pub, dev); diff --git a/weigh/msg.hpp b/weigh/msg.hpp index f533444..b1d4367 100644 --- a/weigh/msg.hpp +++ b/weigh/msg.hpp @@ -7,7 +7,7 @@ class MsgData { public: - static std::queue WeighReq_queue_; + static std::queue ScaleCommand_queue_; static std::mutex queue_cv_mtx_; };