1. ioctrl和print修改为module InternalSystem。

main
baocm 9 months ago
parent 51e99c4e22
commit b7a813b18f

@ -129,7 +129,7 @@ void MsgHandler::HandleDdsMsg(const std::map<std::string, std::string>& msg)
}
}
int MsgHandler::ParseDeviceMsg(std::vector<uint8_t>& data, IoCtrlRsp& rsp)
int MsgHandler::ParseDeviceMsg(std::vector<uint8_t>& data, InternalSystem::IoCtrlRsp& rsp)
{
if (data[0] == this->device_id)
{
@ -158,7 +158,7 @@ int MsgHandler::ParseDeviceMsg(std::vector<uint8_t>& data, IoCtrlRsp& rsp)
return 0;
}
int MsgHandler::HandleDeviceMsg(IoCtrlRsp& rsp)
int MsgHandler::HandleDeviceMsg(InternalSystem::IoCtrlRsp& rsp)
{
std::vector<uint8_t> m_RecvData;

@ -26,7 +26,7 @@ public:
~MsgHandler() = default;
void HandleDdsMsg(const std::map<std::string, std::string>& msg);
int HandleDeviceMsg(IoCtrlRsp& rsp);
int HandleDeviceMsg(InternalSystem::IoCtrlRsp& rsp);
virtual bool OpenPort(const std::string& port, const std::string& baudrate);
virtual int SendDeviceMsg(std::vector<uint8_t>& data);
@ -39,7 +39,7 @@ public:
void ClosePort();
private:
int ParseDeviceMsg(std::vector<uint8_t>& data, IoCtrlRsp& rsp);
int ParseDeviceMsg(std::vector<uint8_t>& data, InternalSystem::IoCtrlRsp& rsp);
};
#endif

@ -47,7 +47,7 @@ PublisherApp::PublisherApp(
, publisher_(nullptr)
, topic_(nullptr)
, writer_(nullptr)
, type_(new IoCtrlRspPubSubType())
, type_(new InternalSystem::IoCtrlRspPubSubType())
, matched_(0)
, samples_sent_(0)
, stop_(false)
@ -63,7 +63,7 @@ PublisherApp::PublisherApp(
participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none());
if (participant_ == nullptr)
{
throw std::runtime_error("IoCtrlRsp Participant initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlRsp Participant initialization failed");
}
// Register the type
@ -75,16 +75,16 @@ PublisherApp::PublisherApp(
publisher_ = participant_->create_publisher(pub_qos, nullptr, StatusMask::none());
if (publisher_ == nullptr)
{
throw std::runtime_error("IoCtrlRsp Publisher initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlRsp Publisher initialization failed");
}
// Create the topic
TopicQos topic_qos = TOPIC_QOS_DEFAULT;
participant_->get_default_topic_qos(topic_qos);
topic_ = participant_->create_topic("IoCtrlRspTopic", type_.get_type_name(), topic_qos);
topic_ = participant_->create_topic("InternalSystem::IoCtrlRspTopic", type_.get_type_name(), topic_qos);
if (topic_ == nullptr)
{
throw std::runtime_error("IoCtrlRsp Topic initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlRsp Topic initialization failed");
}
// Create the data writer
@ -96,7 +96,7 @@ PublisherApp::PublisherApp(
writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all());
if (writer_ == nullptr)
{
throw std::runtime_error("IoCtrlRsp DataWriter initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlRsp DataWriter initialization failed");
}
}
@ -142,7 +142,7 @@ void PublisherApp::on_publication_matched(
void PublisherApp::run(std::shared_ptr<MsgHandler> handler)
{
IoCtrlRsp rsp;
InternalSystem::IoCtrlRsp rsp;
while (!is_stopped())
{
@ -179,7 +179,7 @@ bool PublisherApp::publish()
if (!is_stopped())
{
/* Initialize your structure here */
WeighRsp sample_;
InternalSystem::IoCtrlRsp sample_;
ret = (RETCODE_OK == writer_->write(&sample_));
}
return ret;

@ -45,7 +45,7 @@ SubscriberApp::SubscriberApp(
, subscriber_(nullptr)
, topic_(nullptr)
, reader_(nullptr)
, type_(new IoCtrlReqPubSubType())
, type_(new InternalSystem::IoCtrlReqPubSubType())
, samples_received_(0)
, stop_(false)
{
@ -58,7 +58,7 @@ SubscriberApp::SubscriberApp(
participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none());
if (participant_ == nullptr)
{
throw std::runtime_error("IoCtrlReq Participant initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlReq Participant initialization failed");
}
// Register the type
@ -70,16 +70,16 @@ SubscriberApp::SubscriberApp(
subscriber_ = participant_->create_subscriber(sub_qos, nullptr, StatusMask::none());
if (subscriber_ == nullptr)
{
throw std::runtime_error("IoCtrlReq Subscriber initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlReq Subscriber initialization failed");
}
// Create the topic
TopicQos topic_qos = TOPIC_QOS_DEFAULT;
participant_->get_default_topic_qos(topic_qos);
topic_ = participant_->create_topic("IoCtrlReqTopic", type_.get_type_name(), topic_qos);
topic_ = participant_->create_topic("InternalSystem::IoCtrlReqTopic", type_.get_type_name(), topic_qos);
if (topic_ == nullptr)
{
throw std::runtime_error("IoCtrlReq Topic initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlReq Topic initialization failed");
}
// Create the reader
@ -91,7 +91,7 @@ SubscriberApp::SubscriberApp(
reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all());
if (reader_ == nullptr)
{
throw std::runtime_error("IoCtrlReq DataReader initialization failed");
throw std::runtime_error("InternalSystem::IoCtrlReq DataReader initialization failed");
}
}
@ -133,9 +133,9 @@ void SubscriberApp::on_data_available(
std::string topic_name = reader->get_topicdescription()->get_name();
std::cout << topic_name << std::endl;
if (topic_name == "IoCtrlReqTopic")
if (topic_name == "InternalSystem::IoCtrlReqTopic")
{
IoCtrlReq sample_;
InternalSystem::IoCtrlReq sample_;
while ((!is_stopped()) && (RETCODE_OK == reader->take_next_sample(&sample_, &info)))
{
if ((info.instance_state == ALIVE_INSTANCE_STATE) && info.valid_data)
@ -159,7 +159,7 @@ void SubscriberApp::run(std::shared_ptr<MsgHandler> handler)
{
if(!MsgData::IoCtrlReq_queue_.empty())
{
IoCtrlReq req = std::move(MsgData::IoCtrlReq_queue_.front());
InternalSystem::IoCtrlReq req = std::move(MsgData::IoCtrlReq_queue_.front());
MsgData::IoCtrlReq_queue_.pop();
lock.unlock();
handler->HandleDdsMsg(req.msg());

@ -69,7 +69,7 @@ std::string parse_signal(
}
}
std::queue<IoCtrlReq> MsgData::IoCtrlReq_queue_;
std::queue<InternalSystem::IoCtrlReq> MsgData::IoCtrlReq_queue_;
std::mutex MsgData::queue_cv_mtx_;
std::filesystem::path getExeDir()

@ -7,7 +7,7 @@
class MsgData {
public:
static std::queue<IoCtrlReq> IoCtrlReq_queue_;
static std::queue<InternalSystem::IoCtrlReq> IoCtrlReq_queue_;
static std::mutex queue_cv_mtx_;
};

@ -19,8 +19,8 @@
* This file was generated by the tool fastddsgen.
*/
#ifndef FAST_DDS_GENERATED__SYSTEM_HPP
#define FAST_DDS_GENERATED__SYSTEM_HPP
#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_HPP
#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_HPP
#include <cstdint>
#include <map>
@ -52,6 +52,8 @@
#define SYSTEM_DllAPI
#endif // _WIN32
namespace InternalSystem {
/*!
* @brief This class represents the structure LicencePlateReq defined by the user in the IDL file.
* @ingroup System
@ -1440,6 +1442,8 @@ private:
};
#endif // _FAST_DDS_GENERATED_SYSTEM_HPP_
} // namespace InternalSystem
#endif // _FAST_DDS_GENERATED_INTERNALSYSTEM_SYSTEM_HPP_

@ -1,4 +1,7 @@
@extensibility(APPENDABLE)
module InternalSystem
{
struct LicencePlateReq
{
unsigned long index;
@ -36,7 +39,6 @@ struct WeighRsp
float instantaneous_weight;
};
// private
struct IoCtrlReq
{
unsigned long index;
@ -48,3 +50,4 @@ struct IoCtrlRsp
unsigned long index;
map<string, string> msg;
};
};

@ -19,34 +19,34 @@
* This file was generated by the tool fastddsgen.
*/
#ifndef FAST_DDS_GENERATED__SYSTEMCDRAUX_HPP
#define FAST_DDS_GENERATED__SYSTEMCDRAUX_HPP
#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_HPP
#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_HPP
#include "System.hpp"
constexpr uint32_t PrintReq_max_cdr_typesize {16UL};
constexpr uint32_t PrintReq_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_WeighRsp_max_cdr_typesize {16UL};
constexpr uint32_t InternalSystem_WeighRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t LicencePlateRsp_max_cdr_typesize {268UL};
constexpr uint32_t LicencePlateRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_PrintRsp_max_cdr_typesize {268UL};
constexpr uint32_t InternalSystem_PrintRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t LicencePlateReq_max_cdr_typesize {16UL};
constexpr uint32_t LicencePlateReq_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_WeighReq_max_cdr_typesize {16UL};
constexpr uint32_t InternalSystem_WeighReq_max_key_cdr_typesize {0UL};
constexpr uint32_t WeighReq_max_cdr_typesize {16UL};
constexpr uint32_t WeighReq_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_PrintReq_max_cdr_typesize {16UL};
constexpr uint32_t InternalSystem_PrintReq_max_key_cdr_typesize {0UL};
constexpr uint32_t PrintRsp_max_cdr_typesize {268UL};
constexpr uint32_t PrintRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_LicencePlateReq_max_cdr_typesize {16UL};
constexpr uint32_t InternalSystem_LicencePlateReq_max_key_cdr_typesize {0UL};
constexpr uint32_t WeighRsp_max_cdr_typesize {16UL};
constexpr uint32_t WeighRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_IoCtrlRsp_max_cdr_typesize {16UL};
constexpr uint32_t InternalSystem_IoCtrlRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t IoCtrlRsp_max_cdr_typesize {16UL};
constexpr uint32_t IoCtrlRsp_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_IoCtrlReq_max_cdr_typesize {16UL};
constexpr uint32_t InternalSystem_IoCtrlReq_max_key_cdr_typesize {0UL};
constexpr uint32_t IoCtrlReq_max_cdr_typesize {16UL};
constexpr uint32_t IoCtrlReq_max_key_cdr_typesize {0UL};
constexpr uint32_t InternalSystem_LicencePlateRsp_max_cdr_typesize {268UL};
constexpr uint32_t InternalSystem_LicencePlateRsp_max_key_cdr_typesize {0UL};
namespace eprosima {
@ -57,39 +57,39 @@ class CdrSizeCalculator;
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const LicencePlateReq& data);
const InternalSystem::LicencePlateReq& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const LicencePlateRsp& data);
const InternalSystem::LicencePlateRsp& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const PrintReq& data);
const InternalSystem::PrintReq& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const PrintRsp& data);
const InternalSystem::PrintRsp& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const WeighReq& data);
const InternalSystem::WeighReq& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const WeighRsp& data);
const InternalSystem::WeighRsp& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const IoCtrlReq& data);
const InternalSystem::IoCtrlReq& data);
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const IoCtrlRsp& data);
const InternalSystem::IoCtrlRsp& data);
} // namespace fastcdr
} // namespace eprosima
#endif // FAST_DDS_GENERATED__SYSTEMCDRAUX_HPP
#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_HPP

@ -19,8 +19,8 @@
* This file was generated by the tool fastddsgen.
*/
#ifndef FAST_DDS_GENERATED__SYSTEMCDRAUX_IPP
#define FAST_DDS_GENERATED__SYSTEMCDRAUX_IPP
#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_IPP
#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_IPP
#include "SystemCdrAux.hpp"
@ -37,9 +37,11 @@ namespace fastcdr {
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const LicencePlateReq& data,
const InternalSystem::LicencePlateReq& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -65,8 +67,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const LicencePlateReq& data)
const InternalSystem::LicencePlateReq& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -83,8 +87,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
LicencePlateReq& data)
InternalSystem::LicencePlateReq& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -111,8 +117,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const LicencePlateReq& data)
const InternalSystem::LicencePlateReq& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -126,9 +133,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const LicencePlateRsp& data,
const InternalSystem::LicencePlateRsp& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -154,8 +163,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const LicencePlateRsp& data)
const InternalSystem::LicencePlateRsp& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -172,8 +183,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
LicencePlateRsp& data)
InternalSystem::LicencePlateRsp& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -200,8 +213,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const LicencePlateRsp& data)
const InternalSystem::LicencePlateRsp& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -215,9 +229,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const PrintReq& data,
const InternalSystem::PrintReq& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -243,8 +259,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const PrintReq& data)
const InternalSystem::PrintReq& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -261,8 +279,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
PrintReq& data)
InternalSystem::PrintReq& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -289,8 +309,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const PrintReq& data)
const InternalSystem::PrintReq& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -304,9 +325,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const PrintRsp& data,
const InternalSystem::PrintRsp& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -332,8 +355,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const PrintRsp& data)
const InternalSystem::PrintRsp& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -350,8 +375,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
PrintRsp& data)
InternalSystem::PrintRsp& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -378,8 +405,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const PrintRsp& data)
const InternalSystem::PrintRsp& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -393,9 +421,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const WeighReq& data,
const InternalSystem::WeighReq& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -421,8 +451,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const WeighReq& data)
const InternalSystem::WeighReq& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -439,8 +471,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
WeighReq& data)
InternalSystem::WeighReq& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -467,8 +501,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const WeighReq& data)
const InternalSystem::WeighReq& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -482,9 +517,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const WeighRsp& data,
const InternalSystem::WeighRsp& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -513,8 +550,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const WeighRsp& data)
const InternalSystem::WeighRsp& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -532,8 +571,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
WeighRsp& data)
InternalSystem::WeighRsp& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -564,8 +605,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const WeighRsp& data)
const InternalSystem::WeighRsp& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -581,9 +623,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const IoCtrlReq& data,
const InternalSystem::IoCtrlReq& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -609,8 +653,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const IoCtrlReq& data)
const InternalSystem::IoCtrlReq& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -627,8 +673,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
IoCtrlReq& data)
InternalSystem::IoCtrlReq& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -655,8 +703,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const IoCtrlReq& data)
const InternalSystem::IoCtrlReq& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -670,9 +719,11 @@ void serialize_key(
template<>
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const IoCtrlRsp& data,
const InternalSystem::IoCtrlRsp& data,
size_t& current_alignment)
{
using namespace InternalSystem;
static_cast<void>(data);
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
@ -698,8 +749,10 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<>
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const IoCtrlRsp& data)
const InternalSystem::IoCtrlRsp& data)
{
using namespace InternalSystem;
eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state,
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
@ -716,8 +769,10 @@ eProsima_user_DllExport void serialize(
template<>
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
IoCtrlRsp& data)
InternalSystem::IoCtrlRsp& data)
{
using namespace InternalSystem;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
@ -744,8 +799,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const IoCtrlRsp& data)
const InternalSystem::IoCtrlRsp& data)
{
using namespace InternalSystem;
static_cast<void>(scdr);
static_cast<void>(data);
@ -760,5 +816,5 @@ void serialize_key(
} // namespace fastcdr
} // namespace eprosima
#endif // FAST_DDS_GENERATED__SYSTEMCDRAUX_IPP
#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEMCDRAUX_IPP

@ -31,14 +31,15 @@ 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()
{
set_name("LicencePlateReq");
uint32_t type_size = LicencePlateReq_max_cdr_typesize;
set_name("InternalSystem::LicencePlateReq");
uint32_t type_size = InternalSystem_LicencePlateReq_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = LicencePlateReq_max_key_cdr_typesize > 16 ? LicencePlateReq_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_LicencePlateReq_max_key_cdr_typesize > 16 ? InternalSystem_LicencePlateReq_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -182,13 +183,13 @@ bool LicencePlateReqPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
LicencePlateReq_max_key_cdr_typesize);
InternalSystem_LicencePlateReq_max_key_cdr_typesize);
// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || LicencePlateReq_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_LicencePlateReq_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -215,12 +216,12 @@ void LicencePlateReqPubSubType::register_type_object_representation()
LicencePlateRspPubSubType::LicencePlateRspPubSubType()
{
set_name("LicencePlateRsp");
uint32_t type_size = LicencePlateRsp_max_cdr_typesize;
set_name("InternalSystem::LicencePlateRsp");
uint32_t type_size = InternalSystem_LicencePlateRsp_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = LicencePlateRsp_max_key_cdr_typesize > 16 ? LicencePlateRsp_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_LicencePlateRsp_max_key_cdr_typesize > 16 ? InternalSystem_LicencePlateRsp_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -364,13 +365,13 @@ bool LicencePlateRspPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
LicencePlateRsp_max_key_cdr_typesize);
InternalSystem_LicencePlateRsp_max_key_cdr_typesize);
// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || LicencePlateRsp_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_LicencePlateRsp_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -397,12 +398,12 @@ void LicencePlateRspPubSubType::register_type_object_representation()
PrintReqPubSubType::PrintReqPubSubType()
{
set_name("PrintReq");
uint32_t type_size = PrintReq_max_cdr_typesize;
set_name("InternalSystem::PrintReq");
uint32_t type_size = InternalSystem_PrintReq_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = PrintReq_max_key_cdr_typesize > 16 ? PrintReq_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_PrintReq_max_key_cdr_typesize > 16 ? InternalSystem_PrintReq_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -546,13 +547,13 @@ bool PrintReqPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
PrintReq_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 || PrintReq_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_PrintReq_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -579,12 +580,12 @@ void PrintReqPubSubType::register_type_object_representation()
PrintRspPubSubType::PrintRspPubSubType()
{
set_name("PrintRsp");
uint32_t type_size = PrintRsp_max_cdr_typesize;
set_name("InternalSystem::PrintRsp");
uint32_t type_size = InternalSystem_PrintRsp_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = PrintRsp_max_key_cdr_typesize > 16 ? PrintRsp_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_PrintRsp_max_key_cdr_typesize > 16 ? InternalSystem_PrintRsp_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -728,13 +729,13 @@ bool PrintRspPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
PrintRsp_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 || PrintRsp_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_PrintRsp_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -761,12 +762,12 @@ void PrintRspPubSubType::register_type_object_representation()
WeighReqPubSubType::WeighReqPubSubType()
{
set_name("WeighReq");
uint32_t type_size = WeighReq_max_cdr_typesize;
set_name("InternalSystem::WeighReq");
uint32_t type_size = InternalSystem_WeighReq_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = WeighReq_max_key_cdr_typesize > 16 ? WeighReq_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_WeighReq_max_key_cdr_typesize > 16 ? InternalSystem_WeighReq_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -910,13 +911,13 @@ bool WeighReqPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
WeighReq_max_key_cdr_typesize);
InternalSystem_WeighReq_max_key_cdr_typesize);
// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || WeighReq_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_WeighReq_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -943,12 +944,12 @@ void WeighReqPubSubType::register_type_object_representation()
WeighRspPubSubType::WeighRspPubSubType()
{
set_name("WeighRsp");
uint32_t type_size = WeighRsp_max_cdr_typesize;
set_name("InternalSystem::WeighRsp");
uint32_t type_size = InternalSystem_WeighRsp_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = WeighRsp_max_key_cdr_typesize > 16 ? WeighRsp_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_WeighRsp_max_key_cdr_typesize > 16 ? InternalSystem_WeighRsp_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -1092,13 +1093,13 @@ bool WeighRspPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
WeighRsp_max_key_cdr_typesize);
InternalSystem_WeighRsp_max_key_cdr_typesize);
// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || WeighRsp_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_WeighRsp_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -1125,12 +1126,12 @@ void WeighRspPubSubType::register_type_object_representation()
IoCtrlReqPubSubType::IoCtrlReqPubSubType()
{
set_name("IoCtrlReq");
uint32_t type_size = IoCtrlReq_max_cdr_typesize;
set_name("InternalSystem::IoCtrlReq");
uint32_t type_size = InternalSystem_IoCtrlReq_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = IoCtrlReq_max_key_cdr_typesize > 16 ? IoCtrlReq_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_IoCtrlReq_max_key_cdr_typesize > 16 ? InternalSystem_IoCtrlReq_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -1274,13 +1275,13 @@ bool IoCtrlReqPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
IoCtrlReq_max_key_cdr_typesize);
InternalSystem_IoCtrlReq_max_key_cdr_typesize);
// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || IoCtrlReq_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_IoCtrlReq_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -1307,12 +1308,12 @@ void IoCtrlReqPubSubType::register_type_object_representation()
IoCtrlRspPubSubType::IoCtrlRspPubSubType()
{
set_name("IoCtrlRsp");
uint32_t type_size = IoCtrlRsp_max_cdr_typesize;
set_name("InternalSystem::IoCtrlRsp");
uint32_t type_size = InternalSystem_IoCtrlRsp_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false;
uint32_t key_length = IoCtrlRsp_max_key_cdr_typesize > 16 ? IoCtrlRsp_max_key_cdr_typesize : 16;
uint32_t key_length = InternalSystem_IoCtrlRsp_max_key_cdr_typesize > 16 ? InternalSystem_IoCtrlRsp_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length);
}
@ -1456,13 +1457,13 @@ bool IoCtrlRspPubSubType::compute_key(
// Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
IoCtrlRsp_max_key_cdr_typesize);
InternalSystem_IoCtrlRsp_max_key_cdr_typesize);
// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || IoCtrlRsp_max_key_cdr_typesize > 16)
if (force_md5 || InternalSystem_IoCtrlRsp_max_key_cdr_typesize > 16)
{
md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -1487,6 +1488,8 @@ void IoCtrlRspPubSubType::register_type_object_representation()
register_IoCtrlRsp_type_identifier(type_identifiers_);
}
} // namespace InternalSystem
// Include auxiliary functions like for serializing/deserializing.
#include "SystemCdrAux.ipp"

@ -20,8 +20,8 @@
*/
#ifndef FAST_DDS_GENERATED__SYSTEM_PUBSUBTYPES_HPP
#define FAST_DDS_GENERATED__SYSTEM_PUBSUBTYPES_HPP
#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_PUBSUBTYPES_HPP
#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_PUBSUBTYPES_HPP
#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/topic/TopicDataType.hpp>
@ -37,6 +37,8 @@
Generated System is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
#endif // FASTDDS_GEN_API_VER
namespace InternalSystem
{
/*!
* @brief This class represents the TopicDataType of the type LicencePlateReq defined by the user in the IDL file.
@ -685,6 +687,7 @@ private:
unsigned char* key_buffer_;
};
} // namespace InternalSystem
#endif // FAST_DDS_GENERATED__SYSTEM_PUBSUBTYPES_HPP
#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_PUBSUBTYPES_HPP

@ -38,6 +38,7 @@
using namespace eprosima::fastdds::dds::xtypes;
namespace InternalSystem {
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_LicencePlateReq_type_identifier(
TypeIdentifierPair& type_ids_LicencePlateReq)
@ -46,21 +47,14 @@ void register_LicencePlateReq_type_identifier(
ReturnCode_t return_code_LicencePlateReq {eprosima::fastdds::dds::RETCODE_OK};
return_code_LicencePlateReq =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"LicencePlateReq", type_ids_LicencePlateReq);
"InternalSystem::LicencePlateReq", type_ids_LicencePlateReq);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicencePlateReq)
{
StructTypeFlag struct_flags_LicencePlateReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_LicencePlateReq = "LicencePlateReq";
QualifiedTypeName type_name_LicencePlateReq = "InternalSystem::LicencePlateReq";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_LicencePlateReq;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_LicencePlateReq;
AppliedAnnotationSeq tmp_ann_custom_LicencePlateReq;
eprosima::fastcdr::optional<AppliedVerbatimAnnotation> verbatim_LicencePlateReq;
if (!tmp_ann_custom_LicencePlateReq.empty())
{
ann_custom_LicencePlateReq = tmp_ann_custom_LicencePlateReq;
}
CompleteTypeDetail detail_LicencePlateReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LicencePlateReq, ann_custom_LicencePlateReq, type_name_LicencePlateReq.to_string());
CompleteStructHeader header_LicencePlateReq;
header_LicencePlateReq = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_LicencePlateReq);
@ -205,7 +199,7 @@ void register_LicencePlateReq_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicencePlateReq, type_name_LicencePlateReq.to_string(), type_ids_LicencePlateReq))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"LicencePlateReq already registered in TypeObjectRegistry for a different type.");
"InternalSystem::LicencePlateReq already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -217,12 +211,12 @@ void register_LicencePlateRsp_type_identifier(
ReturnCode_t return_code_LicencePlateRsp {eprosima::fastdds::dds::RETCODE_OK};
return_code_LicencePlateRsp =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"LicencePlateRsp", type_ids_LicencePlateRsp);
"InternalSystem::LicencePlateRsp", type_ids_LicencePlateRsp);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_LicencePlateRsp)
{
StructTypeFlag struct_flags_LicencePlateRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_LicencePlateRsp = "LicencePlateRsp";
QualifiedTypeName type_name_LicencePlateRsp = "InternalSystem::LicencePlateRsp";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_LicencePlateRsp;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_LicencePlateRsp;
CompleteTypeDetail detail_LicencePlateRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_LicencePlateRsp, ann_custom_LicencePlateRsp, type_name_LicencePlateRsp.to_string());
@ -302,7 +296,7 @@ void register_LicencePlateRsp_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_LicencePlateRsp, type_name_LicencePlateRsp.to_string(), type_ids_LicencePlateRsp))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"LicencePlateRsp already registered in TypeObjectRegistry for a different type.");
"InternalSystem::LicencePlateRsp already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -314,12 +308,12 @@ void register_PrintReq_type_identifier(
ReturnCode_t return_code_PrintReq {eprosima::fastdds::dds::RETCODE_OK};
return_code_PrintReq =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"PrintReq", type_ids_PrintReq);
"InternalSystem::PrintReq", type_ids_PrintReq);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_PrintReq)
{
StructTypeFlag struct_flags_PrintReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_PrintReq = "PrintReq";
QualifiedTypeName type_name_PrintReq = "InternalSystem::PrintReq";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_PrintReq;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_PrintReq;
CompleteTypeDetail detail_PrintReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PrintReq, ann_custom_PrintReq, type_name_PrintReq.to_string());
@ -466,7 +460,7 @@ void register_PrintReq_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_PrintReq, type_name_PrintReq.to_string(), type_ids_PrintReq))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"PrintReq already registered in TypeObjectRegistry for a different type.");
"InternalSystem::PrintReq already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -478,12 +472,12 @@ void register_PrintRsp_type_identifier(
ReturnCode_t return_code_PrintRsp {eprosima::fastdds::dds::RETCODE_OK};
return_code_PrintRsp =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"PrintRsp", type_ids_PrintRsp);
"InternalSystem::PrintRsp", type_ids_PrintRsp);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_PrintRsp)
{
StructTypeFlag struct_flags_PrintRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_PrintRsp = "PrintRsp";
QualifiedTypeName type_name_PrintRsp = "InternalSystem::PrintRsp";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_PrintRsp;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_PrintRsp;
CompleteTypeDetail detail_PrintRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_PrintRsp, ann_custom_PrintRsp, type_name_PrintRsp.to_string());
@ -563,7 +557,7 @@ void register_PrintRsp_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_PrintRsp, type_name_PrintRsp.to_string(), type_ids_PrintRsp))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"PrintRsp already registered in TypeObjectRegistry for a different type.");
"InternalSystem::PrintRsp already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -575,12 +569,12 @@ void register_WeighReq_type_identifier(
ReturnCode_t return_code_WeighReq {eprosima::fastdds::dds::RETCODE_OK};
return_code_WeighReq =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"WeighReq", type_ids_WeighReq);
"InternalSystem::WeighReq", type_ids_WeighReq);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeighReq)
{
StructTypeFlag struct_flags_WeighReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_WeighReq = "WeighReq";
QualifiedTypeName type_name_WeighReq = "InternalSystem::WeighReq";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_WeighReq;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_WeighReq;
CompleteTypeDetail detail_WeighReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeighReq, ann_custom_WeighReq, type_name_WeighReq.to_string());
@ -727,7 +721,7 @@ void register_WeighReq_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeighReq, type_name_WeighReq.to_string(), type_ids_WeighReq))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"WeighReq already registered in TypeObjectRegistry for a different type.");
"InternalSystem::WeighReq already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -739,12 +733,12 @@ void register_WeighRsp_type_identifier(
ReturnCode_t return_code_WeighRsp {eprosima::fastdds::dds::RETCODE_OK};
return_code_WeighRsp =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"WeighRsp", type_ids_WeighRsp);
"InternalSystem::WeighRsp", type_ids_WeighRsp);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeighRsp)
{
StructTypeFlag struct_flags_WeighRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_WeighRsp = "WeighRsp";
QualifiedTypeName type_name_WeighRsp = "InternalSystem::WeighRsp";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_WeighRsp;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_WeighRsp;
CompleteTypeDetail detail_WeighRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeighRsp, ann_custom_WeighRsp, type_name_WeighRsp.to_string());
@ -846,7 +840,7 @@ void register_WeighRsp_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeighRsp, type_name_WeighRsp.to_string(), type_ids_WeighRsp))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"WeighRsp already registered in TypeObjectRegistry for a different type.");
"InternalSystem::WeighRsp already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -858,12 +852,12 @@ void register_IoCtrlReq_type_identifier(
ReturnCode_t return_code_IoCtrlReq {eprosima::fastdds::dds::RETCODE_OK};
return_code_IoCtrlReq =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"IoCtrlReq", type_ids_IoCtrlReq);
"InternalSystem::IoCtrlReq", type_ids_IoCtrlReq);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_IoCtrlReq)
{
StructTypeFlag struct_flags_IoCtrlReq = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_IoCtrlReq = "IoCtrlReq";
QualifiedTypeName type_name_IoCtrlReq = "InternalSystem::IoCtrlReq";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_IoCtrlReq;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_IoCtrlReq;
CompleteTypeDetail detail_IoCtrlReq = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IoCtrlReq, ann_custom_IoCtrlReq, type_name_IoCtrlReq.to_string());
@ -1010,7 +1004,7 @@ void register_IoCtrlReq_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_IoCtrlReq, type_name_IoCtrlReq.to_string(), type_ids_IoCtrlReq))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"IoCtrlReq already registered in TypeObjectRegistry for a different type.");
"InternalSystem::IoCtrlReq already registered in TypeObjectRegistry for a different type.");
}
}
}
@ -1022,12 +1016,12 @@ void register_IoCtrlRsp_type_identifier(
ReturnCode_t return_code_IoCtrlRsp {eprosima::fastdds::dds::RETCODE_OK};
return_code_IoCtrlRsp =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"IoCtrlRsp", type_ids_IoCtrlRsp);
"InternalSystem::IoCtrlRsp", type_ids_IoCtrlRsp);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_IoCtrlRsp)
{
StructTypeFlag struct_flags_IoCtrlRsp = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false);
QualifiedTypeName type_name_IoCtrlRsp = "IoCtrlRsp";
QualifiedTypeName type_name_IoCtrlRsp = "InternalSystem::IoCtrlRsp";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_IoCtrlRsp;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_IoCtrlRsp;
CompleteTypeDetail detail_IoCtrlRsp = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_IoCtrlRsp, ann_custom_IoCtrlRsp, type_name_IoCtrlRsp.to_string());
@ -1174,8 +1168,10 @@ void register_IoCtrlRsp_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_IoCtrlRsp, type_name_IoCtrlRsp.to_string(), type_ids_IoCtrlRsp))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"IoCtrlRsp already registered in TypeObjectRegistry for a different type.");
"InternalSystem::IoCtrlRsp already registered in TypeObjectRegistry for a different type.");
}
}
}
} // namespace InternalSystem

@ -19,8 +19,8 @@
* This file was generated by the tool fastddsgen.
*/
#ifndef FAST_DDS_GENERATED__SYSTEM_TYPE_OBJECT_SUPPORT_HPP
#define FAST_DDS_GENERATED__SYSTEM_TYPE_OBJECT_SUPPORT_HPP
#ifndef FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_TYPE_OBJECT_SUPPORT_HPP
#define FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_TYPE_OBJECT_SUPPORT_HPP
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
@ -37,6 +37,7 @@
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
namespace InternalSystem {
/**
* @brief Register LicencePlateReq related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -49,6 +50,7 @@
*/
eProsima_user_DllExport void register_LicencePlateReq_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register LicencePlateRsp related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -61,6 +63,7 @@ eProsima_user_DllExport void register_LicencePlateReq_type_identifier(
*/
eProsima_user_DllExport void register_LicencePlateRsp_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register PrintReq related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -73,6 +76,7 @@ eProsima_user_DllExport void register_LicencePlateRsp_type_identifier(
*/
eProsima_user_DllExport void register_PrintReq_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register PrintRsp related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -85,6 +89,7 @@ eProsima_user_DllExport void register_PrintReq_type_identifier(
*/
eProsima_user_DllExport void register_PrintRsp_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register WeighReq related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -97,6 +102,7 @@ eProsima_user_DllExport void register_PrintRsp_type_identifier(
*/
eProsima_user_DllExport void register_WeighReq_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register WeighRsp related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -109,6 +115,7 @@ eProsima_user_DllExport void register_WeighReq_type_identifier(
*/
eProsima_user_DllExport void register_WeighRsp_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register IoCtrlReq related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -121,6 +128,7 @@ eProsima_user_DllExport void register_WeighRsp_type_identifier(
*/
eProsima_user_DllExport void register_IoCtrlReq_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
/**
* @brief Register IoCtrlRsp related TypeIdentifier.
* Fully-descriptive TypeIdentifiers are directly registered.
@ -134,7 +142,9 @@ eProsima_user_DllExport void register_IoCtrlReq_type_identifier(
eProsima_user_DllExport void register_IoCtrlRsp_type_identifier(
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
} // namespace InternalSystem
#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
#endif // FAST_DDS_GENERATED__SYSTEM_TYPE_OBJECT_SUPPORT_HPP
#endif // FAST_DDS_GENERATED__INTERNALSYSTEM_SYSTEM_TYPE_OBJECT_SUPPORT_HPP

@ -63,7 +63,7 @@ PublisherApp::PublisherApp(
participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none());
if (participant_ == nullptr)
{
throw std::runtime_error("PrintRsp Participant initialization failed");
throw std::runtime_error("InternalSystem::PrintRsp Participant initialization failed");
}
// Register the type
@ -75,7 +75,7 @@ PublisherApp::PublisherApp(
publisher_ = participant_->create_publisher(pub_qos, nullptr, StatusMask::none());
if (publisher_ == nullptr)
{
throw std::runtime_error("PrintRsp Publisher initialization failed");
throw std::runtime_error("InternalSystem::PrintRsp Publisher initialization failed");
}
// Create the topic
@ -84,7 +84,7 @@ PublisherApp::PublisherApp(
topic_ = participant_->create_topic("PrintRspTopic", type_.get_type_name(), topic_qos);
if (topic_ == nullptr)
{
throw std::runtime_error("PrintRsp Topic initialization failed");
throw std::runtime_error("InternalSystem::PrintRsp Topic initialization failed");
}
// Create the data writer
@ -96,7 +96,7 @@ PublisherApp::PublisherApp(
writer_ = publisher_->create_datawriter(topic_, writer_qos, this, StatusMask::all());
if (writer_ == nullptr)
{
throw std::runtime_error("PrintRsp DataWriter initialization failed");
throw std::runtime_error("InternalSystem::PrintRsp DataWriter initialization failed");
}
}
@ -149,14 +149,14 @@ void PublisherApp::run(std::shared_ptr<MsgHandler> handler)
{
if(!MsgData::PrintReq_queue_.empty())
{
PrintReq req = std::move(MsgData::PrintReq_queue_.front());
InternalSystem::PrintReq req = std::move(MsgData::PrintReq_queue_.front());
MsgData::PrintReq_queue_.pop();
lock.unlock();
std::cout << "index: " << req.index() << std::endl;
handler->HandleDdsMsg(req.msg());
PrintRsp rsp;
InternalSystem::PrintRsp rsp;
rsp.index() = req.index();
rsp.msg() = "success";
writer_->write(&rsp);
@ -190,7 +190,7 @@ bool PublisherApp::publish()
if (!is_stopped())
{
/* Initialize your structure here */
WeighRsp sample_;
InternalSystem::LicencePlateRsp sample_;
ret = (RETCODE_OK == writer_->write(&sample_));
}
return ret;

@ -58,7 +58,7 @@ SubscriberApp::SubscriberApp(
participant_ = factory_->create_participant(domain_id, pqos, nullptr, StatusMask::none());
if (participant_ == nullptr)
{
throw std::runtime_error("PrintReq Participant initialization failed");
throw std::runtime_error("InternalSystem::PrintReq Participant initialization failed");
}
// Register the type
@ -70,7 +70,7 @@ SubscriberApp::SubscriberApp(
subscriber_ = participant_->create_subscriber(sub_qos, nullptr, StatusMask::none());
if (subscriber_ == nullptr)
{
throw std::runtime_error("PrintReq Subscriber initialization failed");
throw std::runtime_error("InternalSystem::PrintReq Subscriber initialization failed");
}
// Create the topic
@ -79,7 +79,7 @@ SubscriberApp::SubscriberApp(
topic_ = participant_->create_topic("PrintReqTopic", type_.get_type_name(), topic_qos);
if (topic_ == nullptr)
{
throw std::runtime_error("PrintReq Topic initialization failed");
throw std::runtime_error("InternalSystem::PrintReq Topic initialization failed");
}
// Create the reader
@ -91,7 +91,7 @@ SubscriberApp::SubscriberApp(
reader_ = subscriber_->create_datareader(topic_, reader_qos, this, StatusMask::all());
if (reader_ == nullptr)
{
throw std::runtime_error("PrintReq DataReader initialization failed");
throw std::runtime_error("InternalSystem::PrintReq DataReader initialization failed");
}
}
@ -135,7 +135,7 @@ void SubscriberApp::on_data_available(
if (topic_name == "PrintReqTopic")
{
PrintReq sample_;
InternalSystem::PrintReq sample_;
while ((!is_stopped()) && (RETCODE_OK == reader->take_next_sample(&sample_, &info)))
{
if ((info.instance_state == ALIVE_INSTANCE_STATE) && info.valid_data)

@ -64,7 +64,7 @@ std::string parse_signal(
}
}
std::queue<PrintReq> MsgData::PrintReq_queue_;
std::queue<InternalSystem::PrintReq> MsgData::PrintReq_queue_;
std::mutex MsgData::queue_cv_mtx_;
int main(int argc, char** argv)

@ -7,7 +7,7 @@
class MsgData {
public:
static std::queue<PrintReq> PrintReq_queue_;
static std::queue<InternalSystem::PrintReq> PrintReq_queue_;
static std::mutex queue_cv_mtx_;
};

Loading…
Cancel
Save