奥特QT DDS 插件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
527B

  1. #include "dds_manager.hpp"
  2. #include <QDebug>
  3. DDSManager::DDSManager(QObject *parent)
  4. : QObject(parent)
  5. , publisher_(std::make_unique<HelloWorldPublisher>())
  6. {
  7. }
  8. DDSManager::~DDSManager() = default;
  9. bool DDSManager::init()
  10. {
  11. return publisher_->init();
  12. }
  13. void DDSManager::publishOnce()
  14. {
  15. if (publisher_->publish())
  16. {
  17. emit messagePublished(
  18. QString::fromStdString(publisher_->getCurrentMessage()),
  19. publisher_->getCurrentIndex()
  20. );
  21. }
  22. }