#pragma once #include #include #include "interfaces/plugin_interface.hpp" #include #include #include #include using namespace eprosima::fastdds::dds; //AQTSampleMachinePlug //AQTSAMPLEMACHINEPLUG #ifdef AQTSAMPLEMACHINEPLUG #define AQTSAMPLEMACHINEPLUG Q_DECL_EXPORT #else #define AQTSAMPLEMACHINEPLUG Q_DECL_IMPORT #endif class AQTSAMPLEMACHINEPLUG AQTSampleMachinePlug : public QObject, public AuseftDDSPluginInterface { Q_OBJECT Q_PLUGIN_METADATA(IID AuseftDDSPluginInterface_iid) Q_INTERFACES(AuseftDDSPluginInterface) public: explicit AQTSampleMachinePlug(QObject *parent = nullptr); ~AQTSampleMachinePlug(); Q_INVOKABLE bool init() override; Q_INVOKABLE void publishOnce() override; Q_INVOKABLE QString echo(const QString& message) override; Q_INVOKABLE int calculate(int a, int b) override; signals: void messagePublished(const QString& message, int index); private: DomainParticipant* participant_; Publisher* publisher_; Topic* topic_; DataWriter* writer_; TypeSupport type_; int message_index_; };