yolo_seg_mqtt_async.h 858 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "pahoc/mqtt_async.h"
  3. #include "tool/log.hpp"
  4. #include "net_message_trans.h"
  5. #ifdef ENABLE_TENSORRT_DETECT
  6. #include "tensorrt_detect/wheel-detector.h"
  7. #else
  8. #include "onnx_detect/wheel-detector.h"
  9. #endif
  10. class YoloSegmentMqttAsyncClient : public MqttAsyncClient {
  11. friend class MqttAsyncClient;
  12. public:
  13. static YoloSegmentMqttAsyncClient *iter() {
  14. static YoloSegmentMqttAsyncClient *instance = nullptr;
  15. if (instance == nullptr) {
  16. instance = new YoloSegmentMqttAsyncClient();
  17. }
  18. return instance;
  19. }
  20. void init(const std::string &file);
  21. protected:
  22. private:
  23. YoloSegmentMqttAsyncClient() = default;
  24. static int CloudDataArrived(void *client, char *topicName, int topicLen, MQTTAsync_message *message);
  25. public:
  26. TensorrtWheelDetector *detector = nullptr;
  27. private:
  28. };